domutils.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           domutils.h  -  description
00003                              -------------------
00004     begin                : Thu Feb 20 2003
00005     copyright            : (C) 2003-2006 by Ben Swerts
00006     email                : bswerts@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00020 
00021 #ifndef DOMUTILS_H
00022 #define DOMUTILS_H
00023 
00025 
00026 // STL header files
00027 #include <vector>
00028 
00029 // Qt forward class declarations
00030 class QDomElement;
00031 class QDomNode;
00032 class QString;
00033 class QStringList;
00034 template<class T> class QValueList;
00035 
00037 class DomUtils
00038 {
00039   public:
00040     static void readNode(QDomNode* node, QString* value);   // reads the value of a node into a QString
00041     static void readNode(QDomNode* node, QStringList* value);         // overloaded
00042     static void readNode(QDomNode* node, unsigned int* value);        // overloaded
00043     static void readNode(QDomNode* node, int* value);       // overloaded
00044     static void readNode(QDomNode* node, float* value);     // overloaded
00045     static void readNode(QDomNode* node, double* value);    // overloaded
00046     static void readNode(QDomNode* node, bool* value);      // overloaded
00047     static void readNode(QDomNode* node, std::vector<unsigned int>* values);         // overloaded
00048     static void readNode(QDomNode* node, std::vector<double>* values); // overloaded
00049     static void readNode(QDomNode* node, std::vector<bool>* values); // overloaded
00050     static void readNode(QDomNode* node, QValueList<int>* values);     // overloaded        
00051     static void makeNode(QDomElement* root, const QString nodeData, const QString dictRef = 0,const QString attributeName = 0, const QString attributeValue = 0); // adds a node to root of type string with a title and another attribute
00052     static void makeNode(QDomElement* root, const QStringList nodeData, const QString dictRef = 0,const QString attributeName = 0, const QString attributeValue = 0);       // overloaded
00053     static void makeNode(QDomElement* root, const unsigned int nodeData, const QString dictRef);      // overloaded
00054     static void makeNode(QDomElement* root, const int nodeData, const QString dictRef);     // overloaded
00055     static void makeNode(QDomElement* root, const float nodeData, const QString dictRef);   // overloaded
00056     static void makeNode(QDomElement* root, const bool nodeData, const QString dictRef);    // overloaded
00057     static void makeNode(QDomElement* root, const std::vector<unsigned int> nodeData, const QString dictRef);  // overloaded
00058     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);  // overloaded
00059     static void makeNode(QDomElement* root, const std::vector<bool> nodeData, const QString dictRef);  // overloaded
00060     static void makeNode(QDomElement* root, const QValueList<int> nodeData, const QString dictRef);   // overloaded
00061     static bool dictEntry(QDomNode& node, const QString value);       //Returns whether the node has a dictRef attribute with the namespaced contents of value 
00062 
00063     static const QString uriDict10;     // The URI for the Brabosphere dictionary version 1.0
00064     static const QString uriNSCML;      // The URI for the CML namespace
00065     static const QString uriNSDC;       // The URI for the Dublin Core namespace
00066     static const QString uriDictCMLM;   // The URI for the CML Measured dictionary
00067     static const QString uriDictXSD;    // The URI for the XSD dictionary (datatypes)
00068     static const QString uriDictAtomic; // The URI for the CML Atomic Units dictionary
00069     static const QString uriDictSI;     // The URI for the CML SI Units dictionary
00070     static const QString ns;            // The namespace prefix for the Brabosphere dictionary
00071     static const QString nsCMLM;        // The namespace prefix for the CML Measured dictionary
00072     static const QString nsXSD;         // The namespace prefix for the XSD dictionary
00073     static const QString nsAtomic;      // The namespace prefix for the Atomic Units dictionary
00074     static const QString nsSI;          // The namespace prefix for the SI Units dictionary
00075     static const QString nsDC;          // The namespace prefix for the Dublin Core dictionary
00076 
00077   private:
00078     DomUtils();                         // constructor
00079     ~DomUtils();                        // destructor  
00080 };
00081 
00082 #endif
00083 

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