C# Class TextParser.Parser

Afficher le fichier Open project: gratianlup/SecureDelete Class Usage Examples

Méthodes publiques

Méthode Description
AddFieldsFromAssembly ( string name ) : bool

Add the field from the given assembly as field filters.

AddFieldsFromAssembly ( string name, bool addReferences ) : bool

Add the field from the given assembly as field filters.

AddFieldsFromAssembly ( string name, bool addReferences, string fromNamespace ) : bool

Add the field from the given assembly as field filters.

GetLineNumber ( ) : int

Gets the number of lines the text has.

GetNextBlock ( ) : TextBlock?

Get the next block of text.

InitParsing ( ) : bool

Initialize the parsing engine.

InitParsing ( int startIndex ) : bool

Initialize the parsing engine.

LoadFilters ( IParserFilters filters ) : void

Load the filters from the given IParserFilters object.

LoadText ( StreamReader stream ) : bool

Loads the text from the given stream.

Parser ( ) : System

Default constructor.

Parser ( IParserFilters filters ) : System

Constructor with the possibility to load the word filters.

RemoveAllFilters ( ) : void

Removes all loaded filters.

ResetParser ( ) : void

Resets the parser.

ResetParser ( int startIndex ) : void

Resets the parser.

Private Methods

Méthode Description
InitParser ( ) : void

Initializes the structures used by the parser.

Called by the constructor.

IsCommentSeparator ( string s ) : TextSeparator?

Checks if the given string is a comment separator.

IsField ( string s ) : bool

Checks if the given string is a field.

Optimized

IsKeyword ( string s ) : bool

Checks if the given string is a keyword.

Optimized

IsNumber ( string s ) : bool

Checks if a string represents a number;

IsOperator ( string s ) : bool

Checks if the given string is an operator.

Optimized

IsPartOfKeywordInvalid ( char c ) : bool

Checks if the given character is part of a string or comment separator.

IsSeparator ( char c ) : bool

Checks if the given string is a separator.

IsStringSeparator ( string s ) : TextSeparator?

Checks if the given string is a string separator.

StringContainsChar ( string s, char c ) : bool

Checks if a string contains a specific character.

Method Details

AddFieldsFromAssembly() public méthode

Add the field from the given assembly as field filters.
public AddFieldsFromAssembly ( string name ) : bool
name string The name of the assembly or the exact path to it.
Résultat bool

AddFieldsFromAssembly() public méthode

Add the field from the given assembly as field filters.
public AddFieldsFromAssembly ( string name, bool addReferences ) : bool
name string The name of the assembly or the exact path to it.
addReferences bool Add the fields from the assemblies referenced by the given one.
Résultat bool

AddFieldsFromAssembly() public méthode

Add the field from the given assembly as field filters.
public AddFieldsFromAssembly ( string name, bool addReferences, string fromNamespace ) : bool
name string The name of the assembly or the exact path to it.
addReferences bool Add the fields from the assemblies referenced by the given one.
fromNamespace string Add fields only from the given namespaces.
Résultat bool

GetLineNumber() public méthode

Gets the number of lines the text has.
public GetLineNumber ( ) : int
Résultat int

GetNextBlock() public méthode

Get the next block of text.
public GetNextBlock ( ) : TextBlock?
Résultat TextBlock?

InitParsing() public méthode

Initialize the parsing engine.
public InitParsing ( ) : bool
Résultat bool

InitParsing() public méthode

Initialize the parsing engine.
public InitParsing ( int startIndex ) : bool
startIndex int The index in the text from where to start parsing.
Résultat bool

LoadFilters() public méthode

Load the filters from the given IParserFilters object.
public LoadFilters ( IParserFilters filters ) : void
filters IParserFilters The IParserFilters derived class from where to load the filters.
Résultat void

LoadText() public méthode

Loads the text from the given stream.
public LoadText ( StreamReader stream ) : bool
stream System.IO.StreamReader The stream from where to load the filters.
Résultat bool

Parser() public méthode

Default constructor.
public Parser ( ) : System
Résultat System

Parser() public méthode

Constructor with the possibility to load the word filters.
public Parser ( IParserFilters filters ) : System
filters IParserFilters
Résultat System

RemoveAllFilters() public méthode

Removes all loaded filters.
public RemoveAllFilters ( ) : void
Résultat void

ResetParser() public méthode

Resets the parser.
public ResetParser ( ) : void
Résultat void

ResetParser() public méthode

Resets the parser.
public ResetParser ( int startIndex ) : void
startIndex int The index in the text from where to start parsing.
Résultat void