Top | ![]() |
![]() |
![]() |
![]() |
GXmlSerializablePropertyGXmlSerializableProperty — 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.
gchar *
gxml_serializable_property_get_serializable_property_value
(GXmlSerializableProperty *self
);
Value to be set to a GXmlAttribute, to be added to a GXmlElement
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.
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.
self |
the GXmlSerializableProperty instance |
|
property_node |
|
|
prop |
|
|
nick |
|
|
error |
location to store the error occuring, or |
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.
self |
the GXmlSerializableProperty instance |
|
property_node |
|
|
prop |
|
|
nick |
|
|
error |
location to store the error occuring, or |
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.
self |
the GXmlSerializableProperty instance |
|
element |
|
|
prop |
|
|
nick |
|
|
error |
location to store the error occuring, or |
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.
self |
the GXmlSerializableProperty instance |
|
property_node |
|
|
prop |
|
|
nick |
|
|
error |
location to store the error occuring, or |
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 { 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.
the parent interface structure |
||
virtual method called by |
||
virtual method called by |
||
virtual method called by |
||
virtual method called by |