wxShapeFramework  1.13.0 beta
XmlSerializer.h File Reference
#include <wx/wx.h>
#include <wx/wxxmlserializer/PropertyIO.h>
#include <wx/xml/xml.h>
#include <wx/hashmap.h>
Include dependency graph for XmlSerializer.h:
This graph shows which files directly or indirectly include this file:

Classes

class  xsSerializable
 Base class encapsulating object which can be serialized/deserialized to/from XML file (disk file or any stream). This class acts as a data container for properties (xsProperty class objects) encapsulating serialized class data members. More...
class  wxXmlSerializer
 Class encapsulates a serializable objects' manager which is responsible for handling stored serializable objects and their serialization/deserialization from/to XML files or streams. More...
class  xsProperty
 Class encapsulates a property stored in a list included inside a parent serializable object (class xsSerializable) which is serialized/deserialized to/from XML file. The property object type is defined by a string name and is processed by parent xsSerializable class object. More...

Defines

#define xsWITH_ROOT   true
#define xsWITHOUT_ROOT   false
#define xsRECURSIVE   true
#define xsNORECURSIVE   false
#define XS_SERIALIZE_STRING(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("string"), name);
 Macro creates new serialized STRING property.
#define XS_SERIALIZE_STRING_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("string"), name, def);
 Macro creates new serialized STRING property with defined default value.
#define XS_SERIALIZE_CHAR(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("char"), name);
 Macro creates new serialized STRING property.
#define XS_SERIALIZE_CHAR_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("char"), name, def);
 Macro creates new serialized STRING property with defined default value.
#define XS_SERIALIZE_LONG(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("long"), name);
 Macro creates new serialized LONG property.
#define XS_SERIALIZE_LONG_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("long"), name, xsLongPropIO::ToString(def));
 Macro creates new serialized LONG property with defined default value.
#define XS_SERIALIZE_DOUBLE(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("double"), name);
 Macro creates new serialized DOUBLE property.
#define XS_SERIALIZE_DOUBLE_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("double"), name, xsDoublePropIO::ToString(def));
 Macro creates new serialized DOUBLE property with defined default value.
#define XS_SERIALIZE_INT(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("int"), name);
 Macro creates new serialized INT property.
#define XS_SERIALIZE_INT_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("int"), name, xsIntPropIO::ToString(def));
 Macro creates new serialized INT property with defined default value.
#define XS_SERIALIZE_FLOAT(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("float"), name);
 Macro creates new serialized FLOAT property.
#define XS_SERIALIZE_FLOAT_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("float"), name, xsFloatPropIO::ToString(def));
 Macro creates new serialized FLOAT property with defined default value.
#define XS_SERIALIZE_BOOL(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("bool"), name);
 Macro creates new serialized BOOL property.
#define XS_SERIALIZE_BOOL_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("bool"), name, xsBoolPropIO::ToString(def));
 Macro creates new serialized BOOL property with defined default value.
#define XS_SERIALIZE_POINT(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("point"), name);
 Macro creates new serialized wxPoint property.
#define XS_SERIALIZE_POINT_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("point"), name, xsPointPropIO::ToString(def));
 Macro creates new serialized wxPoint property with defined default value.
#define XS_SERIALIZE_REALPOINT(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("realpoint"), name);
 Macro creates new serialized wxRealPoint property.
#define XS_SERIALIZE_REALPOINT_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("realpoint"), name, xsRealPointPropIO::ToString(def));
 Macro creates new serialized wxRealPoint property with defined default value.
#define XS_SERIALIZE_SIZE(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("size"), name);
 Macro creates new serialized wxSize property.
#define XS_SERIALIZE_SIZE_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("size"), name, xsSizePropIO::ToString(def));
 Macro creates new serialized wxSize property with defined default value.
#define XS_SERIALIZE_COLOUR(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("colour"), name);
 Macro creates new serialized wxColour property.
#define XS_SERIALIZE_COLOUR_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("colour"), name, xsColourPropIO::ToString(def));
 Macro creates new serialized wxColour property with defined default value.
#define XS_SERIALIZE_PEN(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("pen"), name);
 Macro creates new serialized wxPen property.
#define XS_SERIALIZE_PEN_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("pen"), name, xsPenPropIO::ToString(def));
 Macro creates new serialized wxPen property with defined default value.
#define XS_SERIALIZE_BRUSH(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("brush"), name);
 Macro creates new serialized wxBrush property.
