KeyFile

class KeyFile(pointer: <Error class: unknown class><<Error class: unknown class>>) : Record

The GKeyFile struct contains only private data and should not be accessed directly.

Skipped during bindings generation

  • parameter length: length: Out parameter is not supported

  • parameter length: length: Out parameter is not supported

  • parameter length: length: Out parameter is not supported

  • parameter length: length: Out parameter is not supported

  • parameter length: length: Out parameter is not supported

  • parameter length: length: Out parameter is not supported

  • parameter length: length: Out parameter is not supported

  • parameter full_path: full_path: Out parameter is not supported

  • parameter full_path: full_path: Out parameter is not supported

  • parameter list: Array parameter of type gboolean is not supported

  • parameter list: Array parameter of type gdouble is not supported

  • parameter list: Array parameter of type gint is not supported

  • parameter length: length: Out parameter is not supported

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion : RecordCompanion<KeyFile, <Error class: unknown class>>

Properties

Link copied to clipboard
val glibKeyFilePointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun getBoolean(groupName: String, key: String): <Error class: unknown class><Boolean>

Returns the value associated with @key under @group_name as a boolean.

Link copied to clipboard
fun getComment(groupName: String? = null, key: String? = null): <Error class: unknown class><String>

Retrieves a comment above @key from @group_name. If @key is null then @comment will be read from above

Link copied to clipboard
fun getDouble(groupName: String, key: String): <Error class: unknown class><Double>

Returns the value associated with @key under @group_name as a double. If @group_name is null, the start_group is used.

Link copied to clipboard
fun getInt64(groupName: String, key: String): <Error class: unknown class><Long>

Returns the value associated with @key under @group_name as a signed 64-bit integer. This is similar to g_key_file_get_integer() but can return 64-bit results without truncation.

Link copied to clipboard
fun getInteger(groupName: String, key: String): <Error class: unknown class><Int>

Returns the value associated with @key under @group_name as an integer.

Link copied to clipboard
fun getLocaleForKey(groupName: String, key: String, locale: String? = null): String

Returns the actual locale which the result of g_key_file_get_locale_string() or g_key_file_get_locale_string_list() came from.

Link copied to clipboard
fun getLocaleString(groupName: String, key: String, locale: String? = null): <Error class: unknown class><String>

Returns the value associated with @key under @group_name translated in the given @locale if available. If @locale is null then the current locale is assumed.

Link copied to clipboard

Returns the name of the start group of the file.

Link copied to clipboard
fun getString(groupName: String, key: String): <Error class: unknown class><String>

Returns the string value associated with @key under @group_name. Unlike g_key_file_get_value(), this function handles escape sequences like \s.

Link copied to clipboard
fun getUint64(groupName: String, key: String): <Error class: unknown class><<Error class: unknown class>>

Returns the value associated with @key under @group_name as an unsigned 64-bit integer. This is similar to g_key_file_get_integer() but can return large positive results without truncation.

Link copied to clipboard
fun getValue(groupName: String, key: String): <Error class: unknown class><String>

Returns the raw value associated with @key under @group_name. Use g_key_file_get_string() to retrieve an unescaped UTF-8 string.

Link copied to clipboard
fun hasGroup(groupName: String): Boolean

Looks whether the key file has the group @group_name.

Link copied to clipboard
fun loadFromBytes(bytes: Bytes, flags: KeyFileFlags): <Error class: unknown class><Boolean>

Loads a key file from the data in @bytes into an empty #GKeyFile structure. If the object cannot be created then %error is set to a #GKeyFileError.

Link copied to clipboard
fun loadFromData(data: String, length: <Error class: unknown class>, flags: KeyFileFlags): <Error class: unknown class><Boolean>

Loads a key file from memory into an empty #GKeyFile structure. If the object cannot be created then %error is set to a #GKeyFileError.

Link copied to clipboard
fun loadFromFile(file: String, flags: KeyFileFlags): <Error class: unknown class><Boolean>

Loads a key file into an empty #GKeyFile structure.

Link copied to clipboard
fun removeComment(groupName: String? = null, key: String? = null): <Error class: unknown class><Boolean>

Removes a comment above @key from @group_name. If @key is null then @comment will be removed above @group_name. If both @key and @group_name are null, then @comment will be removed above the first group in the file.

Link copied to clipboard
fun removeGroup(groupName: String): <Error class: unknown class><Boolean>

Removes the specified group, @group_name, from the key file.

Link copied to clipboard
fun removeKey(groupName: String, key: String): <Error class: unknown class><Boolean>

Removes @key in @group_name from the key file.

Link copied to clipboard
fun saveToFile(filename: String): <Error class: unknown class><Boolean>

Writes the contents of @key_file to @filename using g_file_set_contents(). If you need stricter guarantees about durability of the written file than are provided by g_file_set_contents(), use g_file_set_contents_full() with the return value of g_key_file_to_data().

Link copied to clipboard
fun setBoolean(groupName: String, key: String, value: Boolean)

Associates a new boolean value with @key under @group_name. If @key cannot be found then it is created.

Link copied to clipboard
fun setComment(groupName: String? = null, key: String? = null, comment: String): <Error class: unknown class><Boolean>

Places a comment above @key from @group_name.

Link copied to clipboard
fun setDouble(groupName: String, key: String, value: Double)

Associates a new double value with @key under @group_name. If @key cannot be found then it is created.

Link copied to clipboard
fun setInt64(groupName: String, key: String, value: Long)

Associates a new integer value with @key under @group_name. If @key cannot be found then it is created.

Link copied to clipboard
fun setInteger(groupName: String, key: String, value: Int)

Associates a new integer value with @key under @group_name. If @key cannot be found then it is created.

Link copied to clipboard
fun setListSeparator(separator: Char)

Sets the character which is used to separate values in lists. Typically ';' or ',' are used as separators. The default list separator is ';'.

Link copied to clipboard
fun setLocaleString(groupName: String, key: String, locale: String, string: String)

Associates a string value for @key and @locale under @group_name. If the translation for @key cannot be found then it is created.

Link copied to clipboard
fun setLocaleStringList(groupName: String, key: String, locale: String, list: List<String>, length: <Error class: unknown class>)

Associates a list of string values for @key and @locale under

Link copied to clipboard
fun setString(groupName: String, key: String, string: String)

Associates a new string value with @key under @group_name. If @key cannot be found then it is created. If @group_name cannot be found then it is created. Unlike g_key_file_set_value(), this function handles characters that need escaping, such as newlines.

Link copied to clipboard
fun setStringList(groupName: String, key: String, list: List<String>, length: <Error class: unknown class>)

Associates a list of string values for @key under @group_name. If @key cannot be found then it is created. If @group_name cannot be found then it is created.

Link copied to clipboard
fun setUint64(groupName: String, key: String, value: <Error class: unknown class>)

Associates a new integer value with @key under @group_name. If @key cannot be found then it is created.

Link copied to clipboard
fun setValue(groupName: String, key: String, value: String)

Associates a new value with @key under @group_name.

Link copied to clipboard
fun unref()

Decreases the reference count of @key_file by 1. If the reference count reaches zero, frees the key file and all its allocated memory.