DomUtils Class Reference

#include <domutils.h>

List of all members.


Detailed Description

This is a utility class used to read and make nodes in a QDomDocument.

Constructor & destructor are declared private so this class remains a pure utility class. Only 2 functions are present, but each has a lot of overloads.

Note:
Should be changed to use 'pass by reference' instead of the current pointers (which aren't even declared const). This would clean up the code a lot.

Definition at line 37 of file domutils.h.

Static Public Member Functions

static void readNode (QDomNode *node, QString *value)
 Reads a string from a QDomNode.
static void readNode (QDomNode *node, QStringList *value)
 Reads a stringlist from a QDomNode.
static void readNode (QDomNode *node, unsigned int *value)
 Reads an unsigned int from a QDomNode.
static void readNode (QDomNode *node, int *value)
 Reads an int from a QDomNode.
static void readNode (QDomNode *node, float *value)
 Reads a float from a QDomNode.
static void readNode (QDomNode *node, double *value)
 Reads a float from a QDomNode.
static void readNode (QDomNode *node, bool *value)
 Reads a bool from a QDomNode.
static void readNode (QDomNode *node, std::vector< unsigned int > *values)
 Reads a vector<unsigned int> from a QDomNode.
static void readNode (QDomNode *node, std::vector< double > *values)
 Reads a vector<double> from a QDomNode.
static void readNode (QDomNode *node, std::vector< bool > *values)
 Reads a vector<bool> from a QDomNode.
static void readNode (QDomNode *node, QValueList< int > *values)
 Reads a QValueList<int> from a QDomNode.
static void makeNode (QDomElement *root, const QString nodeData, const QString dictRef=0, const QString attributeName=0, const QString attributeValue=0)
 Creates a QDomElement from a string with a dictRef attribute.
static void makeNode (QDomElement *root, const QStringList nodeData, const QString dictRef=0, const QString attributeName=0, const QString attributeValue=0)
 Creates a QDomElement from a stringlist.
static void makeNode (QDomElement *root, const unsigned int nodeData, const QString dictRef)
 Creates a QDomElement from an unsigned int.
static void makeNode (QDomElement *root, const int nodeData, const QString dictRef)
 Creates a QDomElement from an int.
static void makeNode (QDomElement *root, const float nodeData, const QString dictRef)
 Creates a QDomElement from a float.
static void makeNode (QDomElement *root, const bool nodeData, const QString dictRef)
 Creates a QDomElement from a bool.
static void makeNode (QDomElement *root, const std::vector< unsigned int > nodeData, const QString dictRef)
 Creates a QDomElement from a vector<unsigned int>.
static void makeNode (QDomElement *root, const std::vector< double > nodeData, const QString dictRef=QString::null, const QString attributeName=QString::null, const QString attributeValue=QString::null)
 Creates a QDomElement from a vector<double>.
static void makeNode (QDomElement *root, const std::vector< bool > nodeData, const QString dictRef)
 Creates a QDomElement from a vector<bool>.
static void makeNode (QDomElement *root, const QValueList< int > nodeData, const QString dictRef)
 Creates a QDomElement from a QValueList<int>.
static bool dictEntry (QDomNode &node, const QString value)
 Returns whether a QDomNode is a QDomElement with an attribute dictRef = "ns:prefix_value".

Static Public Attributes

static const QString uriDict10 = "http://brabosphere.sourceforge.net/dict/1.0"
static const QString uriNSCML = "http://www.xml-cml.org/schema"
static const QString uriNSDC = "http://www.dublincore.org/dict"
static const QString uriDictCMLM = "http://www.xml-cml.org/dict/cmlMeasured"
static const QString uriDictXSD = "http://www.w3.org/2001/XMLSchema"
static const QString uriDictAtomic = "http://www.xml-cml.org/units/atomic"
static const QString uriDictSI = "http://www.xml-cml.org/units/siUnits"
static const QString ns = "bs"
static const QString nsCMLM = "cmlm"
static const QString nsXSD = "xsd"
static const QString nsAtomic = "atomic"
static const QString nsSI = "siUnits"
static const QString nsDC = "dc"

Private Member Functions

 DomUtils ()
 The default constructor. Made private so no instantiation is possible.
 ~DomUtils ()
 The default destructor.


Constructor & Destructor Documentation

DomUtils::DomUtils  )  [private]
 

The default constructor. Made private so no instantiation is possible.

Definition at line 390 of file domutils.cpp.

DomUtils::~DomUtils  )  [private]
 

The default destructor.

Definition at line 396 of file domutils.cpp.


Member Function Documentation

void DomUtils::readNode QDomNode *  node,
QString *  value
[static]
 

Reads a string from a QDomNode.

Definition at line 50 of file domutils.cpp.

void DomUtils::readNode QDomNode *  node,
QStringList *  value
[static]
 

Reads a stringlist from a QDomNode.

Definition at line 57 of file domutils.cpp.

void DomUtils::readNode QDomNode *  node,
unsigned int *  value
[static]
 

Reads an unsigned int from a QDomNode.

Definition at line 68 of file domutils.cpp.

void DomUtils::readNode QDomNode *  node,
int *  value
[static]
 

Reads an int from a QDomNode.

Definition at line 77 of file domutils.cpp.

void DomUtils::readNode QDomNode *  node,
float *  value
[static]
 

Reads a float from a QDomNode.

Definition at line 86 of file domutils.cpp.

void DomUtils::readNode QDomNode *  node,
double *  value
[static]
 

