C# Class CNCGUI.ScanFormatted

Class that provides functionality of the standard C library sscanf() function.
Show file Open project: x893/CNCGUI Class Usage Examples

Public Properties

Property Type Description
Results List

Protected Properties

Property Type Description
_typeParsers TypeParser[]

Public Methods

Method Description
Parse ( string input, string format ) : int

Parses the input string according to the rules in the format string. Similar to the standard C library's sscanf() function. Parsed fields are placed in the class' Results member.

ScanFormatted ( ) : System

Protected Methods

Method Description
ParseFormatSpecifier ( TextParser format, FormatSpecifier spec ) : bool

Attempts to parse a field format specifier from the format string.

ParseHexadecimal ( TextParser input, FormatSpecifier spec ) : bool

Parse hexadecimal field

ParseScanSet ( TextParser input, FormatSpecifier spec ) : bool

Parse a scan-set field

Private Methods

Method Description
AddSigned ( string token, Modifiers mod, int radix ) : void
AddUnsigned ( string token, Modifiers mod, int radix ) : void
IsValidDigit ( char c, int radix ) : bool
ParseCharacter ( TextParser input, FormatSpecifier spec ) : bool

Parse a character field

ParseDecimal ( TextParser input, FormatSpecifier spec ) : bool

Parse integer field

ParseFloat ( TextParser input, FormatSpecifier spec ) : bool

Parse a floating-point field

ParseOctal ( TextParser input, FormatSpecifier spec ) : bool

Parse an octal field

ParseString ( TextParser input, FormatSpecifier spec ) : bool

Parse a string field

Method Details

Parse() public method

Parses the input string according to the rules in the format string. Similar to the standard C library's sscanf() function. Parsed fields are placed in the class' Results member.
public Parse ( string input, string format ) : int
input string String to parse
format string Specifies rules for parsing input
return int

ParseFormatSpecifier() protected method

Attempts to parse a field format specifier from the format string.
protected ParseFormatSpecifier ( TextParser format, FormatSpecifier spec ) : bool
format TextParser
spec FormatSpecifier
return bool

ParseHexadecimal() protected method

Parse hexadecimal field
protected ParseHexadecimal ( TextParser input, FormatSpecifier spec ) : bool
input TextParser
spec FormatSpecifier
return bool

ParseScanSet() protected method

Parse a scan-set field
protected ParseScanSet ( TextParser input, FormatSpecifier spec ) : bool
input TextParser
spec FormatSpecifier
return bool

ScanFormatted() public method

public ScanFormatted ( ) : System
return System

Property Details

Results public property

public List Results
return List

_typeParsers protected property

protected TypeParser[] _typeParsers
return TypeParser[]