Scribus
Open source desktop publishing at your fingertips
saxXML.h
1 /*
2  * saxXML.h
3  *
4  *
5  * Created by Andreas Vox on 21.09.06.
6  * Copyright 2006 under GPL2. All rights reserved.
7  *
8  */
9 
10 
11 
12 #ifndef SAXXML_H
13 #define SAXXML_H
14 
15 #include <fstream>
16 #include "saxhandler.h"
17 #include "scribusapi.h"
18 
19 class SCRIBUS_API SaxXML : public SaxHandler {
20 public:
21  SaxXML(std::ostream& file, bool pretty=false);
22  SaxXML(const char* filename, bool pretty=false);
23  ~SaxXML();
24 
25  void beginDoc();
26  void endDoc();
27  void begin(const Xml_string& tag, Xml_attr attr);
28  void end(const Xml_string& tag);
29  void chars(const Xml_string& text);
30 
31 private:
32  std::ofstream m_file;
33  std::ostream& m_stream;
34  bool m_pretty;
35  int m_indentLevel;
36  bool m_manyAttributes;
37  bool pendingEmptyTag;
38  void finalizePendingEmptyTag();
39 };
40 
41 #endif
Definition: saxhandler.h:21
Definition: saxXML.h:19