ANNA Suite  2020b
Multipurpose development suite for Telco applications
DocumentFile.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_DocumentFile_hpp
10 #define anna_xml_DocumentFile_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 DocumentFile : public Document {
24 public:
28  DocumentFile() : a_filename("<none>"), a_rootNode(NULL) {;}
29 
35  const Node * getRootNode() const { return a_rootNode; }
36 
41  const anna::DataBlock& getContent() const noexcept(false);
42 
48  const Node* parse() noexcept(false) { return (a_rootNode = Document::parse()); }
49 
56  const Node* parse(const DTD& dtd) noexcept(false) { return (a_rootNode = Document::parse(dtd)); }
57 
63  std::string asXmlString() const { Compiler c; return (c.apply(a_rootNode)); }
64 
65 
66 protected:
70  std::string a_filename;
71 
72 private:
73  const anna::xml::Node * a_rootNode;
74  virtual _xmlDoc* do_initialize(const char* filename) noexcept(false);
75  virtual _xmlDoc* do_initialize(const anna::DataBlock&) noexcept(false);
76 };
77 
78 }
79 }
80 
81 #endif
Definition: Compiler.hpp:28
DocumentFile()
Definition: DocumentFile.hpp:28
Definition: Document.hpp:49
const xml::Node * parse() noexcept(false)
const anna::DataBlock & getContent() const noexcept(false)
Definition: Node.hpp:56
Definition: DTD.hpp:56
const Node * parse(const DTD &dtd) noexcept(false)
Definition: DocumentFile.hpp:56
std::string asXmlString() const
Definition: DocumentFile.hpp:63
const char * apply(const Node *node, const int flag=Mode::Visual) noexcept(false)
std::string a_filename
Definition: DocumentFile.hpp:70
Definition: app.hpp:12
const Node * getRootNode() const
Definition: DocumentFile.hpp:35
Definition: DocumentFile.hpp:23
const Node * parse() noexcept(false)
Definition: DocumentFile.hpp:48
Definition: DataBlock.hpp:24