CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
XHTMLMaker.h
Go to the documentation of this file.
1 // $Id: XHTMLMaker.h,v 1.12 2011/07/07 09:22:44 mommsen Exp $
3 
4 #ifndef EventFilter_StorageManager_XHTMLMaker_h
5 #define EventFilter_StorageManager_XHTMLMaker_h
6 
7 #include <xercesc/dom/DOM.hpp>
8 #include <xercesc/dom/DOMDocument.hpp>
9 #include <xercesc/dom/DOMWriter.hpp>
10 #include <xercesc/util/XMLString.hpp>
11 
12 #include <map>
13 #include <string>
14 #include <iostream>
15 #include <stdint.h>
16 
17 namespace stor {
18 
27  class XHTMLMaker
28  {
29 
30  public:
31 
35  typedef xercesc::DOMElement Node;
36  typedef std::map<std::string,std::string> AttrMap;
37 
41  XHTMLMaker();
42 
46  ~XHTMLMaker();
47 
51  Node* start( const std::string& title );
52 
56  Node* getHead() const { return head_; }
57 
61  Node* addNode
62  (
63  const std::string& name,
64  Node* parent,
65  const AttrMap& attrs
66  );
67 
71  Node* addNode( const std::string& name, const AttrMap& attrs )
72  {
73  return addNode( name, (Node*)0, attrs );
74  }
75 
79  Node* addNode( const std::string& name, Node* parent )
80  {
81  AttrMap empty;
82  return addNode( name, parent, empty );
83  }
84 
88  Node* addNode( const std::string& name )
89  {
90  return addNode( name, (Node*)0 );
91  }
92 
96  void addText( Node* parent, const std::string& );
97 
101  void addInt( Node* parent, const int& );
102 
106  void addInt( Node* parent, const unsigned int& );
107 
111  void addInt( Node* parent, const long& );
112 
116  void addInt( Node* parent, const unsigned long& );
117 
121  void addInt( Node* parent, const long long& );
122 
126  void addInt( Node* parent, const unsigned long long& );
127 
131  void addHex( Node* parent, const unsigned long& );
132 
133 
137  void addDouble( Node* parent, const double& value, const unsigned int& precision = 2 );
138 
142  void addBool( Node* parent, const bool& );
143 
147  void out();
148 
152  void out( const std::string& dest );
153 
157  void out( std::string& dest );
158 
162  void out( std::ostream& dest );
163 
164  private:
165 
166  xercesc::DOMDocument* doc_;
167  xercesc::DOMWriter* writer_;
168  xercesc::DOMDocumentType* typ_;
169 
171 
173 
177  void setWriterFeatures_();
178 
179  };
180 
181 } // namespace stor
182 
183 #endif // EventFilter_StorageManager_XHTMLMaker_h
184 
Node * addNode(const std::string &name, Node *parent, const AttrMap &attrs)
Definition: XHTMLMaker.cc:146
void addDouble(Node *parent, const double &value, const unsigned int &precision=2)
Definition: XHTMLMaker.cc:254
list parent
Definition: dbtoconf.py:74
void addText(Node *parent, const std::string &)
Definition: XHTMLMaker.cc:173
xercesc::DOMDocument * doc_
Definition: XHTMLMaker.h:166
xercesc::DOMDocumentType * typ_
Definition: XHTMLMaker.h:168
Node * addNode(const std::string &name)
Definition: XHTMLMaker.h:88
void addBool(Node *parent, const bool &)
Definition: XHTMLMaker.cc:264
Node * addNode(const std::string &name, const AttrMap &attrs)
Definition: XHTMLMaker.h:71
void addHex(Node *parent, const unsigned long &)
Definition: XHTMLMaker.cc:244
std::map< std::string, std::string > AttrMap
Definition: XHTMLMaker.h:36
void addInt(Node *parent, const int &)
Definition: XHTMLMaker.cc:184
xercesc::DOMWriter * writer_
Definition: XHTMLMaker.h:167
Node * start(const std::string &title)
Definition: XHTMLMaker.cc:101
Node * addNode(const std::string &name, Node *parent)
Definition: XHTMLMaker.h:79
void setWriterFeatures_()
Definition: XHTMLMaker.cc:273
xercesc::DOMElement Node
Definition: XHTMLMaker.h:35
Node * getHead() const
Definition: XHTMLMaker.h:56