public class PrimitiveParser

Summary

Utility class for extracting typed values from strings.

Constructor Summary

Flags Name Summary
public PrimitiveParser()

(undocumented)

Method Summary

Flags Name Summary
public static void InvalidConversion(string target, object source)

Causes ProtocolViolationException to be thrown; called by the various "Parse*" methods when a syntax error is detected.

public static bool ParseBool(string value)

Attempt to parse a string representation of a bool.

public static byte ParseByte(string value)

Attempt to parse a string representation of a byte.

public static double ParseDouble(string value)

Attempt to parse a string representation of a double.

public static single ParseFloat(string value)

Attempt to parse a string representation of a float.

public static int ParseInt(string value)

Attempt to parse a string representation of an int.

public static long ParseLong(string value)

Attempt to parse a string representation of a long.

public static short ParseShort(string value)

Attempt to parse a string representation of a short.

Constructor Detail

PrimitiveParser

public PrimitiveParser()

Method Detail

InvalidConversion

public static void InvalidConversion(string target, object source)

Flags public static
Return type void
Parameters
Name Type
target string
source object

Summary

Causes ProtocolViolationException to be thrown; called by the various "Parse*" methods when a syntax error is detected.

Exception

ParseBool

public static bool ParseBool(string value)

Flags public static
Return type bool
Parameters
Name Type
value string

Summary

Attempt to parse a string representation of a bool.

Exception

ParseByte

public static byte ParseByte(string value)

Flags public static
Return type byte
Parameters
Name Type
value string

Summary

Attempt to parse a string representation of a byte.

Exception

ParseDouble

public static double ParseDouble(string value)

Flags public static
Return type double
Parameters
Name Type
value string

Summary

Attempt to parse a string representation of a double.

Exception

ParseFloat

public static single ParseFloat(string value)

Flags public static
Return type single
Parameters
Name Type
value string

Summary

Attempt to parse a string representation of a float.

Exception

ParseInt

public static int ParseInt(string value)

Flags public static
Return type int
Parameters
Name Type
value string

Summary

Attempt to parse a string representation of an int.

Exception

ParseLong

public static long ParseLong(string value)

Flags public static
Return type long
Parameters
Name Type
value string

Summary

Attempt to parse a string representation of a long.

Exception

ParseShort

public static short ParseShort(string value)

Flags public static
Return type short
Parameters
Name Type
value string

Summary

Attempt to parse a string representation of a short.

Exception