Class IniAdapter
Helper methods to save a ValueStore to an Ini file and loading it back again.
Inheritance
System.Object
IniAdapter
Assembly: Trimmer.dll
Syntax
public static class IniAdapter
Fields
|
Improve this Doc
View Source
LineRegex
Regex matching a line in a Ini file.
Declaration
public static readonly Regex LineRegex
Field Value
Type |
Description |
System.Text.RegularExpressions.Regex |
|
|
Improve this Doc
View Source
NameRegex
Regex matching only the name part of an ini line.
Declaration
public static readonly Regex NameRegex
Field Value
Type |
Description |
System.Text.RegularExpressions.Regex |
|
Methods
|
Improve this Doc
View Source
GetValue(String)
Get the value part of an ini line, unquoting where necessary.
Declaration
public static string GetValue(string iniLine)
Parameters
Type |
Name |
Description |
System.String |
iniLine |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Load(ValueStore, String)
Load the values in an Ini file into this value store instance,
replacing the value store's contents.
Declaration
public static void Load(ValueStore store, string content)
Parameters
Type |
Name |
Description |
ValueStore |
store |
|
System.String |
content |
|
|
Improve this Doc
View Source
NameToPath(String)
Take the name part of an ini line and convert it to a option path
that then can be used with GetOption(String).
Declaration
public static string NameToPath(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
QuoteParameterIfNeeded(String)
Quote a parameter if it contains square brackets or
return it as-is otherwise.
Declaration
public static string QuoteParameterIfNeeded(string parameter)
Parameters
Type |
Name |
Description |
System.String |
parameter |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
QuoteValueIfNeeded(String)
Quote a value if it contains leading or trailing whitespace or
return it as-is otherwise.
Declaration
public static string QuoteValueIfNeeded(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Save(ValueStore)
Save the content of this value store as a Ini file formatted string.
Declaration
public static string Save(ValueStore store)
Parameters
Returns
Type |
Description |
System.String |
|