xsProperty Class Reference

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...

#include <XmlSerializer.h>

List of all members.

Public Member Functions

 DECLARE_DYNAMIC_CLASS (xsProperty)
 xsProperty ()
 Default constructor.
 xsProperty (void *src, const wxString &type, const wxString &field, const wxString &def=wxT(""))
 Constructor.
 xsProperty (bool *src, const wxString &field)
 Constructor for BOOL property.
 xsProperty (bool *src, const wxString &field, bool def)
 Constructor for BOOL property with defined default value.
 xsProperty (long *src, const wxString &field)
 Constructor for LONG property.
 xsProperty (long *src, const wxString &field, long def)
 Constructor for LONG property with defined default value.
 xsProperty (int *src, const wxString &field)
 Constructor for INT property.
 xsProperty (int *src, const wxString &field, int def)
 Constructor for INT property with defined default value.
 xsProperty (double *src, const wxString &field)
 Constructor for DOUBLE property.
 xsProperty (double *src, const wxString &field, double def)
 Constructor for DOUBLE property with defined default value.
 xsProperty (float *src, const wxString &field)
 Constructor for FLOAT property.
 xsProperty (float *src, const wxString &field, float def)
 Constructor for FLOAT property with defined default value.
 xsProperty (wxString *src, const wxString &field)
 Constructor for wxString property.
 xsProperty (wxString *src, const wxString &field, const wxString &def)
 Constructor for wxString property with defined default value.
 xsProperty (wxChar *src, const wxString &field)
 Constructor for wxChar property.
 xsProperty (wxChar *src, const wxString &field, wxChar def)
 Constructor for wxChar property with defined default value.
 xsProperty (wxPoint *src, const wxString &field)
 Constructor for wxPoint property.
 xsProperty (wxPoint *src, const wxString &field, const wxPoint &def)
 Constructor for wxPoint property with defined default value.
 xsProperty (wxRealPoint *src, const wxString &field)
 Constructor for wxRealPoint property.
 xsProperty (wxRealPoint *src, const wxString &field, const wxRealPoint &def)
 Constructor for wxRealPoint property with defined default value.
 xsProperty (wxSize *src, const wxString &field)
 Constructor for wxSize property.
 xsProperty (wxSize *src, const wxString &field, const wxSize &def)
 Constructor for wxSize property with defined default value.
 xsProperty (wxBrush *src, const wxString &field)
 Constructor for wxBrush property.
 xsProperty (wxBrush *src, const wxString &field, const wxBrush &def)
 Constructor for wxBrush property with defined default value.
 xsProperty (wxPen *src, const wxString &field)
 Constructor for wxPen property.
 xsProperty (wxPen *src, const wxString &field, const wxPen &def)
 Constructor for wxPen property with defined default value.
 xsProperty (wxFont *src, const wxString &field)
 Constructor for wxFont property.
 xsProperty (wxFont *src, const wxString &field, const wxFont &def)
 Constructor for wxFont property with defined default value.
 xsProperty (wxColour *src, const wxString &field)
 Constructor for wxColour property.
 xsProperty (wxColour *src, const wxString &field, const wxColour &def)
 Constructor for wxColour property with defined default value.
 xsProperty (wxArrayString *src, const wxString &field)
 Constructor for wxArrayString property.
 xsProperty (CharArray *src, const wxString &field)
 Constructor for CharArray property.
 xsProperty (IntArray *src, const wxString &field)
 Constructor for IntArray property.
 xsProperty (LongArray *src, const wxString &field)
 Constructor for LongArray property.
 xsProperty (DoubleArray *src, const wxString &field)
 Constructor for DoubleArray property.
 xsProperty (RealPointArray *src, const wxString &field)
 Constructor for RealPointArray property.
 xsProperty (RealPointList *src, const wxString &field)
 Constructor for RealPointList property.
 xsProperty (StringMap *src, const wxString &field)
 Constructor for StringMap property.
 xsProperty (xsSerializable *src, const wxString &field)
 Constructor for static serializable property.
 xsProperty (xsSerializable **src, const wxString &field)
 Constructor for dynamic serializable property.
 xsProperty (const xsProperty &obj)
 Copy constructor.
 ~xsProperty ()
