| UDisks Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | ||||
UDisksPersistentStore; UDisksPersistentStore * udisks_persistent_store_new (const gchar *path,const gchar *temp_path); const gchar * udisks_persistent_store_get_path (UDisksPersistentStore *store); const gchar * udisks_persistent_store_get_temp_path (UDisksPersistentStore *store); enum UDisksPersistentFlags; GVariant * udisks_persistent_store_get (UDisksPersistentStore *store,UDisksPersistentFlags flags,const gchar *key,const GVariantType *type,GError **error); gboolean udisks_persistent_store_set (UDisksPersistentStore *store,UDisksPersistentFlags flags,const gchar *key,const GVariantType *type,GVariant *value,GError **error);
"path" gchar* : Read / Write / Construct Only "temp-path" gchar* : Read / Write / Construct Only
Object used to store information that persists across the life cycle of the process.
The low-level interface consists of udisks_persistent_store_get()
and udisks_persistent_store_set() that can be used to get/set any
GVariant.
typedef struct _UDisksPersistentStore UDisksPersistentStore;
The UDisksPersistentStore structure contains only private data and should only be accessed using the provided API.
UDisksPersistentStore * udisks_persistent_store_new (const gchar *path,const gchar *temp_path);
Creates a new UDisksPersistentStore object.
Data will be stored in a sub-directory of path and temp_path
called udisks-persistence-2.0. See the
"path" and "temp-path"
properties for more information.
|
Path to where to store data that will persist across reboots (e.g. /var/lib/udisks2). |
|
Path to where to store data that will persist only until next reboot (e.g. /run/udisks2). |
Returns : |
A UDisksPersistentStore. Free with g_object_unref(). |
const gchar * udisks_persistent_store_get_path (UDisksPersistentStore *store);
Gets the path that store stores its data at.
|
A UDisksPersistentStore. |
Returns : |
A string owned by store. Do not free. |
const gchar * udisks_persistent_store_get_temp_path
(UDisksPersistentStore *store);
Gets the that store stores its temporary data at.
|
A UDisksPersistentStore. |
Returns : |
A string owned by store. Do not free. |
typedef enum {
UDISKS_PERSISTENT_FLAGS_NONE = 0,
UDISKS_PERSISTENT_FLAGS_NORMAL_STORE = (1<<0),
UDISKS_PERSISTENT_FLAGS_TEMPORARY_STORE = (1<<1),
} UDisksPersistentFlags;
Flag enumeration used in the UDisksPersistentStore type.
GVariant * udisks_persistent_store_get (UDisksPersistentStore *store,UDisksPersistentFlags flags,const gchar *key,const GVariantType *type,GError **error);
Low-level function to look up the value for key, if any.
|
A UDisksPersistentStore. |
|
Zero or more flags from the UDisksPersistentFlags enumeration. |
|
The key to get the value for. Must be ASCII and not contain the '/' character. |
|
A definite GVariantType. |
|
Return location for error or NULL. |
Returns : |
The value or NULL if not found or if error is set. The
returned GVariant must be freed with g_variant_unref(). |
gboolean udisks_persistent_store_set (UDisksPersistentStore *store,UDisksPersistentFlags flags,const gchar *key,const GVariantType *type,GVariant *value,GError **error);
Low-level function that sets the value for key to value.
If value is floating it is consumed.
|
A UDisksPersistentStore. |
|
Zero or more flags from the UDisksPersistentFlags enumeration. |
|
The key to get the value for. Must be ASCII and not contain the '/' character. |
|
A definite GVariantType. |
|
The value to set. |
|
Return location for error or NULL. |
Returns : |
TRUE if setting the value succeeded, FALSE if error is set. |
"path" property"path" gchar* : Read / Write / Construct Only
The path to store data that will persist across reboots.
Data will be stored in this directory - if it does not exist, it will be created with mode 0700.
Default value: NULL
"temp-path" property"temp-path" gchar* : Read / Write / Construct Only
The path to store data that will not persist across reboots.
Data will be stored in this directory - if it does not exist, it will be created with mode 0700.
Default value: NULL