IniLikeGroup

This class represents the group (section) in the ini-like file. You can create and use instances of this class only in the context of IniLikeFile or its derivatives. Note: Keys are case-sensitive.

Constructors

this
this(string groupName)

Create instange on IniLikeGroup and set its name to groupName.

Members

Functions

addComment
void addComment(string comment)

Add comment line into the group.

byIniLine
auto byIniLine()
byKeyValue
auto byKeyValue()

Iterate by Key-Value pairs.

contains
bool contains(string key)

Tell if group contains value associated with the key.

localizedValue
string localizedValue(string key, string locale, string defaultValue)

Perform locale matching lookup as described in Localized values for keys.

name
string name()

Get name of this group.

opIndex
string opIndex(string key)
opIndexAssign
string opIndexAssign(string value, string key)

Insert new value or replaces the old one if value associated with key already exists.

opIndexAssign
string opIndexAssign(string value, string key, string locale)

Ditto, localized version.

removeEntries
void removeEntries()

Remove all entries satisying ToDelete function. ToDelete should be function accepting string key and value and return boolean.

removeEntry
void removeEntry(string key)

Removes entry by key. To remove localized values use localizedKey.

setLocalizedValue
void setLocalizedValue(string key, string locale, string value)

Same as localized version of opIndexAssign, but uses function syntax.

validateKeyValue
void validateKeyValue(string key, string value)

Validate key and value before setting value to key for this group and throw exception if not valid. Can be reimplemented in derived classes. Default implementation check if key is not empty string, leaving value unchecked.

value
string value(string key, string defaultValue)

Get value by key.

Static functions

emptyByKeyValue
auto emptyByKeyValue()

Empty range of the same type as byKeyValue. Can be used in derived classes if it's needed to have empty range.

Meta