- public void set_list_separator (char separator)
Sets the character which is used to separate values in lists.
- public bool load_from_file (string file, KeyFileFlags flags) throws KeyFileError, FileError
Loads a key file into an empty KeyFile
structure.
- public bool load_from_dirs (string file, string[] search_dirs, out string full_path, KeyFileFlags flags) throws KeyFileError, FileError
This function looks for a key file named file
in the
paths specified in search_dirs
, loads the file into this and returns the file's full
path in full_path
.
- public bool load_from_data (string data, size_t length, KeyFileFlags flags) throws KeyFileError
Loads a key file from memory into an empty KeyFile
structure.
- public bool load_from_data_dirs (string file, out string full_path, KeyFileFlags flags) throws KeyFileError, FileError
This function looks for a key file named file
in the
paths returned from get_user_data_dir and
get_system_data_dirs, loads the file into
this and returns the file's full path in full_path
.
- public string to_data (out size_t length = null, out Error error = null)
This function outputs this as a
string.
- public string get_start_group ()
Returns the name of the start group of the file.
- public string[] get_groups ()
Returns all groups in the key file loaded with
this.
- public string[] get_keys (string group_name) throws KeyFileError
Returns all keys for the group name group_name
.
- public bool has_group (string group_name)
Looks whether the key file has the group group_name
.
- public bool has_key (string group_name, string key) throws KeyFileError
Looks whether the key file has the key key
in the group
group_name
.
- public string get_value (string group_name, string key) throws KeyFileError
Returns the raw value associated with key
under
group_name
.
- public string get_string (string group_name, string key) throws KeyFileError
Returns the string value associated with key
under
group_name
.
- public string get_locale_string (string group_name, string key, string? locale = null) throws KeyFileError
Returns the value associated with key
under
group_name
translated in the given locale
if available.
- public bool get_boolean (string group_name, string key) throws KeyFileError
Returns the value associated with key
under
group_name
as a boolean.
- public int get_integer (string group_name, string key) throws KeyFileError
Returns the value associated with key
under
group_name
as an integer.
- public int64 get_int64 (string group_name, string key) throws KeyFileError
Returns the value associated with key
under
group_name
as a signed 64-bit integer.
- public uint64 get_uint64 (string group_name, string key) throws KeyFileError
Returns the value associated with key
under
group_name
as an unsigned 64-bit integer.
- public double get_double (string group_name, string key) throws KeyFileError
Returns the value associated with key
under
group_name
as a double.
- public string[] get_string_list (string group_name, string key) throws KeyFileError
Returns the values associated with key
under
group_name
.
- public string[] get_locale_string_list (string group_name, string key, string? locale = null) throws KeyFileError
Returns the values associated with key
under
group_name
translated in the given locale
if available.
- public bool[] get_boolean_list (string group_name, string key) throws KeyFileError
Returns the values associated with key
under
group_name
as booleans.
- public int[] get_integer_list (string group_name, string key) throws KeyFileError
Returns the values associated with key
under
group_name
as integers.
- public double[] get_double_list (string group_name, string key) throws KeyFileError
Returns the values associated with key
under
group_name
as doubles.
- public string get_comment (string? group_name, string? key) throws KeyFileError
Retrieves a comment above key
from group_name
.
- public bool save_to_file (string filename) throws FileError
Writes the contents of this to
filename
using set_data.
- public void set_value (string group_name, string key, string value)
Associates a new value with key
under group_name
.
- public void set_string (string group_name, string key, string str)
Associates a new string value with key
under
group_name
.
- public void set_locale_string (string group_name, string key, string locale, string str)
Associates a string value for key
and locale
under group_name
.
- public void set_boolean (string group_name, string key, bool value)
Associates a new boolean value with key
under
group_name
.
- public void set_integer (string group_name, string key, int value)
Associates a new integer value with key
under
group_name
.
- public void set_int64 (string group_name, string key, int64 value)
Associates a new integer value with key
under
group_name
.
- public void set_uint64 (string group_name, string key, uint64 value)
Associates a new integer value with key
under
group_name
.
- public void set_double (string group_name, string key, double value)
Associates a new double value with key
under
group_name
.
- public void set_string_list (string group_name, string key, string[] list)
Associates a list of string values for key
under
group_name
.
- public void set_locale_string_list (string group_name, string key, string locale, string[] list)
Associates a list of string values for key
and
locale
under group_name
.
- public void set_boolean_list (string group_name, string key, bool[] list)
Associates a list of boolean values with key
under
group_name
.
- public void set_integer_list (string group_name, string key, int[] list)
Associates a list of integer values with key
under
group_name
.
- public void set_double_list (string group_name, string key, double[] list)
Associates a list of double values with key
under
group_name
.
- public void set_comment (string? group_name, string? key, string comment) throws KeyFileError
Places a comment above key
from group_name
.
- public void remove_group (string group_name) throws KeyFileError
Removes the specified group, group_name
, from the key
file.
- public void remove_key (string group_name, string key) throws KeyFileError
Removes key
in group_name
from the key file.
- public void remove_comment (string group_name, string key) throws KeyFileError
Removes a comment above key
from group_name
.