wxString ToString ()
 Get textual representation of the property's value.
void FromString (const wxString &val)
 Set value defined by its textual representation.
bool & AsBool ()
 Get reference to managed data member as BOOL.
int & AsInt ()
 Get reference to managed data member as INT.
long & AsLong ()
 Get reference to managed data member as LONG.
float & AsFloat ()
 Get reference to managed data member as FLOAT.
double & AsDouble ()
 Get reference to managed data member as DOUBLE.
wxChar & AsChar ()
 Get reference to managed data member as wxChar.
wxString & AsString ()
 Get reference to managed data member as wxString.
wxSize & AsSize ()
 Get reference to managed data member as wxSize.
wxPoint & AsPoint ()
 Get reference to managed data member as wxPoint.
wxRealPoint & AsRealPoint ()
 Get reference to managed data member as wxRealPoint.
wxBrush & AsBrush ()
 Get reference to managed data member as wxBrush.
wxPen & AsPen ()
 Get reference to managed data member as wxPen.
wxFont & AsFont ()
 Get reference to managed data member as wxFont.
wxColour & AsColour ()
 Get reference to managed data member as wxColour.
wxArrayString & AsStringArray ()
 Get reference to managed data member as wxArrayString.
CharArray & AsCharArray ()
 Get reference to managed data member as CharArray.
IntArray & AsIntArray ()
 Get reference to managed data member as IntArray.
LongArray & AsLongArray ()
 Get reference to managed data member as LongArray.
DoubleArray & AsDoubleArray ()
 Get reference to managed data member as DoubleArray.
RealPointArray & AsRealPointArray ()
 Get reference to managed data member as RealPointArray.
RealPointList & AsRealPointList ()
 Get reference to managed data member as RealPointList.
StringMap & AsStringMap ()
 Get reference to managed data member as StringMap.
xsSerializableAsSerializableStatic ()
 Get reference to managed data member as serializable static object.
xsSerializableAsSerializableDynamic ()
 Get reference to managed data member as serializable dynamic object.

Public Attributes

void * m_pSourceVariable
 General (void) pointer to serialized object encapsulated by the property.
wxString m_sFieldName
 Field (property) name.
wxString m_sDataType
 Data type.
wxString m_sDefaultValueStr
 String representation of property's default value.
bool m_fSerialize
 Flag used for enabling/disabling of property serialization.

Detailed Description

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.

Allowed property data types (keywords) are: 'long', 'double', 'bool', 'string', 'point', 'size', 'realpoint', 'colour', 'brush', 'pen', 'font', 'arraystring', 'arrayrealpoint', 'listrealpoint', 'serializabledynamic' and 'serializablestatic'. Only properties of these data types are recognized and processed by parent serializable object.


Constructor & Destructor Documentation

xsProperty::xsProperty (  )  [inline]

Default constructor.

xsProperty::xsProperty ( void *  src,
const wxString &  type,
const wxString &  field,
const wxString &  def = wxT("") 
) [inline]

Constructor.

Parameters:
src Pointer to serialized object
type String value describing data type of serialized object
field Property name used in XML files and for property handling
def String representation of default poperty value
xsProperty::xsProperty ( bool *  src,
const wxString &  field 
) [inline]

Constructor for BOOL property.

xsProperty::xsProperty ( bool *  src,
const wxString &  field,
bool  def 
) [inline]

Constructor for BOOL property with defined default value.

xsProperty::xsProperty ( long *  src,
const wxString &  field 
) [inline]

Constructor for LONG property.

xsProperty::xsProperty ( long *  src,
const wxString &  field,
long  def 
) [inline]

Constructor for LONG property with defined default value.

xsProperty::xsProperty ( int *  src,
const wxString &  field 
) [inline]

Constructor for INT property.

xsProperty::xsProperty ( int *  src,
const wxString &  field,
int  def 
) [inline]

Constructor for INT property with defined default value.

xsProperty::xsProperty ( double *  src,
const wxString &  field 
) [inline]

Constructor for DOUBLE property.

xsProperty::xsProperty ( double *  src,
const wxString &  field,
double  def 
) [inline]

Constructor for DOUBLE property with defined default value.

xsProperty::xsProperty ( float *  src,
const wxString &  field 
) [inline]

Constructor for FLOAT property.

xsProperty::xsProperty ( float *  src,
const wxString &  field,
float  def 
) [inline]

Constructor for FLOAT property with defined default value.

xsProperty::xsProperty ( wxString *  src,
const wxString &  field 
) [inline]

Constructor for wxString property.

xsProperty::xsProperty ( wxString *  src,
const wxString &  field,
const wxString &  def 
) [inline]

Constructor for wxString property with defined default value.

xsProperty::xsProperty ( wxChar *  src,
const wxString &  field 
) [inline]

Constructor for wxChar property.

xsProperty::xsProperty ( wxChar *  src,
const wxString &  field,
wxChar  def 
) [inline]

Constructor for wxChar property with defined default value.

xsProperty::xsProperty ( wxPoint *  src,
const wxString &  field 
) [inline]

Constructor for wxPoint property.

xsProperty::xsProperty ( wxPoint *  src,
const wxString &  field,
const wxPoint &  def 
) [inline]

Constructor for wxPoint property with defined default value.

xsProperty::xsProperty ( wxRealPoint *  src,
const wxString &  field 
) [inline]

Constructor for wxRealPoint property.

xsProperty::xsProperty ( wxRealPoint *  src,
const wxString &  field,
const wxRealPoint &  def 
) [inline]

Constructor for wxRealPoint property with defined default value.

xsProperty::xsProperty ( wxSize *  src,
const wxString &  field 
) [inline]

Constructor for wxSize property.

xsProperty::xsProperty ( wxSize *  src,
const wxString &  field,
const wxSize &  def 
) [inline]

Constructor for wxSize property with defined default value.

xsProperty::xsProperty ( wxBrush *  src,
const wxString &  field 
) [inline]

Constructor for wxBrush property.

xsProperty::xsProperty ( wxBrush *  src,
const wxString &  field,
const wxBrush &  def 
) [inline]

Constructor for wxBrush property with defined default value.

xsProperty::xsProperty ( wxPen *  src,
const wxString &  field 
) [inline]

Constructor for wxPen property.

xsProperty::xsProperty ( wxPen *  src,
const wxString &  field,
const wxPen &  def 
) [inline]

Constructor for wxPen property with defined default value.

xsProperty::xsProperty ( wxFont *  src,
const wxString &  field 
) [inline]

Constructor for wxFont property.

xsProperty::xsProperty ( wxFont *  src,
const wxString &  field,
const wxFont &  def 
) [inline]

Constructor for wxFont property with defined default value.

xsProperty::xsProperty ( wxColour *  src,
const wxString &  field 
) [inline]

Constructor for wxColour property.

xsProperty::xsProperty ( wxColour *  src,
const wxString &  field,
const wxColour &  def 
) [inline]

Constructor for wxColour property with defined default value.

xsProperty::xsProperty ( wxArrayString *  src,
const wxString &  field 
) [inline]

Constructor for wxArrayString property.

xsProperty::xsProperty ( CharArray *  src,
const wxString &  field 
) [inline]

Constructor for CharArray property.

xsProperty::xsProperty ( IntArray *  src,
const wxString &  field 
) [inline]

Constructor for IntArray property.

xsProperty::xsProperty ( LongArray *  src,
const wxString &  field 
) [inline]

Constructor for LongArray property.

xsProperty::xsProperty ( DoubleArray *  src,
const wxString &  field 
) [inline]

Constructor for DoubleArray property.

xsProperty::xsProperty ( RealPointArray *  src,
const wxString &  field 
) [inline]

Constructor for RealPointArray property.

xsProperty::xsProperty ( RealPointList *  src,
const wxString &  field 
) [inline]

Constructor for RealPointList property.

xsProperty::xsProperty ( StringMap *  src,
const wxString &  field 
) [inline]

Constructor for StringMap property.

xsProperty::xsProperty ( xsSerializable src,
const wxString &  field 
) [inline]

Constructor for static serializable property.

xsProperty::xsProperty ( xsSerializable **  src,
const wxString &  field 
) [inline]

Constructor for dynamic serializable property.

xsProperty::xsProperty ( const xsProperty obj  )  [inline]

Copy constructor.

xsProperty::~xsProperty (  )  [inline]

Member Function Documentation

bool& xsProperty::AsBool (  )  [inline]

Get reference to managed data member as BOOL.

Returns:
Reference to managed data member
wxBrush& xsProperty::AsBrush (  )  [inline]

Get reference to managed data member as wxBrush.

Returns:
Reference to managed data member
wxChar& xsProperty::AsChar (  )  [inline]

Get reference to managed data member as wxChar.

Returns:
Reference to managed data member
CharArray& xsProperty::AsCharArray (  )  [inline]

Get reference to managed data member as CharArray.

Returns:
Reference to managed data member
wxColour& xsProperty::AsColour (  )  [inline]

Get reference to managed data member as wxColour.

Returns:
Reference to managed data member
double& xsProperty::AsDouble (  )  [inline]

Get reference to managed data member as DOUBLE.

Returns:
Reference to managed data member
DoubleArray& xsProperty::AsDoubleArray (  )  [inline]

Get reference to managed data member as DoubleArray.

Returns:
Reference to managed data member
float& xsProperty::AsFloat (  )  [inline]

Get reference to managed data member as FLOAT.

Returns:
Reference to managed data member
wxFont& xsProperty::AsFont (  )  [inline]

Get reference to managed data member as wxFont.

Returns:
Reference to managed data member
int& xsProperty::AsInt (  )  [inline]

Get reference to managed data member as INT.

Returns:
Reference to managed data member
IntArray& xsProperty::AsIntArray (  )  [inline]

Get reference to managed data member as IntArray.

Returns:
Reference to managed data member
long& xsProperty::AsLong (  )  [inline]

Get reference to managed data member as LONG.

Returns:
Reference to managed data member
LongArray& xsProperty::AsLongArray (  )  [inline]

Get reference to managed data member as LongArray.

Returns:
Reference to managed data member
wxPen& xsProperty::AsPen (  )  [inline]

Get reference to managed data member as wxPen.

Returns:
Reference to managed data member
wxPoint& xsProperty::AsPoint (  )  [inline]

Get reference to managed data member as wxPoint.

Returns:
Reference to managed data member
wxRealPoint& xsProperty::AsRealPoint (  )  [inline]

Get reference to managed data member as wxRealPoint.

Returns:
Reference to managed data member
RealPointArray& xsProperty::AsRealPointArray (  )  [inline]

Get reference to managed data member as RealPointArray.

Returns:
Reference to managed data member
RealPointList& xsProperty::AsRealPointList (  )  [inline]

Get reference to managed data member as RealPointList.

Returns:
Reference to managed data member
xsSerializable& xsProperty::AsSerializableDynamic (  )  [inline]

Get reference to managed data member as serializable dynamic object.

Returns:
Reference to managed data member
xsSerializable& xsProperty::AsSerializableStatic (  )  [inline]

Get reference to managed data member as serializable static object.

Returns:
Reference to managed data member
wxSize& xsProperty::AsSize (  )  [inline]

Get reference to managed data member as wxSize.

Returns:
Reference to managed data member
wxString& xsProperty::AsString (  )  [inline]

Get reference to managed data member as wxString.

Returns:
Reference to managed data member
wxArrayString& xsProperty::AsStringArray (  )  [inline]

Get reference to managed data member as wxArrayString.

Returns:
Reference to managed data member
StringMap& xsProperty::AsStringMap (  )  [inline]

Get reference to managed data member as StringMap.

Returns:
Reference to managed data member
xsProperty::DECLARE_DYNAMIC_CLASS ( xsProperty   ) 
void xsProperty::FromString ( const wxString &  val  )  [inline]

Set value defined by its textual representation.

Parameters:
val Textual representation of given value
wxString xsProperty::ToString (  )  [inline]

Get textual representation of the property's value.

Returns:
Textual representation of current value

Member Data Documentation

Flag used for enabling/disabling of property serialization.

General (void) pointer to serialized object encapsulated by the property.

Data type.

String representation of property's default value.

Field (property) name.


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.3