godock: github.com/sqp/godock/widgets/gtk/keyfile Index | Files

package keyfile

import "github.com/sqp/godock/widgets/gtk/keyfile"

Package keyfile provides Go bindings for GLib's GKeyFile.

Index

Package Files

keyfile.go

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.

type Error Uses

type Error C.gint

Error is a representation of GLib's KeyFileError.

const (
    ErrorUnknownEncoding Error = 0
    ErrorParse           Error = 1
    ErrorNotFound        Error = 2
    ErrorKeyNotFound     Error = 3
    ErrorGroupNotFound   Error = 4
    ErrorInvalidValue    Error = 5
)

Error type list.

type Flags Uses

type Flags C.gint

Flags is a representation of GLib's KeyFileFlags.

const (
    FlagsNone             Flags = 0
    FlagsKeepComments     Flags = 1
    FlagsKeepTranslations Flags = 2
)

Keyfile loading flags.

type KeyFile Uses

type KeyFile struct {
    // contains filtered or unexported fields
}

KeyFile is a representation of Glib's GKeyFile.

func New Uses

func New() *KeyFile

New is a wrapper around g_key_file_new().

func NewFromFile Uses

func NewFromFile(file string, flags Flags) (*KeyFile, error)

NewFromFile returns a loaded keyfile if possible.

func NewFromNative Uses

func NewFromNative(p unsafe.Pointer) *KeyFile

NewFromNative wraps a pointer to a C keyfile.

func (*KeyFile) Bool Uses

func (kf *KeyFile) Bool(group string, key string) (bool, error)

Bool is a wrapper around g_key_file_get_boolean().

func (*KeyFile) Float Uses

func (kf *KeyFile) Float(group string, key string) (float64, error)

Float is a wrapper around g_key_file_get_double().

func (*KeyFile) Free Uses

func (kf *KeyFile) Free()

Free is a wrapper around g_key_file_free().

func (*KeyFile) Get Uses

func (kf *KeyFile) Get(group string, key string, val interface{}) error

Get gets a value from the keyfile. Must be used with a pointer to value.

func (*KeyFile) GetComment Uses

func (kf *KeyFile) GetComment(group string, key string) (string, error)

GetComment is a wrapper around g_key_file_get_comment().

func (*KeyFile) GetGroups Uses

func (kf *KeyFile) GetGroups() (uint64, []string)

GetGroups is a wrapper around g_key_file_get_groups().

func (*KeyFile) GetKeys Uses

func (kf *KeyFile) GetKeys(group string) (uint64, []string, error)

GetKeys is a wrapper around g_key_file_get_keys().

func (*KeyFile) GetOne Uses

func (kf *KeyFile) GetOne(group string, key string, typ string) (interface{}, error)

GetOne returns a key value as interface.

valid types are:

bool, int, float64, string, comment
listbool, listint, listfloat64, liststring,

func (*KeyFile) HasKey Uses

func (kf *KeyFile) HasKey(group string, key string) bool

HasKey is a wrapper around g_key_file_has_key().

func (*KeyFile) Int Uses

func (kf *KeyFile) Int(group string, key string) (int, error)

Int is a wrapper around g_key_file_get_integer().

func (*KeyFile) ListBool Uses

func (kf *KeyFile) ListBool(group string, key string) ([]bool, error)

ListBool is a wrapper around g_key_file_get_boolean_list().

func (*KeyFile) ListFloat Uses

func (kf *KeyFile) ListFloat(group string, key string) ([]float64, error)

ListFloat is a wrapper around g_key_file_get_double_list().

func (*KeyFile) ListInt Uses

func (kf *KeyFile) ListInt(group string, key string) ([]int, error)

ListInt is a wrapper around g_key_file_get_integer_list().

func (*KeyFile) ListString Uses

func (kf *KeyFile) ListString(group string, key string) ([]string, error)

ListString is a wrapper around g_key_file_get_string_list().

func (*KeyFile) LoadFromFile Uses

func (kf *KeyFile) LoadFromFile(file string, flags Flags) (bool, error)

LoadFromFile is a wrapper around g_key_file_load_from_file().

