00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00020
00021 #ifndef DOMUTILS_H
00022 #define DOMUTILS_H
00023
00025
00026
00027 #include <vector>
00028
00029
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);
00041 static void readNode(QDomNode* node, QStringList* value);
00042 static void readNode(QDomNode* node, unsigned int* value);
00043 static void readNode(QDomNode* node, int* value);
00044 static void readNode(QDomNode* node, float* value);
00045 static void readNode(QDomNode* node, double* value);
00046 static void readNode(QDomNode* node, bool* value);
00047 static void readNode(QDomNode* node, std::vector<unsigned int>* values);
00048 static void readNode(QDomNode* node, std::vector<double>* values);
00049 static void readNode(QDomNode* node, std::vector<bool>* values);
00050 static void readNode(QDomNode* node, QValueList<int>* values);
00051 static void makeNode(QDomElement* root, const QString nodeData, const QString dictRef = 0,const QString attributeName = 0, const QString attributeValue = 0);
00052 static void makeNode(QDomElement* root, const QStringList nodeData, const QString dictRef = 0,const QString attributeName = 0, const QString attributeValue = 0);
00053 static void makeNode(QDomElement* root, const unsigned int nodeData, const QString dictRef);
00054 static void makeNode(QDomElement* root, const int nodeData, const QString dictRef);
00055 static void makeNode(QDomElement* root, const float nodeData, const QString dictRef);
00056 static void makeNode(QDomElement* root, const bool nodeData, const QString dictRef);
00057 static void makeNode(QDomElement* root, const std::vector<unsigned int> nodeData, const QString dictRef);
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);
00059 static void makeNode(QDomElement* root, const std::vector<bool> nodeData, const QString dictRef);
00060 static void makeNode(QDomElement* root, const QValueList<int> nodeData, const QString dictRef);
00061 static bool dictEntry(QDomNode& node, const QString value);
00062
00063 static const QString uriDict10;
00064 static const QString uriNSCML;
00065 static const QString uriNSDC;
00066 static const QString uriDictCMLM;
00067 static const QString uriDictXSD;
00068 static const QString uriDictAtomic;
00069 static const QString uriDictSI;
00070 static const QString ns;
00071 static const QString nsCMLM;
00072 static const QString nsXSD;
00073 static const QString nsAtomic;
00074 static const QString nsSI;
00075 static const QString nsDC;
00076
00077 private:
00078 DomUtils();
00079 ~DomUtils();
00080 };
00081
00082 #endif
00083