|
CLASS moPropIO_XML
NAME
Contructor - initialize the moPropIO_XML object
GetClassName - get the name of this class as a string
VERSION
Version: 1.2.0
SYNOPSIS
moPropIO_XML(void);
virtual const char *GetClassName(void) const;
DESCRIPTION
The constructor initialize an moPropIO_XML.
It will force the binary mode to UUENCODE by default. You
can change this by calling the BinaryMode() function.
The GetClassName() function returns the name of this class.
RETURN VALUE
The GetClassName() function returns a string with the
name of this class.
SEE ALSO
InternalLoad, InternalSave, BinaryMode
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moPropIO_XML
NAME
BinaryMode - set the mode to use to save binary data
VERSION
Version: 1.2.0
SYNOPSIS
void BinaryMode(binary_mode_t mode);
PARAMETERS
mode - the binary mode to be used
MO_XML_BINARY_MODE_UUENCODE
MO_XML_BINARY_MODE_HEX
MO_XML_BINARY_MODE_COMPACT
DESCRIPTION
This function sets the mode to be used to save the binary
data. This is saved in the binary tags as mode="<name>".
The valid modes are "uuencode" (compatible with the tool
of the same name), "hex" (pairs of hexadecimal digits for
each byte), "compact" (using characters 21 to 255 except
38, 60, 62 and 127 to 160 inclusive).
SEE ALSO
InternalLoad, InternalSave
BUGS
The compact mode is not implemented yet. uuencoding will
be used instead for now.
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moPropIO_XML
NAME
private:
InternalLoad - loads an XML file and put it in a property set
VERSION
Version: 1.2.0
SYNOPSIS
virtual int InternalLoad(moPropBagRef& prop_bag);
PARAMETERS
prop_bag - the bag of properties to fill with input data
DESCRIPTION
The InternalLoad() function of the XML version of the
property bag I/O will load an XML file and transform it
in properties saved in the bag.
The DTD is described below in a string that the InternalSave()
defines. The format namespace is "propbag".
SEE ALSO
InternalSave
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moPropXML_IO
NAME
InternalSave - save a property bag to an XML file
VERSION
Version: 1.2.0
SYNOPSIS
private:
virtual int InternalSave(const moPropBagRef& prop_bag);
local:
int save_info_t::SaveBag(const moPropBagRef& prop_bag);
int save_info_t::SaveProp(const moPropRef& p);
PARAMETERS
prop_bag - the property bag to save in an XML file
out - the output stream
indent - the current indentation level (# of spaces to write)
p - the property to save in the output stream
DESCRIPTION
The InternalSave() function writes all the data of a
property bag to an XML file. It uses the SaveBag()
function to save bags of properties and SaveProp()
to save each individual property.
The SaveProp() will be called recursively to save all
the items of an array.
The SaveBag() is called recursively by the SaveProp()
function whenever it needs to save a property bag.
NOTES
At this time, there is no safe guard agains looping
property sets (i.e. a counter to know how many times
you have called SaveProp() recursively). It may be
added at a later time.
RETURN VALUE
This functions will return 0 when nothing goes wrong.
Otherwise they return -1. The error code can be retrieved
using the GetLastError() function.
SEE ALSO
InternalLoad
BUGS
While this function is running the stream filter will be
replaced with an internal filter to force the text to be
written in UTF-8 in the output file (which is what the DTD
defines). The original filter will be restore before the
function returns, however, the filter in effect when
calling the function will be ignored.
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moPropIO_XML
NAME
Helper functions:
moXMLLoadPropBag - loads an XML file and put it in a property bag
moXMLSavePropBag - saves a property bag to an XML file
VERSION
Version: 1.2.0
SYNOPSIS
extern int moXMLLoadPropBag(const moWCString& filename, moPropBagRef& prop_bag);
extern int moXMLSavePropBag(const moWCString& filename, moPropBagRef& prop_bag,
binary_mode_t binary_mode = MO_XML_BINARY_MODE_UUENCODE);
PARAMETERS
filename - the name of the XML file to use to load/save the property bag
prop_bag - the property bag used to load or save
binary_mode - the mode to use to save the binary content
DESCRIPTION
The moXMLLoadPropBag() loads a property bag from an XML file which name
you specify in the call. This function can be used to avoid having to
yourself create an moFile, attach it to an XML file and then call the
Load() function on the property bag I/O handler. The XML file is expected
to be a disk file at this time (until the moFile supports other protocols).
The moXMLSavePropBag() saves a property bag to an XML file which name
you specify in the call. This function can be used to avoid having to
yourself create an moFile, attach it to an XML file and then call the
Save() function on the property bag I/O handler. The XML file is expected
to end-up being a disk file at this time.
RETURN VALUE
All of these functions return 0 if no error occured while loading/saving
the property bag. They return -1 if an error occurs.
SEE ALSO
moPropIO, moPropIO_XML
BUGS
At this time you don't have access to the error code if the functions
fail. This may be fixed at a later date by adding a parameter to these
function calls.
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
Links:
molib
the sandbox
|