#define XS_SERIALIZE_BRUSH_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("brush"), name, xsBrushPropIO::ToString(def));
 Macro creates new serialized wxBrush property with defined default value.
#define XS_SERIALIZE_FONT(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("font"), name);
 Macro creates new serialized wxFont property.
#define XS_SERIALIZE_FONT_EX(x, name, def)   XS_SERIALIZE_PROPERTY_EX(x, wxT("font"), name, xsFontPropIO::ToString(def));
 Macro creates new serialized wxFont property with defined default value.
#define XS_SERIALIZE_ARRAYSTRING(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("arraystring"), name);
 Macro creates new serialized property (type 'array of strings (wxArrayString)')
#define XS_SERIALIZE_ARRAYCHAR(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("arraychar"), name);
 Macro creates new serialized property (type 'array of chars (CharArray)')
#define XS_SERIALIZE_ARRAYINT(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("arrayint"), name);
 Macro creates new serialized property (type 'array of ints (IntArray)')
#define XS_SERIALIZE_ARRAYLONG(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("arraylong"), name);
 Macro creates new serialized property (type 'array of longs (LongArray)')
#define XS_SERIALIZE_ARRAYDOUBLE(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("arraydouble"), name);
 Macro creates new serialized property (type 'array of doubles (DoubleArray)')
#define XS_SERIALIZE_ARRAYREALPOINT(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("arrayrealpoint"), name);
 Macro creates new serialized property (type 'array of wxRealPoint objects')
#define XS_SERIALIZE_LISTREALPOINT(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("listrealpoint"), name);
 Macro creates new serialized property (type 'list of wxRealPoint objects')
#define XS_SERIALIZE_LISTSERIALIZABLE(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("listserializable"), name);
 Macro creates new serialized property (type 'list of xsSerializable objects')
#define XS_SERIALIZE_MAPSTRING(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("mapstring"), name);
 Macro creates new serialized property (type 'string hash map (StringMap)')
#define XS_SERIALIZE_DYNAMIC_OBJECT(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("serializabledynamic"), name);
 Macro creates new serialized property encapsulating a dynamic serializable object.
#define XS_SERIALIZE_DYNAMIC_OBJECT_NO_CREATE(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("serializabledynamicnocreate"), name);
 Macro creates new serialized property encapsulating a dynamic serializable object.
#define XS_SERIALIZE_STATIC_OBJECT(x, name)   XS_SERIALIZE_PROPERTY(x, wxT("serializablestatic"), name);
 Macro creates new serialized property encapsulating a static serializable object.
#define XS_SERIALIZE_PROPERTY(x, type, name)   AddProperty(new xsProperty(&x, type, name));
 Macro creates new serialized property of given type.
#define XS_SERIALIZE_PROPERTY_EX(x, type, name, def)   AddProperty(new xsProperty(&x, type, name, def));
 Macro creates new serialized property of given type with defined dafult value.
#define XS_SERIALIZE(x, name)   AddProperty(new xsProperty(&x, name));
 Macro creates new serialized property and automaticaly determines its type (if supported)
#define XS_SERIALIZE_EX(x, name, def)   AddProperty(new xsProperty(&x, name, def));
 Macro creates new serialized property with defined dafult value and automaticaly determines its type (if supported)
#define XS_REGISTER_IO_HANDLER(type, class)   wxXmlSerializer::m_mapPropertyIOHandlers[type] = new class();
 Macro registers new IO handler for specified data type (handler class must exist)
#define XS_DECLARE_CLONABLE_CLASS(name)
 Enable RTTI (the same as DECLARE_DYNAMIC_CLASS) and declare xsSerializable::Clone() function.
#define XS_IMPLEMENT_CLONABLE_CLASS(name, base)
 Enable RTTI (the same as IMPLEMENT_DYNAMIC_CLASS) and implement xsSerializable::Clone() function.
#define XS_IMPLEMENT_CLONABLE_CLASS2(name, base1, base2)
 Enable RTTI (the same as IMPLEMENT_DYNAMIC_CLASS2) and implement xsSerializable::Clone() function.

Functions

 WX_DECLARE_LIST_WITH_DECL (xsProperty, PropertyList, class WXDLLIMPEXP_XS)
 WX_DECLARE_LIST_WITH_DECL (xsSerializable, SerializableList, class WXDLLIMPEXP_XS)
 WX_DECLARE_HASH_MAP (long, xsSerializable *, wxIntegerHash, wxIntegerEqual, IDMap)

