Exemplo n.º 1
0
// LoadFromFile is a wrapper around g_key_file_load_from_file().
func (kf *KeyFile) LoadFromFile(file string, flags Flags) (bool, error) {
	var cstr = C.CString(file)
	defer C.g_free(C.gpointer(cstr))
	var cerr *C.GError
	c := C.g_key_file_load_from_file(kf.cKey, (*C.gchar)(cstr), C.GKeyFileFlags(flags), &cerr)
	return c != 0, goError(cerr)
}
Exemplo n.º 2
0
	IO_HUP  = C.GIOCondition(C.G_IO_HUP)
	IO_NVAL = C.GIOCondition(C.G_IO_NVAL)

	// IOFlags
	IO_FLAG_APPEND       = C.GIOFlags(C.G_IO_FLAG_APPEND)
	IO_FLAG_NONBLOCK     = C.GIOFlags(C.G_IO_FLAG_NONBLOCK)
	IO_FLAG_IS_READABLE  = C.GIOFlags(C.G_IO_FLAG_IS_READABLE)
	IO_FLAG_IS_WRITABLE  = C.GIOFlags(C.G_IO_FLAG_IS_WRITABLE)
	IO_FLAG_IS_WRITEABLE = C.GIOFlags(C.G_IO_FLAG_IS_WRITEABLE)
	IO_FLAG_IS_SEEKABLE  = C.GIOFlags(C.G_IO_FLAG_IS_SEEKABLE)
	IO_FLAG_MASK         = C.GIOFlags(C.G_IO_FLAG_MASK)
	IO_FLAG_GET_MASK     = C.GIOFlags(C.G_IO_FLAG_GET_MASK)
	IO_FLAG_SET_MASK     = C.GIOFlags(C.G_IO_FLAG_SET_MASK)

	// KeyFileFlags
	KEY_FILE_NONE              = C.GKeyFileFlags(C.G_KEY_FILE_NONE)
	KEY_FILE_KEEP_COMMENTS     = C.GKeyFileFlags(C.G_KEY_FILE_KEEP_COMMENTS)
	KEY_FILE_KEEP_TRANSLATIONS = C.GKeyFileFlags(C.G_KEY_FILE_KEEP_TRANSLATIONS)

	// LogLevelFlags
	LOG_FLAG_RECURSION = C.GLogLevelFlags(C.G_LOG_FLAG_RECURSION)
	LOG_FLAG_FATAL     = C.GLogLevelFlags(C.G_LOG_FLAG_FATAL)
	LOG_LEVEL_ERROR    = C.GLogLevelFlags(C.G_LOG_LEVEL_ERROR)
	LOG_LEVEL_CRITICAL = C.GLogLevelFlags(C.G_LOG_LEVEL_CRITICAL)
	LOG_LEVEL_WARNING  = C.GLogLevelFlags(C.G_LOG_LEVEL_WARNING)
	LOG_LEVEL_MESSAGE  = C.GLogLevelFlags(C.G_LOG_LEVEL_MESSAGE)
	LOG_LEVEL_INFO     = C.GLogLevelFlags(C.G_LOG_LEVEL_INFO)
	LOG_LEVEL_DEBUG    = C.GLogLevelFlags(C.G_LOG_LEVEL_DEBUG)
	LOG_LEVEL_MASK     = C.GLogLevelFlags(C.G_LOG_LEVEL_MASK)

	// MarkupCollectType