XMLSettingsReader.h 1.26 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/** @file XMLSettingsReader
 *  @brief Function prototypes for XMLSettingsReader
 *
 *  @author Riccardo Longo
 *  @bug No known bugs.
 */

#ifndef XMLSETTINGSREADER_H
#define XMLSETTINGSREADER_H

#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/dom/DOM.hpp>
#include <xercesc/sax/HandlerBase.hpp>

#include <string>
#include <vector>
#include <sstream>
#include <iostream>

using namespace xercesc;

class XMLSettingsReader {

 public :
      XMLSettingsReader( void );
      virtual ~XMLSettingsReader( void );

      int getBaseNodeCount(std::string _nodeName);
      int getNodeChildCount(std::string _nodeName, int _nodeNumber, std::string _childName);

      std::string getChildValue(std::string _baseNode, int _baseNumber, std::string _childNode);

      void getChildValue(std::string _baseNode, int _baseNumber, std::string _childNode, std::string &_retVal);
      void getChildValue(std::string _baseNode, int _baseNumber, std::string _childNode, bool& _retVal);
      void getChildValue(std::string _baseNode, int _baseNumber, std::string _childNode, double& _retVal);
      void getChildValue(std::string _baseNode, int _baseNumber, std::string _childNode, int& _retVal);

 private :
      XercesDOMParser* myDOMParser;
      DOMElement* rootNode;
};

#endif