GLIMSView Source Code Documentation

XMLSerializeable Class Reference

#include <xmlserializeable.h>

Inheritance diagram for XMLSerializeable:

Inheritance graph
[legend]

List of all members.


Detailed Description

A very used class within GLIMSView that provides functions for an object to serialize and deserialize itself easily and efficiently using the XML constructs within QT.

A class that extends this must implement the abastract methods that handle I/O.

History:
dls Added date and time functions
History:
dls Added versioning functions
History:
dls 2008-05-26 Removed mID and mBaseName and related functions - unused

Definition at line 26 of file xmlserializeable.h.


Public Member Functions

virtual ~XMLSerializeable ()
virtual bool toXML (QDomDocument &doc, QDomElement &elem, std::string id="")=0
virtual bool toXMLFile (std::string fname, std::string docname)
virtual bool fromXML (QDomElement &elem)=0
virtual bool fromXMLFile (std::string fname, std::string docname)
virtual void setCurrentVersion (std::string versionString)
virtual void setCurrentVersion (QDate versionQDate)
virtual QDate getCurrentVersion ()
virtual std::string getCurrentVersionStr ()

Protected Member Functions

virtual bool writeTextTag (QDomDocument &doc, QDomElement &elem, std::string tagName, std::string text, std::string id="")
virtual bool writeIntTag (QDomDocument &doc, QDomElement &elem, std::string tagName, int val, std::string id="")
virtual bool writeDoubleTag (QDomDocument &doc, QDomElement &elem, std::string tagName, double val, std::string id="")
virtual std::string readTextTag (QDomElement elem, std::string tagName="", std::string id="")
virtual int readIntTag (QDomElement elem, std::string tagName="", std::string id="")
virtual double readDoubleTag (QDomElement elem, std::string tagName="", std::string id="")
virtual QDomElement createBaseTag (QDomDocument &doc, QDomElement &elem, std::string id, std::string tagName)
virtual QDomElement getElemByTagName (QDomElement &elem, std::string name)
virtual std::string qDateToString (const QDate *aQDate)
virtual bool stringToQDate (const std::string aStrDate, QDate *aQDate)
virtual std::string qDateTimeToString (const QDateTime *aQDateTime)
virtual bool stringToQDateTime (const std::string aStrDateTime, QDateTime *aQDateTime)

Protected Attributes

QDate mCurrentVersion

Constructor & Destructor Documentation

virtual XMLSerializeable::~XMLSerializeable (  )  [inline, virtual]

Definition at line 104 of file xmlserializeable.h.


Member Function Documentation

bool XMLSerializeable::writeTextTag ( QDomDocument &  doc,
QDomElement &  elem,
std::string  tagName,
std::string  text,
std::string  id = "" 
) [protected, virtual]

virtual bool XMLSerializeable::writeIntTag ( QDomDocument &  doc,
QDomElement &  elem,
std::string  tagName,
int  val,
std::string  id = "" 
) [inline, protected, virtual]

virtual bool XMLSerializeable::writeDoubleTag ( QDomDocument &  doc,
QDomElement &  elem,
std::string  tagName,
double  val,
std::string  id = "" 
) [inline, protected, virtual]

std::string XMLSerializeable::readTextTag ( QDomElement  elem,
std::string  tagName = "",
std::string  id = "" 
) [protected, virtual]

virtual int XMLSerializeable::readIntTag ( QDomElement  elem,
std::string  tagName = "",
std::string  id = "" 
) [inline, protected, virtual]

virtual double XMLSerializeable::readDoubleTag ( QDomElement  elem,
std::string  tagName = "",
std::string  id = "" 
) [inline, protected, virtual]

virtual QDomElement XMLSerializeable::createBaseTag ( QDomDocument &  doc,
QDomElement &  elem,
std::string  id,
std::string  tagName 
) [inline, protected, virtual]

QDomElement XMLSerializeable::getElemByTagName ( QDomElement &  elem,
std::string  name 
) [protected, virtual]

Definition at line 119 of file xmlserializeable.cpp.

Referenced by GlacierIDDef::fromXML().

std::string XMLSerializeable::qDateToString ( const QDate *  aQDate  )  [protected, virtual]

Definition at line 135 of file xmlserializeable.cpp.

Referenced by getCurrentVersionStr(), qDateTimeToString(), and toXMLFile().

bool XMLSerializeable::stringToQDate ( const std::string  aStrDate,
QDate *  aQDate 
) [protected, virtual]

std::string XMLSerializeable::qDateTimeToString ( const QDateTime *  aQDateTime  )  [protected, virtual]

Definition at line 149 of file xmlserializeable.cpp.

References qDateToString().

Here is the call graph for this function:

bool XMLSerializeable::stringToQDateTime ( const std::string  aStrDateTime,
QDateTime *  aQDateTime 
) [protected, virtual]

Definition at line 205 of file xmlserializeable.cpp.

References stringToQDate().

Here is the call graph for this function:

virtual bool XMLSerializeable::toXML ( QDomDocument &  doc,
QDomElement &  elem,
std::string  id = "" 
) [pure virtual]

bool XMLSerializeable::toXMLFile ( std::string  fname,
std::string  docname 
) [virtual]

virtual bool XMLSerializeable::fromXML ( QDomElement &  elem  )  [pure virtual]

bool XMLSerializeable::fromXMLFile ( std::string  fname,
std::string  docname 
) [virtual]

void XMLSerializeable::setCurrentVersion ( std::string  versionString  )  [virtual]

Definition at line 249 of file xmlserializeable.cpp.

References mCurrentVersion, and stringToQDate().

Referenced by MainToolbar::setupProj().

Here is the call graph for this function:

void XMLSerializeable::setCurrentVersion ( QDate  versionQDate  )  [virtual]

Definition at line 254 of file xmlserializeable.cpp.

References mCurrentVersion.

QDate XMLSerializeable::getCurrentVersion (  )  [virtual]

Definition at line 258 of file xmlserializeable.cpp.

References mCurrentVersion.

std::string XMLSerializeable::getCurrentVersionStr (  )  [virtual]

Definition at line 262 of file xmlserializeable.cpp.

References mCurrentVersion, and qDateToString().

Here is the call graph for this function:


Member Data Documentation


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

Home | Search | Disclaimers & Privacy | Contact Us
GLIMSView Maintainer: dsoltesz@usgs.gov