- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Mers::Utils::Io::Xml::Dom::XMLSaveLoad Class Reference

`#include <XMLSaveLoad.h>`

List of all members.

## Public Member Functions
| XMLSaveLoad (XERCES_CPP_NAMESPACE::DOMDocument *document, Mers::Utils::Io::SaveLoad::ISaveLoad::eSaveOrLoad saveOrLoad, unsigned int version=ISaveLoad::kCurrentVersion)
XERCES_CPP_NAMESPACE::DOMDocument * | getDocument ()
virtual void | saveLoadComment (const char *message)
## Protected Member Functions
template<typename t_Basic>
void | saveLoadNode (const char *elementName, t_Basic &obj)
template<typename t_Integer>
void | saveLoadInteger (const char *attributeName, t_Integer &value)
template<typename t_Real>
void | saveLoadReal (const char *attributeName, t_Real &value)
void | saveLoadAttribute (const char *attributeName, bool &value)
void | saveLoadAttribute (const char *attributeName, Mers::Utils::Lang::String &value)
void | saveLoadAttribute (const char *attributeName, char *&value)
void | saveLoadAttribute (const char *attributeName, int &value)
void | saveLoadAttribute (const char *attributeName, unsigned int &value)
void | saveLoadAttribute (const char *attributeName, short &value)
void | saveLoadAttribute (const char *attributeName, unsigned short &value)
void | saveLoadAttribute (const char *attributeName, double &value)
void | doSaveLoad (const char *name, bool &inout_value)
virtual void | doSaveLoad (const char *name, Mers::Utils::Lang::String &inout_value)
virtual void | doSaveLoad (const char *name, char *&inout_value)
virtual void | doSaveLoad (const char *name, int &inout_value)
virtual void | doSaveLoad (const char *name, unsigned int &value)
virtual void | doSaveLoad (const char *name, short &value)
virtual void | doSaveLoad (const char *name, unsigned short &value)
virtual void | doSaveLoad (const char *name, double &value)
virtual Mers::Utils::Lang::String | pushContext (const char *name)
virtual void | popContext ()
Mers::Utils::Lang::String | pushContextNode (const char *name)
## Protected Attributes
XERCES_CPP_NAMESPACE::DOMDocument * | m_document
| The document that we're reading.
XERCES_CPP_NAMESPACE::DOMElement * | m_currentElement
| The current node being processed.
XERCES_CPP_NAMESPACE::DOMElement * | m_recentChild
| The most recently processed child.

## Detailed Description

This interface class captures the notion of saving and loading objects to an XML document for later retrieval.

Definition at line 31 of file XMLSaveLoad.h.

## Constructor & Destructor Documentation

Mers::Utils::Io::Xml::Dom::XMLSaveLoad::XMLSaveLoad | ( | XERCES_CPP_NAMESPACE::DOMDocument * | document,
|  | Mers::Utils::Io::SaveLoad::ISaveLoad::eSaveOrLoad | saveOrLoad,
|  | unsigned int | version = `ISaveLoad::kCurrentVersion` |
| ) |  |  |

Constructs this object to be either saving or loading data to the specified DOMDocument object.

Parameters:

  | document | The document either from which data is read or to which data is written. This document will be modified if necessary but will not be owned by this object.
  | saveOrLoad | kLoad if we're reading the DOM document and building data structures. kSave if we're saving the data structures to the DOM document.
  | version | The current version of the document. If saving, this version is written to the file. If loading, this version is read from the document and the parameter is ignored.

## Member Function Documentation

XERCES_CPP_NAMESPACE::DOMDocument* Mers::Utils::Io::Xml::Dom::XMLSaveLoad::getDocument | ( |  | ) | `[inline]`

Returns a handle to the document being read.

Definition at line 57 of file XMLSaveLoad.h.

References m_document.

void XMLSaveLoad::saveLoadComment | ( | const char * | message | ) | `[virtual]`

Save a comment. This is version independent (comments are always skipped when loading).

Definition at line 41 of file XMLSaveLoad.cpp.

References m_currentElement, and m_document.

template<typename t_Basic>

void XMLSaveLoad::saveLoadNode | ( | const char * | elementName,
|  | t_Basic & | obj |
| ) |  |  | `[protected]`

Save/load a basic type as a child node.

Definition at line 58 of file XMLSaveLoad.cpp.

References popContext(), pushContextNode(), and saveLoadAttribute().

Here is the call graph for this function:

template<typename t_Integer>

void XMLSaveLoad::saveLoadInteger | ( | const char * | attributeName,
|  | t_Integer & | value |
| ) |  |  | `[protected]`

Save/Load an basic integer type.

Definition at line 74 of file XMLSaveLoad.cpp.

References m_currentElement.

Referenced by saveLoadAttribute().

template<typename t_Real>

void XMLSaveLoad::saveLoadReal | ( | const char * | attributeName,
|  | t_Real & | value |
| ) |  |  | `[protected]`

Save/Load a floating point numeric type.

Definition at line 105 of file XMLSaveLoad.cpp.

References m_currentElement.

Referenced by saveLoadAttribute().

void XMLSaveLoad::saveLoadAttribute | ( | const char * | attributeName,
|  | bool & | value |
| ) |  |  | `[protected]`

Save/Load a Boolean Attribute.

Definition at line 138 of file XMLSaveLoad.cpp.

References m_currentElement.

Referenced by pushContext(), and saveLoadNode().

