|
static List< KeyValuePair
< string, string > > | Deserialize (string iniString, char seperatorCharacter= '=') |
| Deserialize the specified iniString and seperatorCharacter. More...
|
|
static string | Serialize (Dictionary< string, string > data, char seperatorCharacter= '=') |
| Serialize the specified data and seperatorCharacter. More...
|
|
static string | Serialize (List< KeyValuePair< string, string >> data, char seperatorCharacter= '=') |
| Serialize the specified data and seperatorCharacter. More...
|
|
Definition at line 36 of file INI.cs.
static List<KeyValuePair<string, string> > Hydrogen.Serialization.INI.Deserialize |
( |
string |
iniString, |
|
|
char |
seperatorCharacter = '=' |
|
) |
| |
|
static |
Deserialize the specified iniString and seperatorCharacter.
- Parameters
-
iniString | Ini string. |
seperatorCharacter | Seperator character. |
Definition at line 43 of file INI.cs.
45 var entries =
new List<KeyValuePair<string, string>> ();
47 using (var reader =
new StringReader (iniString)) {
49 while ((line = reader.ReadLine ()) != null) {
54 if (!line.Contains (seperatorCharacter.ToString ()))
57 int first = line.IndexOf (seperatorCharacter);
59 entries.Add (
new KeyValuePair<string, string> (
60 line.Substring (0, first).Trim (), line.Substring (first + 1).Trim ()));
static string Hydrogen.Serialization.INI.Serialize |
( |
Dictionary< string, string > |
data, |
|
|
char |
seperatorCharacter = '=' |
|
) |
| |
|
static |
Serialize the specified data and seperatorCharacter.
- Parameters
-
data | Data. |
seperatorCharacter | Seperator character. |
Definition at line 71 of file INI.cs.
73 var iniString =
new StringBuilder ();
75 foreach (
string s
in data.Keys) {
76 iniString.AppendLine (s.Trim () + seperatorCharacter + data [s].Trim ());
79 return iniString.ToString ();
static string Hydrogen.Serialization.INI.Serialize |
( |
List< KeyValuePair< string, string >> |
data, |
|
|
char |
seperatorCharacter = '=' |
|
) |
| |
|
static |
Serialize the specified data and seperatorCharacter.
- Parameters
-
data | Data. |
seperatorCharacter | Seperator character. |
Definition at line 87 of file INI.cs.
89 var iniString =
new StringBuilder ();
91 for (
int x = 0; x < data.Count; x++) {
92 iniString.AppendLine (data [x].Key.Trim () + seperatorCharacter + data [x].Value.Trim ());
95 return iniString.ToString ();