13#ifndef ML_XMLPERSISTENCE_STREAM_H 
   14#define ML_XMLPERSISTENCE_STREAM_H 
   45        : itemName(anItemName), suppressScope(aSuppressScope) {}
 
 
 
 
   83    bool isBinary()
 const override { 
return false; }
 
   85    void writeString(
const char* name, 
const std::string& value) 
override;
 
   87    void writeData(
const void* data, 
size_t len, 
const char* name) 
override;
 
   90    void startListImpl(
const char* name, 
const char* xmlItemName, 
bool xmlSuppressScope) 
override;
 
  110    void _writeValuesT(
const char* name, 
const T* values, 
size_t n, 
bool fixedList);
 
  113    void _setAttribute(
const char* attrName, 
const char* value);
 
  114    void _setAttribute(
const char* attrName, 
int value);
 
  118    void _createScope(
const char* tagName);
 
  124    DOMElement* _rootNode;
 
  126    DOMElement* _currentNode;
 
 
  157    void readString(
const char* name, std::string& value) 
override;
 
  159    void readData(std::string& value, 
const char* name) 
override;
 
  162    void startListImpl(
const char* name, 
const char* xmlItemName, 
bool xmlSuppressScope) 
override;
 
  174    void readValues(
const char* name, 
size_t expected, std::vector<MLint32>&  values) 
override;
 
  175    void readValues(
const char* name, 
size_t expected, std::vector<MLuint32>& values) 
override;
 
  176    void readValues(
const char* name, 
size_t expected, std::vector<MLint64>&  values) 
override;
 
  177    void readValues(
const char* name, 
size_t expected, std::vector<MLuint64>& values) 
override;
 
  178    void readValues(
const char* name, 
size_t expected, std::vector<MLfloat>&  values) 
override;
 
  179    void readValues(
const char* name, 
size_t expected, std::vector<MLdouble>& values) 
override;
 
  188    void _readValuesT(
const char* name, 
size_t expected, std::vector<T>& values);
 
  191    bool _getAttribute(
const char* attrName, std::string& value);
 
  192    bool _getAttribute(
const char* attrName, 
int& value);
 
  195    bool _checkElement(
const char* name, 
bool throwError = 
true);
 
  198    void _toNextElement(
bool reset = 
false);
 
  201    void _enterScope(
const char* tagName);
 
  207    DOMElement* _rootNode;
 
  209    DOMElement* _currentNode;
 
  211    DOMElement* _nextNode;
 
 
Class for writing object data to a stream.
 
Implementation for AbstractPersistenceOutputStream using Xerces DOM Parser.
 
virtual void writeToFile(const std::string &fileName)
Writes the complete tree to a file.
 
XMLPersistenceOutputStream()
this constructor creates a new XML document that can be written afterwards with writeToFile or writeT...
 
void writeValues(const char *name, const MLuint32 *values, size_t n, bool fixedList) override
 
void writeData(const void *data, size_t len, const char *name) override
Writes binary data to stream.
 
void writeValues(const char *name, const MLdouble *values, size_t n, bool fixedList) override
 
void endStructImpl() override
 
void writeValues(const char *name, const MLint32 *values, size_t n, bool fixedList) override
Abstract writing methods that need to be implemented by derived classes.
 
void startStructImpl(const char *name) override
 
bool isBinary() const override
overridden methods
 
virtual void writeToString(std::string &str)
Writes the subtree rooted by this node to a string.
 
void writeString(const char *name, const std::string &value) override
Abstract writing method that needs to be implemented by derived classes.
 
XMLPersistenceOutputStream(DOMElement *container)
this constructor takes an existing XML element - everything will be written relative to this element
 
virtual ~XMLPersistenceOutputStream()
this will free the XML document if the first constructor was used
 
void startListImpl(const char *name, const char *xmlItemName, bool xmlSuppressScope) override
Abstract methods called by above methods, needs to be implemented in derived classes.
 
void setObjectID(int id) override
Implementation of Base object persistence, sets attribute on currently open struct Implementation hin...
 
void writeValues(const char *name, const MLfloat *values, size_t n, bool fixedList) override
 
void writeValues(const char *name, const MLint64 *values, size_t n, bool fixedList) override
 
void endListImpl() override
 
void setObjectVersion(int version) override
Sets persistence version.
 
void setObjectType(const char *type) override
Sets base type.
 
void writeValues(const char *name, const MLuint64 *values, size_t n, bool fixedList) override
 
mix-in class that manages a stack of names for list elements and if the parent scope of the list is s...
 
std::list< ListStackEntry > _listStack
 
UINT64 MLuint64
Introduce platform-independent 64-bit unsigned integer type.
 
INT64 MLint64
Include 64-bit integer support for Windows or Unix.
 
Implement the AbstractPersistence(Input/Output)Stream classes with XML backend.
 
ListStackEntry(const char *anItemName, bool aSuppressScope)