func (*KeyFile) Set Uses

func (kf *KeyFile) Set(group string, key string, uncasted interface{}) error

Set is a generic wrapper around g_key_file_set_xxx() with type assertion.

func (*KeyFile) SetBool Uses

func (kf *KeyFile) SetBool(group string, key string, value bool)

SetBool is a wrapper around g_key_file_set_boolean().

func (*KeyFile) SetFloat Uses

func (kf *KeyFile) SetFloat(group string, key string, value float64)

SetFloat is a wrapper around g_key_file_set_double().

func (*KeyFile) SetInt Uses

func (kf *KeyFile) SetInt(group string, key string, value int)

SetInt is a wrapper around g_key_file_set_integer().

func (*KeyFile) SetListBool Uses

func (kf *KeyFile) SetListBool(group string, key string, value []bool)

SetListBool is a wrapper around g_key_file_set_boolean_list().

func (*KeyFile) SetListFloat Uses

func (kf *KeyFile) SetListFloat(group string, key string, value []float64)

SetListFloat is a wrapper around g_key_file_set_double_list().

func (*KeyFile) SetListInt Uses

func (kf *KeyFile) SetListInt(group string, key string, value []int)

SetListInt is a wrapper around g_key_file_set_integer_list().

func (*KeyFile) SetListString Uses

func (kf *KeyFile) SetListString(group string, key string, value []string)

SetListString is a wrapper around g_key_file_set_string_list().

func (*KeyFile) SetString Uses

func (kf *KeyFile) SetString(group string, key string, value string)

SetString is a wrapper around g_key_file_set_string().

func (*KeyFile) String Uses

func (kf *KeyFile) String(group string, key string) (string, error)

String is a wrapper around g_key_file_get_string().

func (*KeyFile) ToData Uses

func (kf *KeyFile) ToData() (uint64, string, error)

ToData is a wrapper around g_key_file_to_data().

func (*KeyFile) ToNative Uses

func (kf *KeyFile) ToNative() *C.GKeyFile

ToNative returns the pointer to the underlying GKeyFile.

type Valuer Uses

type Valuer struct {
    // contains filtered or unexported fields
}

Valuer gives access to a storage group/key value. Implements cftype.Valuer

func NewValuer Uses

func NewValuer(kf *KeyFile, group, name string) *Valuer

NewValuer creates a valuer for the key matching group and name.

func (*Valuer) Bool Uses

func (o *Valuer) Bool() (v bool)

Bool returns the value as bool.

func (*Valuer) Count Uses

func (o *Valuer) Count() int

Count returns the number of elements in the list.

func (*Valuer) Float Uses

func (o *Valuer) Float() (v float64)

Float returns the value as bool.

func (*Valuer) Get Uses

func (o *Valuer) Get(v interface{})

Get assigns the value to the given pointer to value (of the matching type).

func (*Valuer) Int Uses

func (o *Valuer) Int() (v int)

Int returns the value as bool.

func (*Valuer) ListBool Uses

func (o *Valuer) ListBool() (v []bool)

ListBool returns the value as bool.

func (*Valuer) ListFloat Uses

func (o *Valuer) ListFloat() (v []float64)

ListFloat returns the value as bool.

func (*Valuer) ListInt Uses

func (o *Valuer) ListInt() (v []int)

ListInt returns the value as bool.

func (*Valuer) ListString Uses

func (o *Valuer) ListString() (v []string)

ListString returns the value as bool.

func (*Valuer) Set Uses

func (o *Valuer) Set(v interface{})

Set sets the pointed keyfile key value.

func (*Valuer) Sprint Uses

func (o *Valuer) Sprint() string

Sprint returns the value as printable text.

func (*Valuer) SprintI Uses

func (o *Valuer) SprintI(id int) string

SprintI returns the value as printable text of the element at position I in the list if possible.

func (*Valuer) String Uses

func (o *Valuer) String() (v string)

String returns the value as bool.

Package keyfile imports 3 packages (graph) and is imported by 6 packages. Updated 2016-08-06. Refresh now. Tools for package owners.