VAT  3.0
Video Analysis Tool
XMLGenerator.h
1 #ifndef XMLGENERATOR_H
2 #define XMLGENERATOR_H
3 
4 #include <string>
5 #include <list>
6 #include <fstream>
7 #include "LearningAttributesSpecification.h"
8 #include <QDomNode>
9 
10 #define MAX_LINE 256
11 
12 namespace miles {
13 
14  class XMLGenerator {
15  public:
16  XMLGenerator();
17  XMLGenerator(std::string);
18  ~XMLGenerator();
19  void startXML(std::string);
20  void endXML();
21  void openTag(std::string, std::list<std::string>);
22  void oneLineTag(std::string, std::list<std::string>);
23  void closeCurrentTag();
24  void closeTag(std::string);
25 
26  private:
27  std::ofstream file;
28  std::string lineBuffer;
29  std::list<std::string> openedTags;
30  std::string filename;
31  int tablevel;
32 
33  void writeToBuffer(std::string);
34  void appendBuffer();
35  void multipleInsert(int, std::string);
36  bool bufferExhausted(std::string);
37  bool emptyBuffer();
38  };
39 
41 
42  public:
44  XMLTreeGenerator(std::string);
45 
46  void generateTree(SpHierarchyTree, SpLearningAttributes);
47  void printNode(SpLearningStateConcept, int, SpLearningAttributes);
48  static QDomNode getParameterNode(QString pname, QDomElement& elem);
49  static QDomNode getParameterNode(QString pname, QDomNode& node);
50  static QString getParameterValue(QDomNode& node);
51  static QString getParameterValue(QDomElement& elem);
52 
53  };
54 
55 
56 }
57 
58 #endif
Definition: XMLGenerator.h:14
Definition: XMLGenerator.h:40
Definition: HierarchyTree.cpp:12