| Libfm Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
FmFolderConfig; gboolean fm_folder_config_close (FmFolderConfig *fc,GError **error); gboolean fm_folder_config_get_boolean (FmFolderConfig *fc,const char *key,gboolean *val); gboolean fm_folder_config_get_double (FmFolderConfig *fc,const char *key,gdouble *val); gboolean fm_folder_config_get_integer (FmFolderConfig *fc,const char *key,gint *val); char * fm_folder_config_get_string (FmFolderConfig *fc,const char *key); char ** fm_folder_config_get_string_list (FmFolderConfig *fc,const char *key,gsize *length); gboolean fm_folder_config_get_uint64 (FmFolderConfig *fc,const char *key,guint64 *val); gboolean fm_folder_config_is_empty (FmFolderConfig *fc); FmFolderConfig * fm_folder_config_open (FmPath *path); void fm_folder_config_purge (FmFolderConfig *fc); void fm_folder_config_remove_key (FmFolderConfig *fc,const char *key); void fm_folder_config_save_cache (void); void fm_folder_config_set_boolean (FmFolderConfig *fc,const char *key,gboolean val); void fm_folder_config_set_double (FmFolderConfig *fc,const char *key,gdouble val); void fm_folder_config_set_integer (FmFolderConfig *fc,const char *key,gint val); void fm_folder_config_set_string (FmFolderConfig *fc,const char *key,const char *string); void fm_folder_config_set_string_list (FmFolderConfig *fc,const char *key,const gchar * const list[],gsize length); void fm_folder_config_set_uint64 (FmFolderConfig *fc,const char *key,guint64 val);
include: libfm/fm.h
This API represents access to folder-specific configuration settings. Each setting is a key/value pair. To use it the descriptor should be opened first, then required operations performed, then closed. Each opened descriptor holds a lock on the cache so it is not adviced to keep it somewhere.
gboolean fm_folder_config_close (FmFolderConfig *fc,GError **error);
Unlocks the cache and releases any data related to fc.
|
a configuration descriptor |
|
location to save error. [out][allow-none] |
Returns : |
FALSE if any error happened on data save. |
Since 1.2.0
gboolean fm_folder_config_get_boolean (FmFolderConfig *fc,const char *key,gboolean *val);
Returns the value associated with key as a boolean.
|
a configuration descriptor |
|
a key to search |
|
location to save the value. [out] |
Returns : |
TRUE if key was found and parsed succesfully. |
Since 1.2.0
gboolean fm_folder_config_get_double (FmFolderConfig *fc,const char *key,gdouble *val);
Returns the value associated with key as a double.
|
a configuration descriptor |
|
a key to search |
|
location to save the value. [out] |
Returns : |
TRUE if key was found and value can be parsed as double. |
Since 1.2.0
gboolean fm_folder_config_get_integer (FmFolderConfig *fc,const char *key,gint *val);
Returns the value associated with key as an integer.
|
a configuration descriptor |
|
a key to search |
|
location to save the value. [out] |
Returns : |
TRUE if key was found and parsed succesfully. |
Since 1.2.0
char * fm_folder_config_get_string (FmFolderConfig *fc,const char *key);
Returns the value associated with key as a string. This function
handles escape sequences like \s.
|
a configuration descriptor |
|
a key to search |
Returns : |
a newly allocated string or NULL if the specified key cannot be found. |
Since 1.2.0
char ** fm_folder_config_get_string_list (FmFolderConfig *fc,const char *key,gsize *length);
Returns the values associated with key. If the specified key cannot
be found then returns NULL. Returned data array should be freed with
g_strfreev() after usage.
|
a configuration descriptor |
|
a key to search |
|
location for the number of returned strings. [out][allow-none] |
Returns : |
a NULL-terminated string array. |
Since 1.2.0
gboolean fm_folder_config_get_uint64 (FmFolderConfig *fc,const char *key,guint64 *val);
Returns the value associated with key as an unsigned integer.
|
a configuration descriptor |
|
a key to search |
|
location to save the value. [out] |
Returns : |
TRUE if key was found and value is an unsigned integer. |
Since 1.2.0
gboolean fm_folder_config_is_empty (FmFolderConfig *fc);
Checks if there is no data associated with the folder.
|
a configuration descriptor |
Returns : |
TRUE if the folder has no settings. |
Since 1.2.0
FmFolderConfig * fm_folder_config_open (FmPath *path);
Searches for settings in the cache that are specific to path. Locks
the cache. Returned descriptor can be used for access to settings.
|
path to get config |
Returns : |
new configuration descriptor. [transfer full] |
Since 1.2.0
void fm_folder_config_purge (FmFolderConfig *fc);
Clears all the data for the folder from the configuration.
|
a configuration descriptor |
Since 1.2.0
void fm_folder_config_remove_key (FmFolderConfig *fc,const char *key);
Removes the key and associated data from the cache.
|
a configuration descriptor |
|
a key to search |
Since 1.2.0
void fm_folder_config_save_cache (void);
Saves current data into the cache file.
Since 1.2.0
void fm_folder_config_set_boolean (FmFolderConfig *fc,const char *key,gboolean val);
Associates boolean val with key for given folder configuration.
|
a configuration descriptor |
|
a key to search |
|
data to set |
Since 1.2.0
void fm_folder_config_set_double (FmFolderConfig *fc,const char *key,gdouble val);
Associates double val with key for given folder configuration.
|
a configuration descriptor |
|
a key to search |
|
data to set |
Since 1.2.0
void fm_folder_config_set_integer (FmFolderConfig *fc,const char *key,gint val);
Associates integer val with key for given folder configuration.
|
a configuration descriptor |
|
a key to search |
|
data to set |
Since 1.2.0
void fm_folder_config_set_string (FmFolderConfig *fc,const char *key,const char *string);
Associates string with key for given folder configuration. This
function handles characters that need escaping, such as newlines.
|
a configuration descriptor |
|
a key to search |
|
data to set |
Since 1.2.0
void fm_folder_config_set_string_list (FmFolderConfig *fc,const char *key,const gchar * const list[],gsize length);
Associates NULL-terminated list with key for given folder configuration.
|
a configuration descriptor |
|
a key to search |
|
a string list to set |
|
number of elements in list
|
Since 1.2.0
void fm_folder_config_set_uint64 (FmFolderConfig *fc,const char *key,guint64 val);
Associates unsigned integer val with key for given folder configuration.
|
a configuration descriptor |
|
a key to search |
|
data to set |
Since 1.2.0