Represents all data from an INI file [詳解]
公開メンバ関数 | |
IniData () | |
Initializes an empty IniData instance. [詳解] | |
IniData (SectionDataCollection sdc) | |
Initializes a new IniData instance using a previous SectionDataCollection. [詳解] | |
IniData (IniData ori) | |
override string | ToString () |
virtual string | ToString (IIniDataFormatter formatter) |
object | Clone () |
Creates a new object that is a copy of the current instance. [詳解] | |
void | ClearAllComments () |
Deletes all comments in all sections and key values [詳解] | |
void | Merge (IniData toMergeIniData) |
Merges the other iniData into this one by overwriting existing values. Comments get appended. [詳解] | |
bool | TryGetKey (string key, out string value) |
Attempts to retrieve a key, using a single string combining section and key name. [詳解] | |
string | GetKey (string key) |
Retrieves a key using a single input string combining section and key name. [詳解] | |
プロパティ | |
IniParserConfiguration | Configuration [get, set] |
Configuration used to write an ini file with the proper delimiter characters and data. [詳解] | |
KeyDataCollection | Global [get, set] |
Global sections. Contains key/value pairs which are not enclosed in any section (i.e. they are defined at the beginning of the file, before any section. [詳解] | |
KeyDataCollection | this[string sectionName] [get] |
Gets the KeyDataCollection instance with the specified section name. [詳解] | |
SectionDataCollection | Sections [get, set] |
Gets or sets all the SectionData for this IniData instance. [詳解] | |
char | SectionKeySeparator [get, set] |
Used to mark the separation between the section name and the key name when using IniData.TryGetKey. [詳解] | |
非公開メンバ関数 | |
void | MergeSection (SectionData otherSection) |
Merge the sections into this by overwriting this sections. [詳解] | |
void | MergeGlobal (KeyDataCollection globals) |
Merges the given global values into this globals by overwriting existing values. [詳解] | |
非公開変数類 | |
SectionDataCollection | _sections |
Represents all sections from an INI file [詳解] | |
IniParserConfiguration | _configuration |
See property Configuration for more information. [詳解] | |
Represents all data from an INI file
IniParser.Model.IniData.IniData | ( | ) |
Initializes an empty IniData instance.
IniParser.Model.IniData.IniData | ( | SectionDataCollection | sdc | ) |
Initializes a new IniData instance using a previous SectionDataCollection.
sdc | SectionDataCollection object containing the data with the sections of the file |
IniParser.Model.IniData.IniData | ( | IniData | ori | ) |
void IniParser.Model.IniData.ClearAllComments | ( | ) |
Deletes all comments in all sections and key values
object IniParser.Model.IniData.Clone | ( | ) |
Creates a new object that is a copy of the current instance.
string IniParser.Model.IniData.GetKey | ( | string | key | ) |
Retrieves a key using a single input string combining section and key name.
key | The section and key name to retrieve, separated by IniParserConfiguration.SectionKeySeparator. |
If key contains no separator, it is treated as a key in the Global section.
Key may contain no more than one separator character.
ArgumentException | key contained multiple separators. |
void IniParser.Model.IniData.Merge | ( | IniData | toMergeIniData | ) |
Merges the other iniData into this one by overwriting existing values. Comments get appended.
toMergeIniData | IniData instance to merge into this. If it is null this operation does nothing. |
|
private |
Merges the given global values into this globals by overwriting existing values.
|
private |
Merge the sections into this by overwriting this sections.
override string IniParser.Model.IniData.ToString | ( | ) |
|
virtual |
bool IniParser.Model.IniData.TryGetKey | ( | string | key, |
out string | value | ||
) |
Attempts to retrieve a key, using a single string combining section and key name.
key | The section and key name to retrieve, separated by IniParserConfiguration.SectionKeySeparator. |
If key contains no separator, it is treated as a key in the Global section.
Key may contain no more than one separator character.
value | If true is returned, is set to the value retrieved. Otherwise, is set to an empty string. |
ArgumentException | key contained multiple separators. |
|
private |
See property Configuration for more information.
|
private |
Represents all sections from an INI file
|
getset |
Configuration used to write an ini file with the proper delimiter characters and data.
If the IniData instance was created by a parser, this instance is a copy of the IniParserConfiguration used by the parser (i.e. different objects instances) If this instance is created programatically without using a parser, this property returns an instance of IniParserConfiguration
|
getset |
Global sections. Contains key/value pairs which are not enclosed in any section (i.e. they are defined at the beginning of the file, before any section.
|
getset |
Used to mark the separation between the section name and the key name when using IniData.TryGetKey.
Defaults to '.'.
|
getset |
Gets or sets all the SectionData for this IniData instance.
|
get |
Gets the KeyDataCollection instance with the specified section name.