State Storage¶
digraph inheritance { rankdir=LR; GObject -> WpState; }-
struct WpState¶
The WpState class saves and loads properties from a file
GObject Properties
- name
-
The file name where the state will be stored.
gchar *
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
-
WpState *wp_state_new(const gchar *name)¶
- Parameters
name – the state name
- Returns
(transfer full): the new WpState
-
const gchar *wp_state_get_name(WpState *self)¶
- Parameters
self – the state
- Returns
the name of this state
-
const gchar *wp_state_get_location(WpState *self)¶
- Parameters
self – the state
- Returns
the location of this state
-
gboolean wp_state_save(WpState *self, const gchar *group, WpProperties *props)¶
Saves new properties in the state, overwriting all previous data.
- Parameters
self – the state
group – the group name where the properties will be save
props – (transfer none): the properties to save
- Returns
TRUE if the properties could be saved, FALSE otherwise
-
WpProperties *wp_state_load(WpState *self, const gchar *group)¶
Loads the state data into new properties.
- Parameters
self – the state
group – the group which the properties will be loaded from
- Returns
(transfer full): the new properties with the state data
-
WP_TYPE_STATE (wp_state_get_type ())¶
The WpState GType.