The keyfile module provides a minimal Lua wrapper around the GLib library's GKeyFile object, for reading and writing of key-value file data, somewhat similar to MS-Windows *.INI files.
This file format is used by Geany for various configuration and project files. Note that this module does not provide any functions for reading or writing disk files, it simply receives or returns its file data as a single continuous string. If you need to read or write a disk file, you can use Lua's built-in io module.
The functions are listed below...
Optional parameters are noted in [ square ] brackets.
For get/set style functions, calling the function with the optional parameter
assigns a new value, calling the function without the optional
parameter returns the current value.
Note that you can also use these functions in object-oriented style:
For instance, keyfile.value(kf,"foo","bar")
can also be written
as kf:value("foo","bar")
Creates a new, empty keyfile object.
Returns or assigns the full text of the keyfile.
Returns an iterator to list the groups within the keyfile.
Returns an iterator to list the keys within the specified group.
Returns or assigns the value of the specified key.
Returns or assigns the comment for the specified key.
If key is nil, it gets/sets the group comment.
If group is nil, it gets/sets the comment for the file.
Returns true if the specified group (and optionally the key) already exists.
Deletes the key, if specified, else it deletes the entire group.