SERIALIZER Class Reference
Class for serializing object instances to file.
More...
#include <mi32/serializer.h>
List of all members.
Public Member Functions |
| | SERIALIZER () |
| virtual | ~SERIALIZER () |
| ERRVALUE | Append (const FILEPATH &filepath) |
| void | Close () |
| const FILEPATH & | GetFilePath () const |
| bool | GetIgnoreSkippable () const |
| const char * | GetItemName () const |
| bool | GetItemValue (double &value) const |
| const MIUNICODE * | GetItemValue () const |
| MISTRING & | GetLog () |
| const MISTRING & | GetLog () const |
| const MIUNICODE * | GetObjectName () const |
| void | GetScanListMissing (RVC::OBJITEMLIST &MissingList) |
| void | GetScanListUsed (RVC::OBJITEMLIST &UsedList) |
| UINT16 | GetVersion () const |
| bool | IsScanOnly () const |
| void | LogClear () |
| void | LogError (ERRVALUE err) |
| void | LogText (const MISTRING &text) |
| ERRVALUE | Make (const FILEPATH &filepath, int version=1) |
| ERRVALUE | Make (RVC::OBJECT &parent, RVC::OBJTYPE objtype, RVC::DESCRIPTOR &descriptor, const RVC::SERIALIZE::MAKEPARMS &makeparms) |
| ERRVALUE | Make (RVC::OBJITEM &objitem, const RVC::SERIALIZE::MAKEPARMS &makeparms) |
| ERRVALUE | Open (const FILEPATH &filepath) |
| ERRVALUE | Open (const RVC::OBJITEM &objitem) |
| ERRVALUE | PutBegin (const char *tagname, UINT16 version=0) |
| ERRVALUE | PutDouble (const char *tagname, double value) |
| ERRVALUE | PutEnd () |
| ERRVALUE | PutInt (const char *tagname, int value) |
| ERRVALUE | PutItem (const char *tagname, const SPATREF::COORDREFSYS &crs) |
| ERRVALUE | PutItem (const char *tagname, const OLDPROJPARM &oldprojparm) |
| ERRVALUE | PutItem (const char *tagname, const DOUBLE_RANGE &value) |
| ERRVALUE | PutItem (const char *tagname, const LRECT2D &rect) |
| ERRVALUE | PutItem (const char *tagname, const LPOINT2D &point2d) |
| ERRVALUE | PutItem (const char *tagname, const DRECT3D &rect) |
| ERRVALUE | PutItem (const char *tagname, const DRECT2D &rect) |
| ERRVALUE | PutItem (const char *tagname, const DPOINT3D &point3d) |
| ERRVALUE | PutItem (const char *tagname, const DPOINT2D &point2d) |
| ERRVALUE | PutItem (const char *tagname, const COLOR &color) |
| ERRVALUE | PutStr (const char *tagname, const MIUNICODE *str) |
| ERRVALUE | PutStrML (const char *tagname, const MIUNICODE *str) |
| ERRVALUE | PutUnsigned (const char *tagname, unsigned int value) |
| ERRVALUE | Read (OLDPROJPARM &oldprojparm) |
| ERRVALUE | Read (const char *tagname, const SERIALIZERITEM *itemdef, void *data) |
| ERRVALUE | Read (const SERIALIZERITEM *itemdef, void *data) |
| ERRVALUE | Read (const char *tagname, SERIALIZABLE &object) |
| ERRVALUE | Read (SERIALIZABLE &object) |
| ERRVALUE | Rewind () |
| void | SetIgnoreSkippable (bool IgnoreSkippable=true) |
| void | SetScanOnly (bool ScanOnly) |
| void | SetVersion (UINT16 Version) |
| ERRVALUE | SkipStruct () |
| ERRVALUE | StatusTextUpdate (const MISTRING &string) |
| ERRVALUE | Write (const SERIALIZABLE &object, const char *tagname=0) |
| ERRVALUE | Write (const char *tagname, const SERIALIZERITEM *itemdef, const void *data, UINT16 version=0) |
| ERRVALUE | Write (const SERIALIZERITEM *itemdef, const void *data) |
Detailed Description
Class for serializing object instances to file.
The SERIALIZER class provides methods to write object instances to a text file/object and read those instances back into memory later. The design allows for the object structure to change while maintaining compatibility with previously existing files.
Constructor & Destructor Documentation
| SERIALIZER::SERIALIZER |
( |
|
) |
|
| virtual SERIALIZER::~SERIALIZER |
( |
|
) |
[virtual] |
Member Function Documentation
Open text file containing serialization to append.
- Parameters:
-
| void SERIALIZER::Close |
( |
|
) |
|
Close the serializer, will be done in destructor.
| const FILEPATH& SERIALIZER::GetFilePath |
( |
|
) |
const [inline] |
Get path to serialization file.
| bool SERIALIZER::GetIgnoreSkippable |
( |
|
) |
const [inline] |
Determine if ignoring "skippable" items.
| const char* SERIALIZER::GetItemName |
( |
|
) |
const [inline] |
Get name of current item being read/written.
| bool SERIALIZER::GetItemValue |
( |
double & |
value |
) |
const |
Get value for current item as double.
- Returns:
- true if could convert, false if not
- Parameters:
-
| const MIUNICODE* SERIALIZER::GetItemValue |
( |
|
) |
const [inline] |
Get value for current item being read.
| MISTRING& SERIALIZER::GetLog |
( |
|
) |
[inline] |
| const MISTRING& SERIALIZER::GetLog |
( |
|
) |
const [inline] |
| const MIUNICODE* SERIALIZER::GetObjectName |
( |
|
) |
const [inline] |
Get name of object, will be blank if text file.
Get list of missing files/objects after scan, also clears the list.
Get list of "used" files/objects after scan, also clears the list.
| UINT16 SERIALIZER::GetVersion |
( |
|
) |
const [inline] |
Get current version setting.
| bool SERIALIZER::IsScanOnly |
( |
|
) |
const [inline] |
Check if scanning serialization only.
| void SERIALIZER::LogClear |
( |
|
) |
[inline] |
| void SERIALIZER::LogError |
( |
ERRVALUE |
err |
) |
|
Add error message to log.
Will insert newline before and after error text.
| void SERIALIZER::LogText |
( |
const MISTRING & |
text |
) |
[inline] |
Create text file to contain serialization.
- Parameters:
-
| filepath | Text file path |
| version | Version to write |
Create object to contain serialization using parent and descriptor.
- Parameters:
-
| parent | Parent object |
| objtype | Object type |
| descriptor | Descriptor for new object |
Create object to contain serialization using OBJITEM.
- Parameters:
-
| objitem | Object item reference passed/returned |
Open text file containing serialization to read.
- Parameters:
-
Open object containing serialization to read.
- Parameters:
-
| objitem | RVC object item reference |
| ERRVALUE SERIALIZER::PutBegin |
( |
const char * |
tagname, |
|
|
UINT16 |
version = 0 | |
|
) |
| | |
Write beginning tag for starting a component.
- Parameters:
-
| tagname | Tag name to write |
| version | Optional version |
| ERRVALUE SERIALIZER::PutDouble |
( |
const char * |
tagname, |
|
|
double |
value | |
|
) |
| | |
Write floating-point value.
- Parameters:
-
| tagname | Tag name |
| value | Value to write |
Write ending tag at end of a component.
| ERRVALUE SERIALIZER::PutInt |
( |
const char * |
tagname, |
|
|
int |
value | |
|
) |
| | |
Write integer value.
- Parameters:
-
| tagname | Tag name to write |
| value | Value to write |
Write OLDPROJPARM item.
- Parameters:
-
| tagname | Tag name to write |
| oldprojparm | Item value |
Write DOUBLE_RANGE item.
- Parameters:
-
| tagname | Tag name to write |
| value | Item value |
| ERRVALUE SERIALIZER::PutItem |
( |
const char * |
tagname, |
|
|
const LRECT2D & |
rect | |
|
) |
| | |
Write LRECT2D item.
- Parameters:
-
| tagname | Tag name to write |
| rect | Item value |
Write LPOINT2D item.
- Parameters:
-
| tagname | Tag name to write |
| point2d | Item value |
| ERRVALUE SERIALIZER::PutItem |
( |
const char * |
tagname, |
|
|
const DRECT3D & |
rect | |
|
) |
| | |
Write DRECT3D item.
- Parameters:
-
| tagname | Tag name to write |
| rect | Item value |
| ERRVALUE SERIALIZER::PutItem |
( |
const char * |
tagname, |
|
|
const DRECT2D & |
rect | |
|
) |
| | |
Write DRECT2D item.
- Parameters:
-
| tagname | Tag name to write |
| rect | Item value |
Write DPOINT3D item.
- Parameters:
-
| tagname | Tag name to write |
| point3d | Item value |
Write DPOINT2D item.
- Parameters:
-
| tagname | Tag name to write |
| point2d | Item value |
| ERRVALUE SERIALIZER::PutItem |
( |
const char * |
tagname, |
|
|
const COLOR & |
color | |
|
) |
| | |
Write COLOR item.
- Parameters:
-
| tagname | Tag name to write |
| color | Item value |
Write a single-line Unicode string.
- Parameters:
-
| tagname | Tag name to write |
| str | String |
Write a Multi-line Unicode String.
- Parameters:
-
| tagname | Tag name to write |
| str | String |
| ERRVALUE SERIALIZER::PutUnsigned |
( |
const char * |
tagname, |
|
|
unsigned int |
value | |
|
) |
| | |
Write unsigned integer value.
- Parameters:
-
| tagname | Tag name to write |
| value | Item value |
Read items from serialization.
- Parameters:
-
| tagname | Tag name to match |
| itemdef | Item definition array |
| data | Serialization data |
Read items from serialization.
- Parameters:
-
| itemdef | Item definition array |
| data | Serialization data |
Read SERIALIZABLE object.
- Parameters:
-
| tagname | Tag name to match |
| object | Object to read |
Rewind file to beginning.
| void SERIALIZER::SetIgnoreSkippable |
( |
bool |
IgnoreSkippable = true |
) |
[inline] |
Set whether to ignore "skippable" items.
- Parameters:
-
| IgnoreSkippable | Ignore skippable mode |
| void SERIALIZER::SetScanOnly |
( |
bool |
ScanOnly |
) |
[inline] |
Set scan-only mode.
- Parameters:
-
| void SERIALIZER::SetVersion |
( |
UINT16 |
Version |
) |
[inline] |
Set version (for overriding).
- Parameters:
-
Skip remainder of current structure (for use in item callback).
Update status text from Unicode string.
Write SERIALIZABLE object.
- Parameters:
-
| object | Object to write |
| tagname | Name to tag object with |
Write items to serialized output.
- Parameters:
-
| tagname | Name to tag object with |
| itemdef | Item definition array |
| data | Data to write |
| version | Version to set if top level object |
Write items without begin/end tags.
- Parameters:
-
| itemdef | Item definition array |
| data | Data to write |
The documentation for this class was generated from the following file: