| Top |
Serialization object.Serialization object. — Serialization, deserialization and duplication object. |
Functions
Types and Values
| enum | NcmSerializeOpt |
| #define | NCM_SERIALIZE_PROPERTY_TYPE |
| #define | NCM_SERIALIZE_PROPERTIES_TYPE |
| #define | NCM_SERIALIZE_OBJECT_TYPE |
| #define | NCM_SERIALIZE_OBJECT_FORMAT |
| #define | NCM_SERIALIZE_VECTOR_TYPE |
| #define | NCM_SERIALIZE_MATRIX_TYPE |
| #define | NCM_SERIALIZE_AUTOSAVE_NAME |
| #define | NCM_SERIALIZE_AUTOSAVE_NFORMAT |
Functions
NCM_SERIALIZE_OPT_CLEAN_DUP
#define NCM_SERIALIZE_OPT_CLEAN_DUP (NCM_SERIALIZE_OPT_AUTOSAVE_SER | NCM_SERIALIZE_OPT_AUTONAME_SER)
ncm_serialize_new ()
NcmSerialize *
ncm_serialize_new (NcmSerializeOpt sopt);
Creates a new NcmSerialize object.
ncm_serialize_ref ()
NcmSerialize *
ncm_serialize_ref (NcmSerialize *ser);
Increases the reference count of ser
by one.
ncm_serialize_free ()
void
ncm_serialize_free (NcmSerialize *ser);
Decreases the reference count of ser
by one.
ncm_serialize_clear ()
void
ncm_serialize_clear (NcmSerialize **ser);
Decreases the reference count of *ser
by one, and sets *ser
to NULL.
ncm_serialize_contain_instance ()
gboolean ncm_serialize_contain_instance (NcmSerialize *ser,gpointer obj);
Checks if the GObject instance obj
is contained in ser
.
ncm_serialize_contain_name ()
gboolean ncm_serialize_contain_name (NcmSerialize *ser,gchar *name);
Checks if there is an instance named name
in ser
.
ncm_serialize_count_instances ()
guint
ncm_serialize_count_instances (NcmSerialize *ser);
Counts the number of instances registered in ser
.
ncm_serialize_get_by_name ()
gpointer ncm_serialize_get_by_name (NcmSerialize *ser,gchar *name);
Gets a new reference for the instance name
or null if there isn't a instance named name
.
ncm_serialize_peek_name ()
gchar * ncm_serialize_peek_name (NcmSerialize *ser,gpointer obj);
Gets the named associated to the instance obj
, it is an error to call this function
when the obj
is not contained in ser
.
ncm_serialize_set ()
void ncm_serialize_set (NcmSerialize *ser,gpointer obj,gchar *name,gboolean overwrite);
Adds the object obj
to ser
using name
.
Parameters
ser |
a NcmSerialize. |
|
obj |
a GObject. |
[type GObject] |
name |
the |
|
overwrite |
whether to overwrite if there is already an object named |
ncm_serialize_is_named ()
gboolean ncm_serialize_is_named (NcmSerialize *ser,const gchar *serobj,gchar **name);
Checks if serobj
is a named serialized object, if so sets its name in name
and returns TRUE.
Parameters
ser |
a NcmSerialize. |
|
serobj |
serialized object. |
|
name |
object name. |
[allow-none][out][transfer full] |
ncm_serialize_set_property ()
void ncm_serialize_set_property (NcmSerialize *ser,GObject *obj,const gchar *prop_str);
Deserialize the set of object properties in params
and sets the obj
.
ncm_serialize_from_variant ()
GObject * ncm_serialize_from_variant (NcmSerialize *ser,GVariant *var_obj);
Deserialize and returns the newly created object.
ncm_serialize_from_name_params ()
GObject * ncm_serialize_from_name_params (NcmSerialize *ser,const gchar *obj_name,GVariant *params);
Parses the serialized parameters and returns the newly created object using them.
Parameters
ser |
a NcmSerialize. |
|
obj_name |
string containing the object name. |
|
params |
a GVariant containing the object parameters. |
ncm_serialize_from_string ()
GObject * ncm_serialize_from_string (NcmSerialize *ser,const gchar *obj_ser);
Parses the serialized and returns the newly created object.
ncm_serialize_gvalue_to_gvariant ()
GVariant * ncm_serialize_gvalue_to_gvariant (NcmSerialize *ser,GValue *val);
ncm_serialize_to_variant ()
GVariant * ncm_serialize_to_variant (NcmSerialize *ser,GObject *obj);
Serialize the obj
to a GVariant
representation.
ncm_serialize_to_string ()
gchar * ncm_serialize_to_string (NcmSerialize *ser,GObject *obj,gboolean valid_variant);
Serialize the object obj
to a string.
Parameters
ser |
a NcmSerialize. |
|
obj |
a GObject. |
|
valid_variant |
whether to use a valid GVariant representation. |
ncm_serialize_dup_obj ()
GObject * ncm_serialize_dup_obj (NcmSerialize *ser,GObject *obj);
Duplicates obj
by serializing and deserializing a new object.
ncm_serialize_global ()
NcmSerialize *
ncm_serialize_global (void);
Gets the global serialization object, instanciates it if necessary.
ncm_serialize_global_reset ()
void
ncm_serialize_global_reset (void);
Releases all objects in global NcmSerialize.
ncm_serialize_global_contain_instance ()
gboolean
ncm_serialize_global_contain_instance (gpointer obj);
Global version of ncm_serialize_contain_instance().
ncm_serialize_global_contain_name ()
gboolean
ncm_serialize_global_contain_name (gchar *name);
Global version of ncm_serialize_contain_name().
ncm_serialize_global_count_instances ()
guint
ncm_serialize_global_count_instances (void);
Global version of ncm_serialize_count_instances().
ncm_serialize_global_get_by_name ()
gpointer
ncm_serialize_global_get_by_name (gchar *name);
Global version of ncm_serialize_get_by_name().
ncm_serialize_global_global_peek_name ()
gchar *
ncm_serialize_global_global_peek_name (gpointer obj);
ncm_serialize_global_set ()
void ncm_serialize_global_set (gpointer obj,gchar *name,gboolean overwrite);
Global version of ncm_serialize_set().
Parameters
obj |
a GObject. |
[type GObject] |
name |
the |
|
overwrite |
whether to overwrite if there is already an object named |
ncm_serialize_global_is_named ()
gboolean ncm_serialize_global_is_named (const gchar *serobj,gchar **name);
Global version of ncm_serialize_is_named().
ncm_serialize_global_set_property ()
void ncm_serialize_global_set_property (GObject *obj,const gchar *prop_str);
Global version of ncm_serialize_set_property().
ncm_serialize_global_from_variant ()
GObject *
ncm_serialize_global_from_variant (GVariant *var_obj);
Global version of ncm_serialize_from_variant().
ncm_serialize_global_from_name_params ()
GObject * ncm_serialize_global_from_name_params (const gchar *obj_name,GVariant *params);
Global version of ncm_serialize_from_name_params().
Parameters
obj_name |
string containing the object name. |
|
params |
a GVariant containing the object parameters. |
ncm_serialize_global_from_string ()
GObject *
ncm_serialize_global_from_string (const gchar *obj_ser);
Global version of ncm_serialize_from_string().
ncm_serialize_global_gvalue_to_gvariant ()
GVariant *
ncm_serialize_global_gvalue_to_gvariant
(GValue *val);
Global version of ncm_serialize_gvalue_to_gvariant().
ncm_serialize_global_to_variant ()
GVariant *
ncm_serialize_global_to_variant (GObject *obj);
Global version of ncm_serialize_to_variant().
ncm_serialize_global_to_string ()
gchar * ncm_serialize_global_to_string (GObject *obj,gboolean valid_variant);
Global version of ncm_serialize_to_string().
ncm_serialize_global_dup_obj ()
GObject *
ncm_serialize_global_dup_obj (GObject *obj);
Global version of ncm_serialize_dup_obj().
Types and Values
NCM_SERIALIZE_OBJECT_FORMAT
#define NCM_SERIALIZE_OBJECT_FORMAT "{s@"NCM_SERIALIZE_PROPERTIES_TYPE"}"
Property Details
The “options” property
“options” NcmSerializeOpt
Serialization options.
Flags: Read / Write / Construct