Variables

class WXDLLIMPEXP_XS xsProperty
class WXDLLIMPEXP_XS xsSerializable
class WXDLLIMPEXP_XS wxXmlSerializer

Define Documentation

#define XS_DECLARE_CLONABLE_CLASS (   name)
Value:
public: \
        DECLARE_DYNAMIC_CLASS(name) \
        virtual wxObject* Clone(); \

Enable RTTI (the same as DECLARE_DYNAMIC_CLASS) and declare xsSerializable::Clone() function.

#define XS_IMPLEMENT_CLONABLE_CLASS (   name,
  base 
)
Value:
IMPLEMENT_DYNAMIC_CLASS(name, base) \
        wxObject* name::Clone() \
        { \
                if( m_fClone ) return new name(*this); \
                else \
                        return NULL; \
        } \

Enable RTTI (the same as IMPLEMENT_DYNAMIC_CLASS) and implement xsSerializable::Clone() function.

#define XS_IMPLEMENT_CLONABLE_CLASS2 (   name,
  base1,
  base2 
)
Value:
IMPLEMENT_DYNAMIC_CLASS2(name, base1, base2) \
        wxObject* name::Clone() \
        { \
                if( m_fClone ) return new name(*this); \
                else \
                        return NULL; \
        } \

Enable RTTI (the same as IMPLEMENT_DYNAMIC_CLASS2) and implement xsSerializable::Clone() function.

#define XS_REGISTER_IO_HANDLER (   type,
  class 
)    wxXmlSerializer::m_mapPropertyIOHandlers[type] = new class();

Macro registers new IO handler for specified data type (handler class must exist)

#define XS_SERIALIZE (   x,
  name 
)    AddProperty(new xsProperty(&x, name));

Macro creates new serialized property and automaticaly determines its type (if supported)

#define XS_SERIALIZE_ARRAYCHAR (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("arraychar"), name);

Macro creates new serialized property (type 'array of chars (CharArray)')

#define XS_SERIALIZE_ARRAYDOUBLE (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("arraydouble"), name);

Macro creates new serialized property (type 'array of doubles (DoubleArray)')

#define XS_SERIALIZE_ARRAYINT (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("arrayint"), name);

Macro creates new serialized property (type 'array of ints (IntArray)')

#define XS_SERIALIZE_ARRAYLONG (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("arraylong"), name);

Macro creates new serialized property (type 'array of longs (LongArray)')

#define XS_SERIALIZE_ARRAYREALPOINT (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("arrayrealpoint"), name);

Macro creates new serialized property (type 'array of wxRealPoint objects')

#define XS_SERIALIZE_ARRAYSTRING (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("arraystring"), name);

Macro creates new serialized property (type 'array of strings (wxArrayString)')

#define XS_SERIALIZE_BOOL (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("bool"), name);

Macro creates new serialized BOOL property.

#define XS_SERIALIZE_BOOL_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("bool"), name, xsBoolPropIO::ToString(def));

Macro creates new serialized BOOL property with defined default value.

#define XS_SERIALIZE_BRUSH (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("brush"), name);

Macro creates new serialized wxBrush property.

#define XS_SERIALIZE_BRUSH_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("brush"), name, xsBrushPropIO::ToString(def));

Macro creates new serialized wxBrush property with defined default value.

#define XS_SERIALIZE_CHAR (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("char"), name);

Macro creates new serialized STRING property.

#define XS_SERIALIZE_CHAR_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("char"), name, def);

Macro creates new serialized STRING property with defined default value.

#define XS_SERIALIZE_COLOUR (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("colour"), name);

Macro creates new serialized wxColour property.

#define XS_SERIALIZE_COLOUR_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("colour"), name, xsColourPropIO::ToString(def));

Macro creates new serialized wxColour property with defined default value.

#define XS_SERIALIZE_DOUBLE (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("double"), name);

Macro creates new serialized DOUBLE property.

#define XS_SERIALIZE_DOUBLE_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("double"), name, xsDoublePropIO::ToString(def));

Macro creates new serialized DOUBLE property with defined default value.

#define XS_SERIALIZE_DYNAMIC_OBJECT (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("serializabledynamic"), name);

Macro creates new serialized property encapsulating a dynamic serializable object.

