inilike

Reading and writing ini-like files, used in Freedesktop systems.

Members

Classes

IniLikeException
class IniLikeException

Exception thrown on the file read error.

IniLikeFile
class IniLikeFile

Ini-like file.

IniLikeGroup
class 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.

Functions

doUnescape
string doUnescape(string value, Tuple!(char, char)[] pairs)
Undocumented in source. Be warned that the author may not have intended to support it.
escapeValue
string escapeValue(string value)

Escapes string by replacing special symbols with escaped sequences. These symbols are: '\\' (backslash), '\n' (newline), '\r' (carriage return) and '\t' (tab). Note: Currently the library stores values as they were loaded from file, i.e. escaped. To keep things consistent you should take care about escaping the value before inserting. The library will not do it for you.

iniLikeFileReader
auto iniLikeFileReader(string fileName)

Convenient function for reading from the file.

iniLikeRangeReader
auto iniLikeRangeReader(Range byLine)

Reads range of strings into the range of IniLikeLines.

iniLikeStringReader
auto iniLikeStringReader(string contents)

Convenient function for reading from string. Note: on frontends < 2.067 it uses splitLines thereby allocating strings.

isBoolean
bool isBoolean(string value)

Check if the entry value can be interpreted as boolean value.

isFalse
bool isFalse(string value)

Tells whether the entry value presents false

isTrue
bool isTrue(string value)

Tells whether the entry value presents true

localizedKey
string localizedKey(string key, string locale)

Construct localized key name from key and locale.

localizedKey
string localizedKey(string key, string lang, string country, string modifier)

ditto, but constructs locale name from arguments.

makeLocaleName
string makeLocaleName(string lang, string country, string encoding, string modifier)

Make locale name based on language, country, encoding and modifier.

parseLocaleName
auto parseLocaleName(string locale)

Parse locale name into the tuple of 4 values corresponding to language, country, encoding and modifier

separateFromLocale
Tuple!(string, string) separateFromLocale(string key)

Separate key name into non-localized key and locale name. If key is not localized returns original key and empty string.

unescapeValue
string unescapeValue(string value)

Unescapes string. You should unescape values returned by library before displaying until you want keep them as is (e.g., to allow user to edit values in escaped form).

Structs

IniLikeLine
struct IniLikeLine

Represents the line from ini-like file. Usually you should not use this struct directly, since it's tightly connected with internal IniLikeFile implementation.

See Also

Meta