C# Class CNCGUI.TextParser

Datei anzeigen Open project: x893/CNCGUI Class Usage Examples

Public Properties

Property Type Description
NullChar char

Public Methods

Method Description
Extract ( int start ) : string

Extracts a substring from the specified position to the end of the text

Extract ( int start, int end ) : string

Extracts a substring from the specified range of the current text

MoveAhead ( ) : void

Moves the current position ahead one character

MoveAhead ( int ahead ) : void

Moves the current position ahead the specified number of characters

MovePast ( char chars ) : void

Moves to the next occurrence of any character that is not one of the specified characters

MovePastWhitespace ( ) : void

Moves the current position to the next character that is not whitespace

MoveTo ( char c ) : void

Moves to the next occurrence of the specified character

MoveTo ( string s, bool ignoreCase = false ) : void

Moves to the next occurrence of the specified string

MoveToEndOfLine ( ) : void

Moves the current position to the first character that is part of a newline

Peek ( ) : char

Returns the character at the current position, or a null character if we're at the end of the document

Peek ( int ahead ) : char

Returns the character at the specified number of characters beyond the current position, or a null character if the specified position is at the end of the document

Reset ( ) : void

Resets the current position to the start of the current document

Reset ( string text ) : void

Sets the current document and resets the current position to the start of it

TextParser ( ) : System
TextParser ( string text ) : System

Protected Methods

Method Description
IsInArray ( char c, char chars ) : bool

Determines if the specified character exists in the specified character array.

Method Details

Extract() public method

Extracts a substring from the specified position to the end of the text
public Extract ( int start ) : string
start int
return string

Extract() public method

Extracts a substring from the specified range of the current text
public Extract ( int start, int end ) : string
start int
end int
return string

IsInArray() protected method

Determines if the specified character exists in the specified character array.
protected IsInArray ( char c, char chars ) : bool
c char Character to find
chars char Character array to search
return bool

MoveAhead() public method

Moves the current position ahead one character
public MoveAhead ( ) : void
return void

MoveAhead() public method

Moves the current position ahead the specified number of characters
public MoveAhead ( int ahead ) : void
ahead int The number of characters to move ahead
return void

MovePast() public method

Moves to the next occurrence of any character that is not one of the specified characters
public MovePast ( char chars ) : void
chars char Array of characters to move past
return void

MovePastWhitespace() public method

Moves the current position to the next character that is not whitespace
public MovePastWhitespace ( ) : void
return void

MoveTo() public method

Moves to the next occurrence of the specified character
public MoveTo ( char c ) : void
c char Character to find
return void

MoveTo() public method

Moves to the next occurrence of the specified string
public MoveTo ( string s, bool ignoreCase = false ) : void
s string String to find
ignoreCase bool Indicates if case-insensitive comparisons /// are used
return void

MoveToEndOfLine() public method

Moves the current position to the first character that is part of a newline
public MoveToEndOfLine ( ) : void
return void

Peek() public method

Returns the character at the current position, or a null character if we're at the end of the document
public Peek ( ) : char
return char

Peek() public method

Returns the character at the specified number of characters beyond the current position, or a null character if the specified position is at the end of the document
public Peek ( int ahead ) : char
ahead int The number of characters beyond the current position
return char

Reset() public method

Resets the current position to the start of the current document
public Reset ( ) : void
return void

Reset() public method

Sets the current document and resets the current position to the start of it
public Reset ( string text ) : void
text string
return void

TextParser() public method

public TextParser ( ) : System
return System

TextParser() public method

public TextParser ( string text ) : System
text string
return System

Property Details

NullChar public_oe static_oe property

public static char NullChar
return char