C# 클래스 Fusion.Core.IniParser.Parser.IniDataParser

Responsible for parsing an string from an ini file, and creating an IniData structure.
파일 보기 프로젝트 열기: demiurghg/FusionEngine 1 사용 예제들

공개 메소드들

메소드 설명
IniDataParser ( ) : System

Ctor

The parser uses a IniParserConfiguration by default

IniDataParser ( IniParserConfiguration parserConfiguration ) : System

Ctor

Parse ( string iniDataString ) : IniData

Parses a string containing valid ini data

보호된 메소드들

메소드 설명
ExtractComment ( string line ) : string

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

ExtractKey ( string s ) : string

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

ExtractValue ( string s ) : string

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

HandleDuplicatedKeyInCollection ( string key, string value, KeyDataCollection keyDataCollection, string sectionName ) : void

Abstract Method that decides what to do in case we are trying to add a duplicated key to a section

LineContainsAComment ( string line ) : bool

Checks if a given string contains a comment.

LineMatchesAKeyOnly ( string line ) : bool

Checks if a given string represents a key-only line

LineMatchesAKeyValuePair ( string line ) : bool

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

LineMatchesASection ( string line ) : bool

Checks if a given string represents a section delimiter.

ProcessKeyOnly ( string line, IniData currentIniData ) : void

Processes a string containing an ini key/value pair.

ProcessKeyValuePair ( string line, IniData currentIniData ) : void

Processes a string containing an ini key/value pair.

ProcessLine ( string currentLine, IniData currentIniData ) : void

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

ProcessSection ( string line, IniData currentIniData ) : void

Proccess a string which contains an ini section.

비공개 메소드들

메소드 설명
AddKeyToKeyValueCollection ( string key, string value, KeyDataCollection keyDataCollection, string sectionName ) : void

Adds a key to a concrete KeyDataCollection instance, checking if duplicate keys are allowed in the configuration

메소드 상세

ExtractComment() 보호된 메소드

Removes a comment from a string if exist, and returns the string without the comment substring.
protected ExtractComment ( string line ) : string
line string /// The string we want to remove the comments from. ///
리턴 string

ExtractKey() 보호된 메소드

Extracts the key portion of a string containing a key/value pair..
protected ExtractKey ( string s ) : string
s string /// The string to be processed, which contains a key/value pair ///
리턴 string

ExtractValue() 보호된 메소드

Extracts the value portion of a string containing a key/value pair..
protected ExtractValue ( string s ) : string
s string /// The string to be processed, which contains a key/value pair ///
리턴 string

HandleDuplicatedKeyInCollection() 보호된 메소드

Abstract Method that decides what to do in case we are trying to add a duplicated key to a section
protected HandleDuplicatedKeyInCollection ( string key, string value, KeyDataCollection keyDataCollection, string sectionName ) : void
key string
value string
keyDataCollection KeyDataCollection
sectionName string
리턴 void

IniDataParser() 공개 메소드

Ctor
The parser uses a IniParserConfiguration by default
public IniDataParser ( ) : System
리턴 System

IniDataParser() 공개 메소드

Ctor
public IniDataParser ( IniParserConfiguration parserConfiguration ) : System
parserConfiguration Fusion.Core.IniParser.Model.Configuration.IniParserConfiguration /// Parser's instance. ///
리턴 System

LineContainsAComment() 보호된 메소드

Checks if a given string contains a comment.
protected LineContainsAComment ( string line ) : bool
line string /// String with a line to be checked. ///
리턴 bool

LineMatchesAKeyOnly() 보호된 메소드

Checks if a given string represents a key-only line
protected LineMatchesAKeyOnly ( string line ) : bool
line string /// The string to be checked. ///
리턴 bool

LineMatchesAKeyValuePair() 보호된 메소드

Checks if a given string represents a key / value pair.
protected LineMatchesAKeyValuePair ( string line ) : bool
line string /// The string to be checked. ///
리턴 bool

LineMatchesASection() 보호된 메소드

Checks if a given string represents a section delimiter.
protected LineMatchesASection ( string line ) : bool
line string /// The string to be checked. ///
리턴 bool

Parse() 공개 메소드

Parses a string containing valid ini data
/// Thrown if the data could not be parsed ///
public Parse ( string iniDataString ) : IniData
iniDataString string /// String with data ///
리턴 Fusion.Core.IniParser.Model.IniData

ProcessKeyOnly() 보호된 메소드

Processes a string containing an ini key/value pair.
protected ProcessKeyOnly ( string line, IniData currentIniData ) : void
line string /// The string to be processed ///
currentIniData Fusion.Core.IniParser.Model.IniData
리턴 void

ProcessKeyValuePair() 보호된 메소드

Processes a string containing an ini key/value pair.
protected ProcessKeyValuePair ( string line, IniData currentIniData ) : void
line string /// The string to be processed ///
currentIniData Fusion.Core.IniParser.Model.IniData
리턴 void

ProcessLine() 보호된 메소드

Processes one line and parses the data found in that line (section or key/value pair who may or may not have comments)
protected ProcessLine ( string currentLine, IniData currentIniData ) : void
currentLine string The string with the line to process
currentIniData Fusion.Core.IniParser.Model.IniData
리턴 void

ProcessSection() 보호된 메소드

Proccess a string which contains an ini section.
protected ProcessSection ( string line, IniData currentIniData ) : void
line string /// The string to be processed ///
currentIniData Fusion.Core.IniParser.Model.IniData
리턴 void