My Project
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Properties | List of all members
IniParser.Parser.IniDataParser Class Reference

Responsible for parsing an string from an ini file, and creating an IniData structure. More...

Public Member Functions

 IniDataParser ()
 Ctor.
 
 IniDataParser (IIniParserConfiguration parserConfiguration)
 Ctor.
 
IniData Parse (string iniDataString)
 Parses a string containing valid ini data.
 

Protected Member Functions

virtual bool LineContainsAComment (string line)
 Checks if a given string contains a comment.
 
virtual bool LineMatchesASection (string line)
 Checks if a given string represents a section delimiter.
 
virtual bool LineMatchesAKeyValuePair (string line)
 Checks if a given string represents a key / value pair.
 
virtual string ExtractComment (string line)
 Removes a comment from a string if exist, and returns the string without the comment substring.
 
virtual void ProcessLine (string currentLine, IniData currentIniData)
 Processes one line and parses the data found in that line (section or key/value pair who may or may not have comments)
 
virtual void ProcessSection (string line, IniData currentIniData)
 Proccess a string which contains an ini section.
 
virtual void ProcessKeyValuePair (string line, IniData currentIniData)
 Processes a string containing an ini key/value pair.
 
virtual string ExtractKey (string s)
 Extracts the key portion of a string containing a key/value pair..
 
virtual string ExtractValue (string s)
 Extracts the value portion of a string containing a key/value pair..
 

Properties

IIniParserConfiguration Configuration [get]
 Configuration that defines the behaviour and constraints that the parser must follow.
 

Detailed Description

Responsible for parsing an string from an ini file, and creating an IniData structure.

Constructor & Destructor Documentation

◆ IniDataParser() [1/2]

IniParser.Parser.IniDataParser.IniDataParser ( )
inline

Ctor.

The parser uses a DefaultIniParserConfiguration by default

◆ IniDataParser() [2/2]

IniParser.Parser.IniDataParser.IniDataParser ( IIniParserConfiguration  parserConfiguration)
inline

Ctor.

Parameters
parserConfigurationParser's IIniParserConfiguration instance.

Member Function Documentation

◆ ExtractComment()

virtual string IniParser.Parser.IniDataParser.ExtractComment ( string  line)
inlineprotectedvirtual

Removes a comment from a string if exist, and returns the string without the comment substring.

Parameters
lineThe string we want to remove the comments from.
Returns
The string s without comments.

◆ ExtractKey()

virtual string IniParser.Parser.IniDataParser.ExtractKey ( string  s)
inlineprotectedvirtual

Extracts the key portion of a string containing a key/value pair..

Parameters
s
The string to be processed, which contains a key/value pair
Returns
The name of the extracted key.

◆ ExtractValue()

virtual string IniParser.Parser.IniDataParser.ExtractValue ( string  s)
inlineprotectedvirtual

Extracts the value portion of a string containing a key/value pair..

Parameters
sThe string to be processed, which contains a key/value pair
Returns
The name of the extracted value.

◆ LineContainsAComment()

virtual bool IniParser.Parser.IniDataParser.LineContainsAComment ( string  line)
inlineprotectedvirtual

Checks if a given string contains a comment.

Parameters
lineThe string to be checked.
Returns
true if any substring from s is a comment, false otherwise.

◆ LineMatchesAKeyValuePair()

virtual bool IniParser.Parser.IniDataParser.LineMatchesAKeyValuePair ( string  line)
inlineprotectedvirtual

Checks if a given string represents a key / value pair.

Parameters
lineThe string to be checked.
Returns
true if the string represents a key / value pair, false otherwise.

◆ LineMatchesASection()

virtual bool IniParser.Parser.IniDataParser.LineMatchesASection ( string  line)
inlineprotectedvirtual

Checks if a given string represents a section delimiter.

Parameters
lineThe string to be checked.
Returns
true if the string represents a section, false otherwise.

◆ Parse()

IniData IniParser.Parser.IniDataParser.Parse ( string  iniDataString)
inline

Parses a string containing valid ini data.

Parameters
iniDataStringString with data
Returns
An IniData instance with the data contained in the iniDataString correctly parsed an structured.
Exceptions
ParsingExceptionThrown if the data could not be parsed

◆ ProcessKeyValuePair()

virtual void IniParser.Parser.IniDataParser.ProcessKeyValuePair ( string  line,
IniData  currentIniData 
)
inlineprotectedvirtual

Processes a string containing an ini key/value pair.

Parameters
lineThe string to be processed

◆ ProcessLine()

virtual void IniParser.Parser.IniDataParser.ProcessLine ( string  currentLine,
IniData  currentIniData 
)
inlineprotectedvirtual

Processes one line and parses the data found in that line (section or key/value pair who may or may not have comments)

Parameters
currentLineThe string with the line to process

◆ ProcessSection()

virtual void IniParser.Parser.IniDataParser.ProcessSection ( string  line,
IniData  currentIniData 
)
inlineprotectedvirtual

Proccess a string which contains an ini section.

Parameters
lineThe string to be processed

The documentation for this class was generated from the following file: