xsPropertyIO Class Reference
Base class encapsulating a property I/O handler. The class is used by the xsSerializable class and is responsiblefor reading and writing of an XML node containing property information. Each supported property (data) type should have its own I/O handler class. Moreover, all derived classes must provide public functions 'static wxString classname::ToString(datatype value)' and 'static datatype classname:: FromString( const wxString& value )' responsible for conversion between datatype and and its string representation (these functions are used internally by class virtual functions.
More...
#include <PropertyIO.h>
List of all members.
Public Member Functions |
| DECLARE_DYNAMIC_CLASS (xsProperty) |
| xsPropertyIO () |
| Constructor.
|
virtual | ~xsPropertyIO () |
| Destructor.
|
virtual void | Read (xsProperty *property, wxXmlNode *source) |
| Read content of the property XML node and store it to given property object.
|
virtual void | Write (xsProperty *property, wxXmlNode *target) |
| Write content of given property object to target XML node.
|
virtual wxString | GetValueStr (xsProperty *property) |
| Get textual representation of current property value.
|
virtual void | SetValueStr (xsProperty *property, const wxString &valstr) |
| Set value defined by its textual representation to given property.
|
Static Public Member Functions |
static wxXmlNode * | AddPropertyNode (wxXmlNode *parent, const wxString &name, const wxString &value, wxXmlNodeType type=wxXML_TEXT_NODE) |
| Create new XML node of given name and value and assign it to the given parent XML node.
|
Protected Member Functions |
void | AppendPropertyType (xsProperty *source, wxXmlNode *target) |
| Append info about the source property to given XML node.
|
Detailed Description
Base class encapsulating a property I/O handler. The class is used by the xsSerializable class and is responsiblefor reading and writing of an XML node containing property information. Each supported property (data) type should have its own I/O handler class. Moreover, all derived classes must provide public functions 'static wxString classname::ToString(datatype value)' and 'static datatype classname:: FromString( const wxString& value )' responsible for conversion between datatype and and its string representation (these functions are used internally by class virtual functions.
Constructor & Destructor Documentation
xsPropertyIO::xsPropertyIO |
( |
|
) |
[inline] |
virtual xsPropertyIO::~xsPropertyIO |
( |
|
) |
[inline, virtual] |
Member Function Documentation
static wxXmlNode* xsPropertyIO::AddPropertyNode |
( |
wxXmlNode * |
parent, |
|
|
const wxString & |
name, |
|
|
const wxString & |
value, |
|
|
wxXmlNodeType |
type = wxXML_TEXT_NODE | |
|
) |
| | [static] |
Create new XML node of given name and value and assign it to the given parent XML node.
- Parameters:
-
| parent | Pointer to parent XML node |
| name | Name of new XML node |
| value | Content of new XML node |
| type | Type of new XML (content) node |
void xsPropertyIO::AppendPropertyType |
( |
xsProperty * |
source, |
|
|
wxXmlNode * |
target | |
|
) |
| | [protected] |
Append info about the source property to given XML node.
- Parameters:
-
| source | Pointer to the source property |
| target | Pointer to modified XML node |
xsPropertyIO::DECLARE_DYNAMIC_CLASS |
( |
xsProperty |
|
) |
|
virtual wxString xsPropertyIO::GetValueStr |
( |
xsProperty * |
property |
) |
[inline, virtual] |
Get textual representation of current property value.
- Parameters:
-
| property | Pointer to the source property object |
- Returns:
- Textual representation of property's value
virtual void xsPropertyIO::Read |
( |
xsProperty * |
property, |
|
|
wxXmlNode * |
source | |
|
) |
| | [inline, virtual] |
Read content of the property XML node and store it to given property object.
- Parameters:
-
| property | Pointer to the target property object |
| source | Pointer to the source XML node |
virtual void xsPropertyIO::SetValueStr |
( |
xsProperty * |
property, |
|
|
const wxString & |
valstr | |
|
) |
| | [inline, virtual] |
Set value defined by its textual representation to given property.
- Parameters:
-
| property | Pointer to the target property object |
| valstr | Textual representation of given value |
virtual void xsPropertyIO::Write |
( |
xsProperty * |
property, |
|
|
wxXmlNode * |
target | |
|
) |
| | [inline, virtual] |
Write content of given property object to target XML node.
- Parameters:
-
| property | Pointer to the source property object |
| target | Pointer to the target XML node |
The documentation for this class was generated from the following file: