VAT  3.0
Video Analysis Tool
XmlParameterExtractor.h
1 #ifndef XML_PARAMETER_EXTRACTOR_H
2 #define XML_PARAMETER_EXTRACTOR_H
3 
4 #include "xmlcommon.h"
5 
6 
7 enum class ParameterDataType{BOOLEAN, CHAR, UCHAR, INT, UINT, LONG,
8  ULONG, FLOAT, DOUBLE, QSTRING};
9 
11 
12 public:
13  static bool getParameterStringValue(const QDomNode &rootNode, const QString &parameterName,
14  QString &outParameter, QDomNode &parameterNode);
15  template <class typeData>
16  static bool getParameterValue(const QDomNode &rootNode, const QString &parameterLabel,
17  typeData &outParameter);
18  template <class typeData>
19  static bool getParameterValue(const QDomNode &rootNode, const QString &parameterLabel,
20  typeData &outParameter, QDomNode &parameterNode);
21 
22  //TODO: assert value range and change void for bool to inform the error
23  static void convertQStringTo(const QString &inValue, bool &outValue);
24  static void convertQStringTo(const QString &inValue, char &outValue);
25  static void convertQStringTo(const QString &inValue, uchar &outValue);
26  static void convertQStringTo(const QString &inValue, int &outValue);
27  static void convertQStringTo(const QString &inValue, uint &outValue);
28  static void convertQStringTo(const QString &inValue, long &outValue);
29  static void convertQStringTo(const QString &inValue, ulong &outValue);
30  static void convertQStringTo(const QString &inValue, float &outValue);
31  static void convertQStringTo(const QString &inValue, double &outValue);
32 
33  static ParameterDataType getType (const bool &inValue);
34  static ParameterDataType getType (const char &inValue);
35  static ParameterDataType getType (const uchar &inValue);
36  static ParameterDataType getType (const int &inValue);
37  static ParameterDataType getType (const uint &inValue);
38  static ParameterDataType getType (const long &inValue);
39  static ParameterDataType getType (const ulong &inValue);
40  static ParameterDataType getType (const float &inValue);
41  static ParameterDataType getType (const double &inValue);
42  static ParameterDataType getType (const QString &inValue);
43 private:
45 };
46 
47 #endif // XML_PARAMETER_EXTRACTOR_H
Definition: XmlParameterExtractor.h:10