Reads a float from a QDomNode.

Definition at line 95 of file domutils.cpp.

void DomUtils::readNode QDomNode *  node,
bool *  value
[static]
 

Reads a bool from a QDomNode.

Definition at line 104 of file domutils.cpp.

void DomUtils::readNode QDomNode *  node,
std::vector< unsigned int > *  values
[static]
 

Reads a vector<unsigned int> from a QDomNode.

Definition at line 113 of file domutils.cpp.

void DomUtils::readNode QDomNode *  node,
std::vector< double > *  values
[static]
 

Reads a vector<double> from a QDomNode.

Definition at line 129 of file domutils.cpp.

void DomUtils::readNode QDomNode *  node,
std::vector< bool > *  values
[static]
 

Reads a vector<bool> from a QDomNode.

Definition at line 145 of file domutils.cpp.

void DomUtils::readNode QDomNode *  node,
QValueList< int > *  values
[static]
 

Reads a QValueList<int> from a QDomNode.

Definition at line 161 of file domutils.cpp.

void DomUtils::makeNode QDomElement *  root,
const QString  nodeData,
const QString  dictRef = 0,
const QString  attributeName = 0,
const QString  attributeValue = 0
[static]
 

Creates a QDomElement from a string with a dictRef attribute.

One extra attribute can be specified.

Definition at line 177 of file domutils.cpp.

void DomUtils::makeNode QDomElement *  root,
const QStringList  nodeData,
const QString  dictRef = 0,
const QString  attributeName = 0,
const QString  attributeValue = 0
[static]
 

Creates a QDomElement from a stringlist.

Definition at line 196 of file domutils.cpp.

void DomUtils::makeNode QDomElement *  root,
const unsigned int  nodeData,
const QString  dictRef
[static]
 

Creates a QDomElement from an unsigned int.

Definition at line 218 of file domutils.cpp.

void DomUtils::makeNode QDomElement *  root,
const int  nodeData,
const QString  dictRef
[static]
 

Creates a QDomElement from an int.

Definition at line 233 of file domutils.cpp.

void DomUtils::makeNode QDomElement *  root,
const float  nodeData,
const QString  dictRef
[static]
 

Creates a QDomElement from a float.

Definition at line 248 of file domutils.cpp.

void DomUtils::makeNode QDomElement *  root,
const bool  nodeData,
const QString  dictRef
[static]
 

Creates a QDomElement from a bool.

Definition at line 263 of file domutils.cpp.

void DomUtils::makeNode QDomElement *  root,
const std::vector< unsigned int >  nodeData,
const QString  dictRef
[static]
 

Creates a QDomElement from a vector<unsigned int>.

Definition at line 283 of file domutils.cpp.

void DomUtils::makeNode QDomElement *  root,
const std::vector< double >  nodeData,
const QString  dictRef = QString::null,
const QString  attributeName = QString::null,
const QString  attributeValue = QString::null
[static]
 

Creates a QDomElement from a vector<double>.

Definition at line 306 of file domutils.cpp.

void DomUtils::makeNode QDomElement *  root,
const std::vector< bool >  nodeData,
const QString  dictRef
[static]
 

Creates a QDomElement from a vector<bool>.

Definition at line 332 of file domutils.cpp.

void DomUtils::makeNode QDomElement *  root,
const QValueList< int >  nodeData,
const QString  dictRef
[static]
 

Creates a QDomElement from a QValueList<int>.

Definition at line 356 of file domutils.cpp.

bool DomUtils::dictEntry QDomNode &  node,
const QString  value
[static]
 

Returns whether a QDomNode is a QDomElement with an attribute dictRef = "ns:prefix_value".

Definition at line 379 of file domutils.cpp.


Member Data Documentation

const QString DomUtils::uriDict10 = "http://brabosphere.sourceforge.net/dict/1.0" [static]
 

Definition at line 63 of file domutils.h.

const QString DomUtils::uriNSCML = "http://www.xml-cml.org/schema" [static]
 

Definition at line 64 of file domutils.h.

const QString DomUtils::uriNSDC = "http://www.dublincore.org/dict" [static]
 

Definition at line 65 of file domutils.h.

const QString DomUtils::uriDictCMLM = "http://www.xml-cml.org/dict/cmlMeasured" [static]
 

Definition at line 66 of file domutils.h.

const QString DomUtils::uriDictXSD = "http://www.w3.org/2001/XMLSchema" [static]
 

Definition at line 67 of file domutils.h.

const QString DomUtils::uriDictAtomic = "http://www.xml-cml.org/units/atomic" [static]
 

Definition at line 68 of file domutils.h.

const QString DomUtils::uriDictSI = "http://www.xml-cml.org/units/siUnits" [static]
 

Definition at line 69 of file domutils.h.

const QString DomUtils::ns = "bs" [static]
 

Definition at line 70 of file domutils.h.

const QString DomUtils::nsCMLM = "cmlm" [static]
 

Definition at line 71 of file domutils.h.

const QString DomUtils::nsXSD = "xsd" [static]
 

Definition at line 72 of file domutils.h.

const QString DomUtils::nsAtomic = "atomic" [static]
 

Definition at line 73 of file domutils.h.

const QString DomUtils::nsSI = "siUnits" [static]
 

Definition at line 74 of file domutils.h.

const QString DomUtils::nsDC = "dc" [static]
 

Definition at line 75 of file domutils.h.


Generated on Fri May 19 14:31:57 2006 for Brabosphere by  doxygen 1.4.6-NO