TIniSection
An ini section.
Represents a distinct section within an INI file.
In the structure of an INI file, sections are used to group related key-value pairs.
A section can either be global, meaning it applies to the entire INI file, or named, identified by a unique header enclosed in
square brackets (e.g., [section name]). This type facilitates the parsing, manipulation, and storage of these sections,
allowing for organized access to the contained data.
Methods
Method GetName:String()
Returns the name of the section, or Null if it is the global section.
Method GetIndex:Int()
Returns the index of the section.
The global section is represented by the index INI_GLOBAL_SECTION.
Method SetName(name:String)
Sets the name of the section.
Method CountProperties:Int()
Returns the number of properties in the section.
Method GetProperty:TIniProperty(index:Int)
Returns a property at the given index position, or Null if the index is out of range.
Method Get:String(name:String)
Returns the property value with the given name, or Null if not found.
IF the property contains an empty value, null could be confused with the absence of the property. In such cases, use TryGet or Has to check for the existence of the property first.
Method TryGet:Int(name:String, value:String Var)
Attempts to get the property value with the given name.
Returns
True if the property was found and has a value, otherwise False.
Method Has:Int(name:String)
Returns True if a property with the given name exists in the section, otherwise False.
Method Set(name:String, value:String)
Sets the property with the given name to the specified value.
If the property does not exist, it is created.
Method FindProperty:TIniProperty(name:String)
Finds the property with the given name, or Null if not found.
Method AddProperty:TIniProperty(name:String, value:String)
Adds a new property to the section using the specified name and value
Method RemoveProperty(index:Int)
Removes the property with the given index from the section.
Method Clear()
Removes all properties from the section.
Method Remove()
Removes the section from the ini file.
On removal, the section is freed and this instance, and all referenced properties should no longer be used.