void XMLSaveLoad::saveLoadAttribute | ( | const char * | attributeName,
|  | Mers::Utils::Lang::String & | value |
| ) |  |  | `[protected]`

Save/Load a String Attribute.

Definition at line 173 of file XMLSaveLoad.cpp.

References m_currentElement.

void XMLSaveLoad::saveLoadAttribute | ( | const char * | attributeName,
|  | char *& | value |
| ) |  |  | `[protected]`

Save/Load a char * Attribute.

Definition at line 201 of file XMLSaveLoad.cpp.

References m_currentElement.

void XMLSaveLoad::saveLoadAttribute | ( | const char * | attributeName,
|  | int & | value |
| ) |  |  | `[protected]`

Save/Load an integer.

Definition at line 230 of file XMLSaveLoad.cpp.

References saveLoadInteger().

Here is the call graph for this function:

void XMLSaveLoad::saveLoadAttribute | ( | const char * | attributeName,
|  | unsigned int & | value |
| ) |  |  | `[protected]`

Save/Load an unsigned integer.

Definition at line 237 of file XMLSaveLoad.cpp.

References saveLoadInteger().

Here is the call graph for this function:

void XMLSaveLoad::saveLoadAttribute | ( | const char * | attributeName,
|  | short & | value |
| ) |  |  | `[protected]`

Save/Load a short.

Definition at line 245 of file XMLSaveLoad.cpp.

References saveLoadInteger().

Here is the call graph for this function:

void XMLSaveLoad::saveLoadAttribute | ( | const char * | attributeName,
|  | unsigned short & | value |
| ) |  |  | `[protected]`

Save/Load an unsigned short.

Definition at line 252 of file XMLSaveLoad.cpp.

References saveLoadInteger().

Here is the call graph for this function:

void XMLSaveLoad::saveLoadAttribute | ( | const char * | attributeName,
|  | double & | value |
| ) |  |  | `[protected]`

Save/Load a double.

Definition at line 260 of file XMLSaveLoad.cpp.

References saveLoadReal().

Here is the call graph for this function:

void XMLSaveLoad::doSaveLoad | ( | const char * | name,
|  | bool & | inout_value |
| ) |  |  | `[protected]`

Save/Load a Boolean value.

Definition at line 268 of file XMLSaveLoad.cpp.

void XMLSaveLoad::doSaveLoad | ( | const char * | name,
|  | Mers::Utils::Lang::String & | inout_value |
| ) |  |  | `[protected, virtual]`

Save/Load a String.

Definition at line 275 of file XMLSaveLoad.cpp.

void XMLSaveLoad::doSaveLoad | ( | const char * | name,
|  | char *& | inout_value |
| ) |  |  | `[protected, virtual]`

Save/Load a char *.

Definition at line 282 of file XMLSaveLoad.cpp.

void XMLSaveLoad::doSaveLoad | ( | const char * | name,
|  | int & | inout_value |
| ) |  |  | `[protected, virtual]`

Save/Load an integer.

Definition at line 289 of file XMLSaveLoad.cpp.

void XMLSaveLoad::doSaveLoad | ( | const char * | name,
|  | unsigned int & | value |
| ) |  |  | `[protected, virtual]`

Save/Load an unsigned integer.

Definition at line 296 of file XMLSaveLoad.cpp.

void XMLSaveLoad::doSaveLoad | ( | const char * | name,
|  | short & | value |
| ) |  |  | `[protected, virtual]`

Save/Load a short.

Definition at line 303 of file XMLSaveLoad.cpp.

void XMLSaveLoad::doSaveLoad | ( | const char * | name,
|  | unsigned short & | value |
| ) |  |  | `[protected, virtual]`

Save/Load an unsigned short.

Definition at line 310 of file XMLSaveLoad.cpp.

void XMLSaveLoad::doSaveLoad | ( | const char * | name,
|  | double & | value |
| ) |  |  | `[protected, virtual]`

Save/Load a double.

Definition at line 317 of file XMLSaveLoad.cpp.

String XMLSaveLoad::pushContext | ( | const char * | name | ) | `[protected, virtual]`

Pushes the current loading context for a later restore. The next set of saves/loads will occur in this new "child" context.

Parameters:

  | name | The name of the object context, if we're saving, or NULL if we're loading.

Returns:
  The name of current context. This can be name if we're saving, but must be read from the stream if we're loading.

Definition at line 324 of file XMLSaveLoad.cpp.

References pushContextNode(), and saveLoadAttribute().

Here is the call graph for this function:

void XMLSaveLoad::popContext | ( |  | ) | `[protected, virtual]`

Restores the previous context.

Definition at line 343 of file XMLSaveLoad.cpp.

References m_currentElement, and m_recentChild.

Referenced by saveLoadNode().

String XMLSaveLoad::pushContextNode | ( | const char * | name | ) | `[protected]`

Save/loads a named child. The child will become the current context, just like pushContext, except the name always specifies the name of the context.

Parameters:

  | name | The name of the context, if we're saving, or NULL if we're loading.

Returns:
  The name of current context. This can be name if we're saving, but must be read from the stream if we're loading.

Definition at line 358 of file XMLSaveLoad.cpp.

References m_currentElement, m_document, and m_recentChild.

Referenced by pushContext(), and saveLoadNode().

The documentation for this class was generated from the following files:

- /Users/fpy/titan-1-5-MBARI/Mers/Utils/Io/Xml/Dom/XMLSaveLoad.h
- /Users/fpy/titan-1-5-MBARI/Mers/Utils/Io/Xml/Dom/XMLSaveLoad.cpp