Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
BIAS::XMLBase Class Referenceabstract

Base class with interface for xml output. More...

#include <Base/Common/XMLBase.hh>

+ Inheritance diagram for BIAS::XMLBase:

Public Member Functions

xmlNodePtr XMLAdd (const xmlNodePtr Node, XMLIO &XMLObject) const
 call this to add the class to a node of a given xml tree More...
 
virtual int XMLGetClassName (std::string &TopLevelTag, double &Version) const =0
 derived classes must implement this, so that it returns the name of the class for the top level tag in the XML file More...
 
virtual int XMLIn (const xmlNodePtr Node, XMLIO &XMLObject)=0
 derived classes must implement this to read everything in Node into (*this). More...
 
virtual int XMLOut (const xmlNodePtr Node, XMLIO &XMLObject) const =0
 derived classes must implement this to write the code of (*this) into the XML tree. More...
 
int XMLRead (const std::string &Filename)
 derived classes must implement the function XMLIn which is called by this function XMLRead to read everything with name Filename into (*this). More...
 
int XMLReadFromString (const std::string &str)
 reconstruct xml tree from string More...
 
int XMLWrite (const std::string &Filename, int CompressionLevel=0, bool AutoAddCompressionSuffix=true, std::string encoding="UTF-8") const
 call this to add the class to a new xml tree and write it to the file Filename. More...
 
int XMLWriteToString (std::string &str, std::string encoding="UTF-8") const
 serialize xml tree to string More...
 
virtual ~XMLBase ()
 

Detailed Description

Base class with interface for xml output.

All classes with xml i/o support should be derived from this class. You can then call XMLWrite to write the object to an XML file or XMLAdd(n) to attach the object to a node n of a given xml structure. For this to work you must:

This class is empty if no XML2 support is available.

Author
koeser 08/2004
Examples:
ExampleXMLBase.cpp.

Definition at line 56 of file XMLBase.hh.

Constructor & Destructor Documentation

virtual BIAS::XMLBase::~XMLBase ( )
inlinevirtual

Definition at line 59 of file XMLBase.hh.

Member Function Documentation

xmlNodePtr XMLBase::XMLAdd ( const xmlNodePtr  Node,
XMLIO XMLObject 
) const

call this to add the class to a node of a given xml tree

Attention
interface changed 3/2008: return value now nodeptr of added node!

Definition at line 26 of file XMLBase.cpp.

References BIAS::XMLIO::addAttribute(), and BIAS::XMLIO::addChildNode().

virtual int BIAS::XMLBase::XMLGetClassName ( std::string &  TopLevelTag,
double &  Version 
) const
pure virtual
virtual int BIAS::XMLBase::XMLIn ( const xmlNodePtr  Node,
XMLIO XMLObject 
)
pure virtual
virtual int BIAS::XMLBase::XMLOut ( const xmlNodePtr  Node,
XMLIO XMLObject 
) const
pure virtual
int XMLBase::XMLRead ( const std::string &  Filename)
int XMLBase::XMLReadFromString ( const std::string &  str)

reconstruct xml tree from string

Author
evers
Examples:
ExampleProjection.cpp.

Definition at line 111 of file XMLBase.cpp.

References BIAS::XMLIO::clear(), BIAS::XMLIO::getAttributeValueDouble(), BIAS::XMLIO::getNodeName(), and BIAS::XMLIO::ReadFromString().

Referenced by BIAS::IOUtils::GetProjection().

int XMLBase::XMLWrite ( const std::string &  Filename,
int  CompressionLevel = 0,
bool  AutoAddCompressionSuffix = true,
std::string  encoding = "UTF-8" 
) const
int XMLBase::XMLWriteToString ( std::string &  str,
std::string  encoding = "UTF-8" 
) const

serialize xml tree to string

Author
evers
Examples:
ExampleProjection.cpp.

Definition at line 61 of file XMLBase.cpp.

References BIAS::XMLIO::addAttribute(), BIAS::XMLIO::clear(), BIAS::XMLIO::create(), BIAS::XMLIO::SetEncoding(), and BIAS::XMLIO::WriteToString().


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