Table of Contents

Class KeyFile

Namespace
GLib
Assembly
GLib-2.0.dll
public sealed class KeyFile : BoxedRecord, IEquatable<KeyFile>
Inheritance
KeyFile
Implements
Inherited Members

Constructors

KeyFile(KeyFileOwnedHandle)

public KeyFile(KeyFileOwnedHandle handle)

Parameters

handle KeyFileOwnedHandle

Properties

Handle

public KeyFileOwnedHandle Handle { get; }

Property Value

KeyFileOwnedHandle

Methods

Equals(KeyFile?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(KeyFile? other)

Parameters

other KeyFile

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

ErrorQuark()

public static Quark ErrorQuark()

Returns

Quark

Free()

[Version("2.6")]
public void Free()

GetBoolean(string, string)

[Version("2.6")]
public bool GetBoolean(string groupName, string key)

Parameters

groupName string
key string

Returns

bool

GetComment(string?, string?)

[Version("2.6")]
public string GetComment(string? groupName, string? key)

Parameters

groupName string
key string

Returns

string

GetDouble(string, string)

[Version("2.12")]
public double GetDouble(string groupName, string key)

Parameters

groupName string
key string

Returns

double

GetGType()

public static Type GetGType()

Returns

Type

GetGroups(out nuint)

[Version("2.6")]
public string[] GetGroups(out nuint length)

Parameters

length nuint

Returns

string[]

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetInt64(string, string)

[Version("2.26")]
public long GetInt64(string groupName, string key)

Parameters

groupName string
key string

Returns

long

GetInteger(string, string)

[Version("2.6")]
public int GetInteger(string groupName, string key)

Parameters

groupName string
key string

Returns

int

GetKeys(string, out nuint)

[Version("2.6")]
public string[] GetKeys(string groupName, out nuint length)

Parameters

groupName string
length nuint

Returns

string[]

GetLocaleForKey(string, string, string?)

[Version("2.56")]
public string? GetLocaleForKey(string groupName, string key, string? locale)

Parameters

groupName string
key string
locale string

Returns

string

GetLocaleString(string, string, string?)

[Version("2.6")]
public string GetLocaleString(string groupName, string key, string? locale)

Parameters

groupName string
key string
locale string

Returns

string

GetLocaleStringList(string, string, string?, out nuint)

[Version("2.6")]
public string[] GetLocaleStringList(string groupName, string key, string? locale, out nuint length)

Parameters

groupName string
key string
locale string
length nuint

Returns

string[]

GetStartGroup()

[Version("2.6")]
public string? GetStartGroup()

Returns

string

GetString(string, string)

[Version("2.6")]
public string GetString(string groupName, string key)

Parameters

groupName string
key string

Returns

string

GetStringList(string, string, out nuint)

[Version("2.6")]
public string[] GetStringList(string groupName, string key, out nuint length)

Parameters

groupName string
key string
length nuint

Returns

string[]

GetUint64(string, string)

[Version("2.26")]
public ulong GetUint64(string groupName, string key)

Parameters

groupName string
key string

Returns

ulong

GetValue(string, string)

[Version("2.6")]
public string GetValue(string groupName, string key)

Parameters

groupName string
key string

Returns

string

HasGroup(string)

[Version("2.6")]
public bool HasGroup(string groupName)

Parameters

groupName string

Returns

bool

HasKey(string, string)

[Version("2.6")]
public bool HasKey(string groupName, string key)

Parameters

groupName string
key string

Returns

bool

LoadFromBytes(Bytes, KeyFileFlags)

[Version("2.50")]
public bool LoadFromBytes(Bytes bytes, KeyFileFlags flags)

Parameters

bytes Bytes
flags KeyFileFlags

Returns

bool

LoadFromData(string, nuint, KeyFileFlags)

[Version("2.6")]
public bool LoadFromData(string data, nuint length, KeyFileFlags flags)

Parameters

data string
length nuint
flags KeyFileFlags

Returns

bool

LoadFromDataDirs(string, out string, KeyFileFlags)

[Version("2.6")]
public bool LoadFromDataDirs(string file, out string fullPath, KeyFileFlags flags)

Parameters

file string
fullPath string
flags KeyFileFlags

Returns

bool

LoadFromDirs(string, string[], out string, KeyFileFlags)

[Version("2.14")]
public bool LoadFromDirs(string file, string[] searchDirs, out string fullPath, KeyFileFlags flags)

Parameters

file string
searchDirs string[]
fullPath string
flags KeyFileFlags

Returns

bool

LoadFromFile(string, KeyFileFlags)

[Version("2.6")]
public bool LoadFromFile(string file, KeyFileFlags flags)

Parameters

file string
flags KeyFileFlags

Returns

bool

New()

[Version("2.6")]
public static KeyFile New()

Returns

KeyFile

Ref()

[Version("2.32")]
public KeyFile Ref()

Returns

KeyFile

RemoveComment(string?, string?)

[Version("2.6")]
public bool RemoveComment(string? groupName, string? key)

Parameters

groupName string
key string

Returns

bool

RemoveGroup(string)

[Version("2.6")]
public bool RemoveGroup(string groupName)

Parameters

groupName string

Returns

bool

RemoveKey(string, string)

[Version("2.6")]
public bool RemoveKey(string groupName, string key)

Parameters

groupName string
key string

Returns

bool

SaveToFile(string)

[Version("2.40")]
public bool SaveToFile(string filename)

Parameters

filename string

Returns

bool

SetBoolean(string, string, bool)

[Version("2.6")]
public void SetBoolean(string groupName, string key, bool value)

Parameters

groupName string
key string
value bool

SetBooleanList(string, string, Span<bool>)

[Version("2.6")]
public void SetBooleanList(string groupName, string key, Span<bool> list)

Parameters

groupName string
key string
list Span<bool>

SetComment(string?, string?, string)

[Version("2.6")]
public bool SetComment(string? groupName, string? key, string comment)

Parameters

groupName string
key string
comment string

Returns

bool

SetDouble(string, string, double)

[Version("2.12")]
public void SetDouble(string groupName, string key, double value)

Parameters

groupName string
key string
value double

SetDoubleList(string, string, Span<double>)

[Version("2.12")]
public void SetDoubleList(string groupName, string key, Span<double> list)

Parameters

groupName string
key string
list Span<double>

SetInt64(string, string, long)

[Version("2.26")]
public void SetInt64(string groupName, string key, long value)

Parameters

groupName string
key string
value long

SetInteger(string, string, int)

[Version("2.6")]
public void SetInteger(string groupName, string key, int value)

Parameters

groupName string
key string
value int

SetIntegerList(string, string, Span<int>)

[Version("2.6")]
public void SetIntegerList(string groupName, string key, Span<int> list)

Parameters

groupName string
key string
list Span<int>

SetListSeparator(sbyte)

[Version("2.6")]
public void SetListSeparator(sbyte separator)

Parameters

separator sbyte

SetLocaleString(string, string, string, string)

[Version("2.6")]
public void SetLocaleString(string groupName, string key, string locale, string @string)

Parameters

groupName string
key string
locale string
string string

SetLocaleStringList(string, string, string, string[], nuint)

[Version("2.6")]
public void SetLocaleStringList(string groupName, string key, string locale, string[] list, nuint length)

Parameters

groupName string
key string
locale string
list string[]
length nuint

SetString(string, string, string)

[Version("2.6")]
public void SetString(string groupName, string key, string @string)

Parameters

groupName string
key string
string string

SetStringList(string, string, string[], nuint)

[Version("2.6")]
public void SetStringList(string groupName, string key, string[] list, nuint length)

Parameters

groupName string
key string
list string[]
length nuint

SetUint64(string, string, ulong)

[Version("2.26")]
public void SetUint64(string groupName, string key, ulong value)

Parameters

groupName string
key string
value ulong

SetValue(string, string, string)

[Version("2.6")]
public void SetValue(string groupName, string key, string value)

Parameters

groupName string
key string
value string

ToData(out nuint)

[Version("2.6")]
public string ToData(out nuint length)

Parameters

length nuint

Returns

string

Unref()

[Version("2.32")]
public void Unref()