Reading and writing the application's settings from and into INI files. More...
Public Member Functions | |
| void | Load (string filename) |
| Loads the config from the specified filename. Calling this does not save the current settings. | |
| void | Save () |
| Saves the settings. | |
| void | Save (string filename) |
| Saves the settings with the specified filename. | |
| void | SetFilename (string filename) |
| Sets the filepath of the settings. | |
| string | GetString (string section, string property) |
| Looks for a property in a section, and returns its value, as a string. | |
| integer | GetNumber (string section, string property) |
| Looks for a property in a section, and returns its value, as a number. | |
| integer | GetInteger (string section, string property) |
| Looks for a property in a section, and returns its value, as an integer. | |
| boolean | GetBool (string section, string property) |
| Looks for a property in a section, and returns its value, as a boolean. | |
| void | SetString (string section, string property, string value) |
| Sets a property in a section to a string value. | |
| void | SetNumber (string section, string property, number value) |
| Sets a property in a section to a decimal value. | |
| void | SetInteger (string section, string property, integer value) |
| Sets a property in a section to an integer value. | |
| void | SetBool (string section, string property, boolean value) |
| Sets a property in a section to a boolean value. | |
| void | AddSection (string section) |
| Creates a section. | |
| void | RemoveSection (string section) |
| Removes a section. | |
| boolean | SectionExists (string section) |
| Checks if a section exists. | |
| integer | GetSectionCount () |
| Returns how many sections exist in the settings. | |
| boolean | PropertyExists (string section, string property) |
| Checks if a property exists. | |
| void | RemoveProperty (string section, string property) |
| Removes a property from a section. | |
| integer | GetPropertyCount (string section) |
| Returns how many properties exist in the section. | |
Reading and writing the application's settings from and into INI files.
| void Settings.AddSection | ( | string | section | ) |
Creates a section.
| section | The section name. |
| boolean Settings.GetBool | ( | string | section, |
| string | property ) |
Looks for a property in a section, and returns its value, as a boolean.
| section | The section where the property resides. If this is null, the global section is used instead. |
| property | The property to look for. |
| integer Settings.GetInteger | ( | string | section, |
| string | property ) |
Looks for a property in a section, and returns its value, as an integer.
| section | The section where the property resides. If this is null, the global section is used instead. |
| property | The property to look for. |
| integer Settings.GetNumber | ( | string | section, |
| string | property ) |
Looks for a property in a section, and returns its value, as a number.
| section | The section where the property resides. If this is null, the global section is used instead. |
| property | The property to look for. |
| integer Settings.GetPropertyCount | ( | string | section | ) |
Returns how many properties exist in the section.
| section | The section. If this is null, the global section is used instead. |
| integer Settings.GetSectionCount | ( | ) |
Returns how many sections exist in the settings.
| string Settings.GetString | ( | string | section, |
| string | property ) |
Looks for a property in a section, and returns its value, as a string.
| section | The section where the property resides. If this is null, the global section is used instead. |
| property | The property to look for. |
| void Settings.Load | ( | string | filename | ) |
Loads the config from the specified filename. Calling this does not save the current settings.
| filename | Filepath of config. |
| boolean Settings.PropertyExists | ( | string | section, |
| string | property ) |
Checks if a property exists.
| section | The section where the property resides. If this is null, the global section is used instead. |
| property | The property name. |
| void Settings.RemoveProperty | ( | string | section, |
| string | property ) |
Removes a property from a section.
| section | The section where the property resides. If this is null, the global section is used instead. |
| property | The property to remove. |
| void Settings.RemoveSection | ( | string | section | ) |
Removes a section.
| section | The section name. |
| void Settings.Save | ( | string | filename | ) |
Saves the settings with the specified filename.
| filename | Filepath of config. This does not change the filepath of the current settings; use Settings.SetFilename to do that. |
| boolean Settings.SectionExists | ( | string | section | ) |
Checks if a section exists.
| section | The section name. |
| void Settings.SetBool | ( | string | section, |
| string | property, | ||
| boolean | value ) |
Sets a property in a section to a boolean value.
| section | The section where the property resides. If the section doesn't exist, it will be created. If this is null, the global section is used instead. |
| property | The property to set. |
| value | The value of the property. |
| void Settings.SetFilename | ( | string | filename | ) |
Sets the filepath of the settings.
| filename | Filepath of config. This does not save the current settings. |
| void Settings.SetInteger | ( | string | section, |
| string | property, | ||
| integer | value ) |
Sets a property in a section to an integer value.
| section | The section where the property resides. If the section doesn't exist, it will be created. If this is null, the global section is used instead. |
| property | The property to set. |
| value | The value of the property. |
| void Settings.SetNumber | ( | string | section, |
| string | property, | ||
| number | value ) |
Sets a property in a section to a decimal value.
| section | The section where the property resides. If the section doesn't exist, it will be created. If this is null, the global section is used instead. |
| property | The property to set. |
| value | The value of the property. |
| void Settings.SetString | ( | string | section, |
| string | property, | ||
| string | value ) |
Sets a property in a section to a string value.
| section | The section where the property resides. If the section doesn't exist, it will be created. If this is null, the global section is used instead. |
| property | The property to set. |
| value | The value of the property. |