ANNA Suite  2020b
Multipurpose development suite for Telco applications
DocumentMemory.hpp
Go to the documentation of this file.
1 // ANNA - Anna is Not Nothingness Anymore //
2 // //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
4 // //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7 
8 
9 #ifndef anna_xml_DocumentMemory_hpp
10 #define anna_xml_DocumentMemory_hpp
11 
12 #include <anna/config/defines.hpp>
13 #include <anna/xml/Document.hpp>
14 #include <anna/xml/Compiler.hpp>
15 
16 namespace anna {
17 
18 namespace xml {
19 
23 class DocumentMemory : public Document {
24 public:
28  DocumentMemory() : a_rootNode(NULL) {;}
29 
35  const Node * getRootNode() const { return a_rootNode; }
36 
42  const Node* parse() noexcept(false) { return (a_rootNode = Document::parse()); }
43 
50  const Node* parse(const DTD& dtd) noexcept(false) { return (a_rootNode = Document::parse(dtd)); }
51 
57  std::string asXmlString() const { Compiler c; return (c.apply(a_rootNode)); }
58 
59 private:
60  const anna::xml::Node * a_rootNode;
61  virtual _xmlDoc* do_initialize(const char* content) noexcept(false);
62  virtual _xmlDoc* do_initialize(const anna::DataBlock&) noexcept(false);
63 };
64 
65 }
66 }
67 
68 #endif
Definition: Compiler.hpp:28
Definition: Document.hpp:49
const xml::Node * parse() noexcept(false)
Definition: Node.hpp:56
Definition: DTD.hpp:56
const Node * parse(const DTD &dtd) noexcept(false)
Definition: DocumentMemory.hpp:50
std::string asXmlString() const
Definition: DocumentMemory.hpp:57
DocumentMemory()
Definition: DocumentMemory.hpp:28
const char * apply(const Node *node, const int flag=Mode::Visual) noexcept(false)
const Node * getRootNode() const
Definition: DocumentMemory.hpp:35
Definition: app.hpp:12
const Node * parse() noexcept(false)
Definition: DocumentMemory.hpp:42
Definition: DocumentMemory.hpp:23
Definition: DataBlock.hpp:24