Documentation ¶
Overview ¶
Package keyfile provides Go bindings for GLib's GKeyFile.
Index ¶
- Constants
- type Error
- type Flags
- type KeyFile
- func (kf *KeyFile) Bool(group string, key string) (bool, error)
- func (kf *KeyFile) Float(group string, key string) (float64, error)
- func (kf *KeyFile) Free()
- func (kf *KeyFile) Get(group string, key string, val interface{}) error
- func (kf *KeyFile) GetComment(group string, key string) (string, error)
- func (kf *KeyFile) GetGroups() (uint64, []string)
- func (kf *KeyFile) GetKeys(group string) (uint64, []string, error)
- func (kf *KeyFile) GetOne(group string, key string, typ string) (interface{}, error)
- func (kf *KeyFile) HasKey(group string, key string) bool
- func (kf *KeyFile) Int(group string, key string) (int, error)
- func (kf *KeyFile) ListBool(group string, key string) ([]bool, error)
- func (kf *KeyFile) ListFloat(group string, key string) ([]float64, error)
- func (kf *KeyFile) ListInt(group string, key string) ([]int, error)
- func (kf *KeyFile) ListString(group string, key string) ([]string, error)
- func (kf *KeyFile) LoadFromFile(file string, flags Flags) (bool, error)
- func (kf *KeyFile) Set(group string, key string, uncasted interface{}) error
- func (kf *KeyFile) SetBool(group string, key string, value bool)
- func (kf *KeyFile) SetFloat(group string, key string, value float64)
- func (kf *KeyFile) SetInt(group string, key string, value int)
- func (kf *KeyFile) SetListBool(group string, key string, value []bool)
- func (kf *KeyFile) SetListFloat(group string, key string, value []float64)
- func (kf *KeyFile) SetListInt(group string, key string, value []int)
- func (kf *KeyFile) SetListString(group string, key string, value []string)
- func (kf *KeyFile) SetString(group string, key string, value string)
- func (kf *KeyFile) String(group string, key string) (string, error)
- func (kf *KeyFile) ToData() (uint64, string, error)
- func (kf *KeyFile) ToNative() *C.GKeyFile
- type Valuer
- func (o *Valuer) Bool() (v bool)
- func (o *Valuer) Count() int
- func (o *Valuer) Float() (v float64)
- func (o *Valuer) Get(v interface{})
- func (o *Valuer) Int() (v int)
- func (o *Valuer) ListBool() (v []bool)
- func (o *Valuer) ListFloat() (v []float64)
- func (o *Valuer) ListInt() (v []int)
- func (o *Valuer) ListString() (v []string)
- func (o *Valuer) Set(v interface{})
- func (o *Valuer) Sprint() string
- func (o *Valuer) SprintI(id int) string
- func (o *Valuer) String() (v string)
Constants ¶
const ( DesktopGroup = "Desktop Entry" DesktopKeyCategories = "Categories" DesktopKeyComment = "Comment" DesktopKeyExec = "Exec" DesktopKeyFullname = "X-GNOME-FullName" DesktopKeyGenericName = "GenericName" DesktopKeyGettextDomain = "X-GNOME-Gettext-Domain" DesktopKeyHidden = "Hidden" DesktopKeyIcon = "Icon" DesktopKeyKeywords = "Keywords" DesktopKeyMIMEType = "MimeType" DesktopKeyName = "Name" DesktopKeyNotShowIn = "NotShowIn" DesktopKeyNoDisplay = "NoDisplay" DesktopKeyOnlyShowIn = "OnlyShowIn" DesktopKeyPath = "Path" DesktopKeyStartupNotify = "StartupNotify" DesktopKeyStartupWmClass = "StartupWMClass" DesktopKeyTerminal = "Terminal" DesktopKeyTryExec = "TryExec" DesktopKeyType = "Type" DesktopKeyURL = "URL" DesktopKeyVersion = "Version" DesktopTypeApplication = "Application" DesktopTypeDirectory = "Directory" DesktopTypeLink = "Link" )
Desktop files entries.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyFile ¶
type KeyFile struct {
// contains filtered or unexported fields
}
KeyFile is a representation of Glib's GKeyFile.
func NewFromFile ¶
NewFromFile returns a loaded keyfile if possible.
func NewFromNative ¶
NewFromNative wraps a pointer to a C keyfile.
func (*KeyFile) GetComment ¶
GetComment is a wrapper around g_key_file_get_comment().
func (*KeyFile) GetOne ¶
GetOne returns a key value as interface.
valid types are:
bool, int, float64, string, comment listbool, listint, listfloat64, liststring,
func (*KeyFile) ListString ¶
ListString is a wrapper around g_key_file_get_string_list().
func (*KeyFile) LoadFromFile ¶
LoadFromFile is a wrapper around g_key_file_load_from_file().
func (*KeyFile) SetListBool ¶
SetListBool is a wrapper around g_key_file_set_boolean_list().
func (*KeyFile) SetListFloat ¶
SetListFloat is a wrapper around g_key_file_set_double_list().
func (*KeyFile) SetListInt ¶
SetListInt is a wrapper around g_key_file_set_integer_list().
func (*KeyFile) SetListString ¶
SetListString is a wrapper around g_key_file_set_string_list().
type Valuer ¶
type Valuer struct {
// contains filtered or unexported fields
}
Valuer gives access to a storage group/key value. Implements cftype.Valuer
func (*Valuer) Get ¶
func (o *Valuer) Get(v interface{})
Get assigns the value to the given pointer to value (of the matching type).
func (*Valuer) ListString ¶
ListString returns the value as bool.