#define XS_SERIALIZE_DYNAMIC_OBJECT_NO_CREATE (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("serializabledynamicnocreate"), name);

Macro creates new serialized property encapsulating a dynamic serializable object.

#define XS_SERIALIZE_EX (   x,
  name,
  def 
)    AddProperty(new xsProperty(&x, name, def));

Macro creates new serialized property with defined dafult value and automaticaly determines its type (if supported)

#define XS_SERIALIZE_FLOAT (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("float"), name);

Macro creates new serialized FLOAT property.

#define XS_SERIALIZE_FLOAT_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("float"), name, xsFloatPropIO::ToString(def));

Macro creates new serialized FLOAT property with defined default value.

#define XS_SERIALIZE_FONT (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("font"), name);

Macro creates new serialized wxFont property.

#define XS_SERIALIZE_FONT_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("font"), name, xsFontPropIO::ToString(def));

Macro creates new serialized wxFont property with defined default value.

#define XS_SERIALIZE_INT (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("int"), name);

Macro creates new serialized INT property.

#define XS_SERIALIZE_INT_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("int"), name, xsIntPropIO::ToString(def));

Macro creates new serialized INT property with defined default value.

#define XS_SERIALIZE_LISTREALPOINT (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("listrealpoint"), name);

Macro creates new serialized property (type 'list of wxRealPoint objects')

#define XS_SERIALIZE_LISTSERIALIZABLE (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("listserializable"), name);

Macro creates new serialized property (type 'list of xsSerializable objects')

#define XS_SERIALIZE_LONG (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("long"), name);

Macro creates new serialized LONG property.

#define XS_SERIALIZE_LONG_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("long"), name, xsLongPropIO::ToString(def));

Macro creates new serialized LONG property with defined default value.

#define XS_SERIALIZE_MAPSTRING (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("mapstring"), name);

Macro creates new serialized property (type 'string hash map (StringMap)')

#define XS_SERIALIZE_PEN (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("pen"), name);

Macro creates new serialized wxPen property.

#define XS_SERIALIZE_PEN_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("pen"), name, xsPenPropIO::ToString(def));

Macro creates new serialized wxPen property with defined default value.

#define XS_SERIALIZE_POINT (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("point"), name);

Macro creates new serialized wxPoint property.

#define XS_SERIALIZE_POINT_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("point"), name, xsPointPropIO::ToString(def));

Macro creates new serialized wxPoint property with defined default value.

#define XS_SERIALIZE_PROPERTY (   x,
  type,
  name 
)    AddProperty(new xsProperty(&x, type, name));

Macro creates new serialized property of given type.

#define XS_SERIALIZE_PROPERTY_EX (   x,
  type,
  name,
  def 
)    AddProperty(new xsProperty(&x, type, name, def));

Macro creates new serialized property of given type with defined dafult value.

#define XS_SERIALIZE_REALPOINT (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("realpoint"), name);

Macro creates new serialized wxRealPoint property.

#define XS_SERIALIZE_REALPOINT_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("realpoint"), name, xsRealPointPropIO::ToString(def));

Macro creates new serialized wxRealPoint property with defined default value.

#define XS_SERIALIZE_SIZE (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("size"), name);

Macro creates new serialized wxSize property.

#define XS_SERIALIZE_SIZE_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("size"), name, xsSizePropIO::ToString(def));

Macro creates new serialized wxSize property with defined default value.

#define XS_SERIALIZE_STATIC_OBJECT (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("serializablestatic"), name);

Macro creates new serialized property encapsulating a static serializable object.

#define XS_SERIALIZE_STRING (   x,
  name 
)    XS_SERIALIZE_PROPERTY(x, wxT("string"), name);

Macro creates new serialized STRING property.

#define XS_SERIALIZE_STRING_EX (   x,
  name,
  def 
)    XS_SERIALIZE_PROPERTY_EX(x, wxT("string"), name, def);

Macro creates new serialized STRING property with defined default value.

#define xsNORECURSIVE   false
#define xsRECURSIVE   true
#define xsWITH_ROOT   true
#define xsWITHOUT_ROOT   false

Function Documentation

WX_DECLARE_HASH_MAP ( long  ,
xsSerializable ,
wxIntegerHash  ,
wxIntegerEqual  ,
IDMap   
)
WX_DECLARE_LIST_WITH_DECL ( xsProperty  ,
PropertyList  ,
class WXDLLIMPEXP_XS   
)

Variable Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines