GXmlSerializableProperty

GXmlSerializableProperty — Represent any property to be added as a GXmlAttribute to a GXmlElement

Functions

Types and Values

Description

The actual value stored and returned by gxml_serializable_property_get_serializable_property_value() is the actual string in the XML property, this means may the value could differ from the spected value on some implementations like GXmlSerializableInt. Take a look in each implementations about retured values.

Implementations of GXmlSerializableProperty, could be used to provide more flexibility when parsing GXmlAttribute properties values and to exclude to be serialized if they have not been created in the holding objects.

Functions

gxml_serializable_property_get_serializable_property_value ()

gchar *
gxml_serializable_property_get_serializable_property_value
                               (GXmlSerializableProperty *self);

Value to be set to a GXmlAttribute, to be added to a GXmlElement

Parameters

self

the GXmlSerializableProperty instance

 

gxml_serializable_property_set_serializable_property_value ()

void
gxml_serializable_property_set_serializable_property_value
                               (GXmlSerializableProperty *self,
                                const gchar *val);

Set value to be set to a GXmlAttribute, to be added to a GXmlElement

If value is set to null then the property will be ignored by default and no property will be set to given GXmlElement.

Some implementations stores the value without any convertion at all; then if the value, from XML property, makes no sense for the property type, you should take care to use the provided API from them to convert it.

Parameters

self

the GXmlSerializableProperty instance

 

val

 

 

gxml_serializable_property_deserialize_property ()

gboolean
gxml_serializable_property_deserialize_property
                               (GXmlSerializableProperty *self,
                                GXmlNode *property_node,
                                GParamSpec *prop,
                                gboolean nick,
                                GError **error);

Tryies to deserialize from a GXmlNode searching a GXmlAttribute with the name provided in param prop or its nick if nick is true, if not set, then GParamSpec name should used. If param nick is set to true, then GParamSpec nick is used as name.

Parameters

self

the GXmlSerializableProperty instance

 

property_node

 

 

prop

 

 

nick

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_serializable_property_serialize_property ()

GXmlNode *
gxml_serializable_property_serialize_property
                               (GXmlSerializableProperty *self,
                                GXmlNode *property_node,
                                GParamSpec *prop,
                                gboolean nick,
                                GError **error);

Serialization method to add a GXmlAttribute to a GXmlElement, using GParamSpec name or nick, if param nick is set to true, as the attribute's name.

If gxml_serializable_property_get_serializable_property_value() returns null given GXmlNode should not be modified.

Parameters

self

the GXmlSerializableProperty instance

 

property_node

 

 

prop

 

 

nick

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_serializable_property_default_serializable_property_serialize_property ()

GXmlNode *
gxml_serializable_property_default_serializable_property_serialize_property
                               (GXmlSerializableProperty *self,
                                GXmlNode *element,
                                GParamSpec *prop,
                                gboolean nick,
                                GError **error);

Default serialization method to add a GXmlAttribute to a GXmlElement

If gxml_serializable_property_get_serializable_property_value() returns null given GXmlNode is not modified.

Parameters

self

the GXmlSerializableProperty instance

 

element

 

 

prop

 

 

nick

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_serializable_property_default_serializable_property_deserialize_property ()

gboolean
gxml_serializable_property_default_serializable_property_deserialize_property
                               (GXmlSerializableProperty *self,
                                GXmlNode *property_node,
                                GParamSpec *prop,
                                gboolean nick,
                                GError **error);

Tryies to deserialize from a GXmlNode searching a GXmlAttribute with the name in param prop or from its nick if nick is true.

Parameters

self

the GXmlSerializableProperty instance

 

property_node

 

 

prop

 

 

nick

 

 

error

location to store the error occuring, or NULL to ignore

 

Types and Values

GXmlSerializableProperty

typedef struct _GXmlSerializableProperty GXmlSerializableProperty;

Represent any property to be added as a GXmlAttribute to a GXmlElement

The actual value stored and returned by gxml_serializable_property_get_serializable_property_value() is the actual string in the XML property, this means may the value could differ from the spected value on some implementations like GXmlSerializableInt. Take a look in each implementations about retured values.

Implementations of GXmlSerializableProperty, could be used to provide more flexibility when parsing GXmlAttribute properties values and to exclude to be serialized if they have not been created in the holding objects.


struct GXmlSerializablePropertyIface

struct GXmlSerializablePropertyIface {
	GTypeInterface parent_iface;
	gchar* (*get_serializable_property_value) (GXmlSerializableProperty* self);
	void (*set_serializable_property_value) (GXmlSerializableProperty* self, const gchar* val);
	gboolean (*deserialize_property) (GXmlSerializableProperty* self, GXmlNode* property_node, GParamSpec* prop, gboolean nick, GError** error);
	GXmlNode* (*serialize_property) (GXmlSerializableProperty* self, GXmlNode* property_node, GParamSpec* prop, gboolean nick, GError** error);
};

Interface for creating GXmlSerializableProperty implementations.

Members

GTypeInterface parent_iface;

the parent interface structure

 

get_serializable_property_value ()

virtual method called by gxml_serializable_property_get_serializable_property_value()

 

set_serializable_property_value ()

virtual method called by gxml_serializable_property_set_serializable_property_value()

 

deserialize_property ()

virtual method called by gxml_serializable_property_deserialize_property()

 

serialize_property ()

virtual method called by gxml_serializable_property_serialize_property()