Class: cIniProcessor¶
Include: Use System\Ini.pkg
Hierarchy: cObject -> cIniProcessor
Package: System\Ini.pkg
cIniProcessor reads INI files or strings into section data, edits values, and writes or stringifies the result.
Properties¶
See Properties.
| Name | Purpose |
|---|---|
| psAssignChar | Assignment delimiter used when parsing and writing values. |
| pbCaseSensitive | Controls case-sensitive section and key matching; set before reading or parsing. |
| psFileName | Default file name used by read and write calls. |
| paIniData | Parsed sections and values. |
Methods¶
See Methods.
| Name | Purpose |
|---|---|
| ClearData | Clears all parsed INI data. |
| ReadFile | Reads INI data from a file and returns success. |
| ParseString | Parses INI text into sections and values. |
| Stringify | Returns the current INI data as text. |
| WriteFile | Writes current INI data to a file. |
| SetValue | Sets or creates a section key value. |
| GetValue | Returns a key value or the supplied default. |
| HasSection | Checks whether a section exists. |
| HasKey | Checks whether a key exists in a section. |
| RemoveSection | Removes a section. |
| RemoveKey | Removes a key; an empty section is removed. |
| Sections | Returns section names. |
| Keys | Returns key names for a section. |
Example¶
Handle hoIni
Boolean bOk
String sValue
Get Create (RefClass(cIniProcessor)) to hoIni
Set pbCaseSensitive of hoIni to False
Get ReadFile of hoIni "settings.ini" to bOk
Get GetValue of hoIni "server" "host" "localhost" to sValue
Send SetValue of hoIni "server" "host" sValue
Send Destroy of hoIni