43 #ifndef XML_DOCUMENT_HPP 44 #define XML_DOCUMENT_HPP 67 :
xml_child(
std::string(
"")), root_node(nullptr), version(_version)
76 os <<
"<?xml version=\"" << version <<
"\"";
79 os <<
" encoding=\"" << encoding <<
"\"";
114 std::ofstream xml_file(filename);
116 print(xml_file,
false,
nullptr);
126 std::ofstream xml_file(filename);
128 print(xml_file,
true, &PP);
142 encoding = _encoding;
void write_to_file(const std::filesystem::path &filename)
Write the document to a file.
void print(std::ostream &os, bool formatted, simple_indent *pp) const override
Print the class.
exceptions managed by PandA
xml_element * get_root_node() const
Return the root node.
Definition of hash function for EdgeDescriptor.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
xml_document(const std::string &_version="1.0")
constructor
void write_to_file_formatted(const std::filesystem::path &filename)
Write the document to a file.
xml_element * create_root_node(const std::string &_name)
Creates the root node.
std::string get_encoding() const
#define STD_OPENING_CHAR
STD include.
void set_encoding(const std::string &_encoding)
Template definition of refcount.
Very simple pretty printer functor.
#define STD_CLOSING_CHAR
Special closing character used to close the current nested level.
void print(std::ostream &os, bool formatted, simple_indent *pp) const override
Print the class.
xml_element * add_child_element(const std::string &name)
Add a child element to this node.