MeVisLabToolboxReference
ml::XMLPersistenceInputStream Class Reference

Implementation for AbstractPersistenceInputStream using Xerces DOM Parser. More...

#include <mlXMLPersistenceStream.h>

Inheritance diagram for ml::XMLPersistenceInputStream:
ml::AbstractPersistenceInputStream ml::XMLPersistenceStream ml::AbstractPersistenceStream

List of all members.

Public Member Functions

 XMLPersistenceInputStream ()
 this is the default constructor, use readFromFile or readFromString to fill the DOM
 XMLPersistenceInputStream (DOMElement *container)
 this constructor will read from the given XML element
virtual ~XMLPersistenceInputStream ()
 the destructor will free the DOM document if readFromFile or readFromString was used
virtual void readFromFile (const std::string &fileName)
 Read the complete tree from a file.
virtual void readFromString (const std::string &str)
 Read the complete tree from a string.

Static Public Member Functions

static void normalizeWindowsFileName (std::string &str)
 replace / with \ character
virtual bool isBinary () const
 overriden methods
virtual void readString (const char *name, std::string &value)
 Abstract reading method that needs to be implemented by derived classes.
virtual void readData (std::string &value, const char *name)
 Same as above for binary data (std::string misused as binary data container)
virtual void startListImpl (const char *name, const char *xmlItemName, bool xmlSuppressScope)
 Abstract methods called by above methods, need to be implemented in derived classes.
virtual void endListImpl ()
virtual void startStructImpl (const char *name)
virtual void endStructImpl ()
virtual bool hasNextInStructImpl (std::string &name)
 Check if an item with the given name comes next in the stream.
virtual bool hasNextListItemImpl ()
 Check if there is another item in the current list.
virtual bool getObjectID (int &id)
 Implementation of Base object persistence, get attribute of currently open struct.
virtual bool getObjectType (std::string &type)
 base type name
virtual bool getObjectVersion (int &version)
 persistence version
virtual void readValues (const char *name, size_t expected, std::vector< MLint32 > &values)
 Abstract reading methods that need to be implemented by derived classes.
virtual void readValues (const char *name, size_t expected, std::vector< MLuint32 > &values)
virtual void readValues (const char *name, size_t expected, std::vector< MLint64 > &values)
virtual void readValues (const char *name, size_t expected, std::vector< MLuint64 > &values)
virtual void readValues (const char *name, size_t expected, std::vector< MLfloat > &values)
virtual void readValues (const char *name, size_t expected, std::vector< MLdouble > &values)
void formatError (const std::string &msg)
 overload, improves message with current parsing location

Detailed Description

Implementation for AbstractPersistenceInputStream using Xerces DOM Parser.

Definition at line 130 of file mlXMLPersistenceStream.h.


Constructor & Destructor Documentation

ml::XMLPersistenceInputStream::XMLPersistenceInputStream ( )

this is the default constructor, use readFromFile or readFromString to fill the DOM

ml::XMLPersistenceInputStream::XMLPersistenceInputStream ( DOMElement *  container)

this constructor will read from the given XML element

virtual ml::XMLPersistenceInputStream::~XMLPersistenceInputStream ( ) [virtual]

the destructor will free the DOM document if readFromFile or readFromString was used


Member Function Documentation

virtual void ml::XMLPersistenceInputStream::endListImpl ( ) [protected, virtual]
virtual void ml::XMLPersistenceInputStream::endStructImpl ( ) [protected, virtual]
void ml::XMLPersistenceInputStream::formatError ( const std::string &  msg) [protected, virtual]

overload, improves message with current parsing location

Reimplemented from ml::AbstractPersistenceInputStream.

virtual bool ml::XMLPersistenceInputStream::getObjectID ( int &  id) [protected, virtual]

Implementation of Base object persistence, get attribute of currently open struct.

get unique id of object - currently unused

Implements ml::AbstractPersistenceInputStream.

virtual bool ml::XMLPersistenceInputStream::getObjectType ( std::string &  type) [protected, virtual]

base type name

Implements ml::AbstractPersistenceInputStream.

virtual bool ml::XMLPersistenceInputStream::getObjectVersion ( int &  version) [protected, virtual]

persistence version

Implements ml::AbstractPersistenceInputStream.

virtual bool ml::XMLPersistenceInputStream::hasNextInStructImpl ( std::string &  name) [protected, virtual]

Check if an item with the given name comes next in the stream.

The stream is guaranteed to be in a "struct" scope.

Implements ml::AbstractPersistenceInputStream.

virtual bool ml::XMLPersistenceInputStream::hasNextListItemImpl ( ) [protected, virtual]

Check if there is another item in the current list.

The stream is guaranteed to be in a "list" scope.

Implements ml::AbstractPersistenceInputStream.

virtual bool ml::XMLPersistenceInputStream::isBinary ( ) const [inline, virtual]

overriden methods

Implements ml::AbstractPersistenceStream.

Definition at line 153 of file mlXMLPersistenceStream.h.

static void ml::XMLPersistenceInputStream::normalizeWindowsFileName ( std::string &  str) [static]

replace / with \ character

virtual void ml::XMLPersistenceInputStream::readData ( std::string &  value,
const char *  name 
) [virtual]

Same as above for binary data (std::string misused as binary data container)

Implements ml::AbstractPersistenceInputStream.

virtual void ml::XMLPersistenceInputStream::readFromFile ( const std::string &  fileName) [virtual]

Read the complete tree from a file.

virtual void ml::XMLPersistenceInputStream::readFromString ( const std::string &  str) [virtual]

Read the complete tree from a string.

virtual void ml::XMLPersistenceInputStream::readString ( const char *  name,
std::string &  value 
) [virtual]

Abstract reading method that needs to be implemented by derived classes.

Implements ml::AbstractPersistenceInputStream.

virtual void ml::XMLPersistenceInputStream::readValues ( const char *  name,
size_t  expected,
std::vector< MLint64 > &  values 
) [protected, virtual]
virtual void ml::XMLPersistenceInputStream::readValues ( const char *  name,
size_t  expected,
std::vector< MLuint32 > &  values 
) [protected, virtual]
virtual void ml::XMLPersistenceInputStream::readValues ( const char *  name,
size_t  expected,
std::vector< MLuint64 > &  values 
) [protected, virtual]
virtual void ml::XMLPersistenceInputStream::readValues ( const char *  name,
size_t  expected,
std::vector< MLfloat > &  values 
) [protected, virtual]
virtual void ml::XMLPersistenceInputStream::readValues ( const char *  name,
size_t  expected,
std::vector< MLdouble > &  values 
) [protected, virtual]
virtual void ml::XMLPersistenceInputStream::readValues ( const char *  name,
size_t  expected,
std::vector< MLint32 > &  values 
) [protected, virtual]

Abstract reading methods that need to be implemented by derived classes.

If expected size is 0, the returned list may have any size, otherwise exactly that number of elements are returned (or an exception is thrown).

Implements ml::AbstractPersistenceInputStream.

virtual void ml::XMLPersistenceInputStream::startListImpl ( const char *  name,
const char *  xmlItemName,
bool  xmlSuppressScope 
) [protected, virtual]

Abstract methods called by above methods, need to be implemented in derived classes.

Implementors don't need to do error checking. xmlItemName and xmlSuppressScope only need to be regarded for XML format:

Implements ml::AbstractPersistenceStream.

virtual void ml::XMLPersistenceInputStream::startStructImpl ( const char *  name) [protected, virtual]

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