GXmlSerializableEnum

GXmlSerializableEnum — Represent any value as string but a list of enum values by default to select from. property to be added as a GXmlAttribute to a GXmlElement.

Functions

Types and Values

Description

This class makes easy to create enumerations with its representation to string, but limited to the actual values of the enumeration, making it flexible for values not supported now but possible because some extensions. Can be added an extension element in the enumeration and return it when the supported values are not met with the string representation in the property.

Functions

gxml_serializable_enum_set_enum_type ()

void
gxml_serializable_enum_set_enum_type (GXmlSerializableEnum *self,
                                      GType type);

Parameters

self

the GXmlSerializableEnum instance

 

type

 

 

gxml_serializable_enum_get_enum_type ()

GType
gxml_serializable_enum_get_enum_type (GXmlSerializableEnum *self);

Parameters

self

the GXmlSerializableEnum instance

 

gxml_serializable_enum_parse ()

void
gxml_serializable_enum_parse (GXmlSerializableEnum *self,
                              const gchar *str,
                              GError **error);

Parameters

self

the GXmlSerializableEnum instance

 

str

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_serializable_enum_parse_integer ()

void
gxml_serializable_enum_parse_integer (GXmlSerializableEnum *self,
                                      gint v,
                                      GError **error);

Parameters

self

the GXmlSerializableEnum instance

 

v

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_serializable_enum_to_integer ()

gint
gxml_serializable_enum_to_integer (GXmlSerializableEnum *self,
                                   GError **error);

Parameters

self

the GXmlSerializableEnum instance

 

error

location to store the error occuring, or NULL to ignore

 

gxml_serializable_enum_to_string ()

gchar *
gxml_serializable_enum_to_string (GXmlSerializableEnum *self);

Parameters

self

the GXmlSerializableEnum instance

 

gxml_serializable_enum_new_with_enum ()

GXmlSerializableEnum *
gxml_serializable_enum_new_with_enum (GType type);

Parameters

type

 

 

gxml_serializable_enum_new ()

GXmlSerializableEnum *
gxml_serializable_enum_new (void);

Types and Values

GXML_TYPE_SERIALIZABLE_ENUM

#define GXML_TYPE_SERIALIZABLE_ENUM (gxml_serializable_enum_get_type ())

The type for GXmlSerializableEnum.


struct GXmlSerializableEnum

struct GXmlSerializableEnum {
	GObject parent_instance;
	GXmlSerializableEnumPrivate * priv;
	gchar* _val;
	GType _enumtype;
};

Represent any value as string but a list of enum values by default to select from. property to be added as a GXmlAttribute to a GXmlElement.

This class makes easy to create enumerations with its representation to string, but limited to the actual values of the enumeration, making it flexible for values not supported now but possible because some extensions. Can be added an extension element in the enumeration and return it when the supported values are not met with the string representation in the property.


struct GXmlSerializableEnumClass

struct GXmlSerializableEnumClass {
	GObjectClass parent_class;
};

The class structure for GXML_TYPE_SERIALIZABLE_ENUM. All the fields in this structure are private and should never be accessed directly.

Members


enum GXmlSerializableEnumError

Errors when de/serializing enumerations as a set of string when using GXmlSerializableEnum

Members

GXML_SERIALIZABLE_ENUM_ERROR_INVALID_VALUE_ERROR

   

GXML_SERIALIZABLE_ENUM_ERROR_PARSE_ERROR