C# Class MoreInternals.Parser.ParserStream

Inheritance: IDisposable
显示文件 Open project: kevin-montrose/More Class Usage Examples

Private Properties

Property Type Description
DirectPeek int
DirectRead int

Public Methods

Method Description
Advance ( ) : void

Advance the stream by one character.

AdvancePast ( string needle, bool requireFind = true ) : void

Advance the stream until needle is encountered, then advance past it. If requireFind = true (which is the default) this method throws an error if needle can not be found.

AdvancePastWhiteSpace ( ) : void

Like AdvancePast, but for all whitespace characters. Does not error if not white space is found.

Dispose ( ) : void
HasMore ( ) : bool

Returns true if there are more characters to be read from the stream.

ParserStream ( TextReader wrapped ) : System
Peek ( ) : char

Looks at the next character in the stream

PushBack ( IEnumerable pushBack ) : void

Puts these characters back into the stream

Read ( ) : char

Read a single character from the stream.

ScanUntil ( StringBuilder buffer ) : char?

Advances the stream until one of needles is found, placing everything *before* needle into buffer. Advances past the needle as well. If none of the needles are found, an error is encountered. needles appear immediately after \ (the escape char) will not be considered matching.

ScanUntilWithNesting ( StringBuilder buffer, char needle, bool requireFound = true ) : void

Advances until c is found, placing everything before needle into buffer. Advances past needle as well. Differs from ScanUtil in that needles between quotes and ()'s are not counted as terminating. needles appear immediately after \ (the escape char) will not be considered matching.

WhichNextInsensitive ( StringBuilder rejected ) : string

Advances the stream until one of the strings passed in is encountered (using a case insensitive compare). Returns which of strings was encountered.

Private Methods

Method Description
DirectPeek ( ) : int
DirectRead ( ) : int

Method Details

Advance() public method

Advance the stream by one character.
public Advance ( ) : void
return void

AdvancePast() public method

Advance the stream until needle is encountered, then advance past it. If requireFind = true (which is the default) this method throws an error if needle can not be found.
public AdvancePast ( string needle, bool requireFind = true ) : void
needle string
requireFind bool
return void

AdvancePastWhiteSpace() public method

Like AdvancePast, but for all whitespace characters. Does not error if not white space is found.
public AdvancePastWhiteSpace ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

HasMore() public method

Returns true if there are more characters to be read from the stream.
public HasMore ( ) : bool
return bool

ParserStream() public method

public ParserStream ( TextReader wrapped ) : System
wrapped TextReader
return System

Peek() public method

Looks at the next character in the stream
public Peek ( ) : char
return char

PushBack() public method

Puts these characters back into the stream
public PushBack ( IEnumerable pushBack ) : void
pushBack IEnumerable
return void

Read() public method

Read a single character from the stream.
public Read ( ) : char
return char

ScanUntil() public method

Advances the stream until one of needles is found, placing everything *before* needle into buffer. Advances past the needle as well. If none of the needles are found, an error is encountered. needles appear immediately after \ (the escape char) will not be considered matching.
public ScanUntil ( StringBuilder buffer ) : char?
buffer StringBuilder
return char?

ScanUntilWithNesting() public method

Advances until c is found, placing everything before needle into buffer. Advances past needle as well. Differs from ScanUtil in that needles between quotes and ()'s are not counted as terminating. needles appear immediately after \ (the escape char) will not be considered matching.
public ScanUntilWithNesting ( StringBuilder buffer, char needle, bool requireFound = true ) : void
buffer StringBuilder
needle char
requireFound bool
return void

WhichNextInsensitive() public method

Advances the stream until one of the strings passed in is encountered (using a case insensitive compare). Returns which of strings was encountered.
public WhichNextInsensitive ( StringBuilder rejected ) : string
rejected StringBuilder
return string