35 class RapidXmlWriterNode
45 this->document = document;
51 const std::string& name)
53 this->document = document;
62 document->allocate_attribute(cloneString(name), cloneString(value)));
68 const std::string& trueValue,
69 const std::string& falseValue,
78 const std::string& trueValue,
79 const std::string& falseValue,
83 if (value != defaultValue)
116 cloneString(
const std::string&
str)
140 document.append_node(rootNode.node);
157 file.open(path.c_str());
158 file <<
print(indent);
RapidXmlWriterNode & append_bool_attribute(const std::string &name, const std::string &trueValue, const std::string &falseValue, bool value)
RapidXmlWriterNode & append_data_node(const std::string &value)
friend class RapidXmlWriter
RapidXmlWriterNode append_node(const std::string &name)
RapidXmlWriterNode & append_string_node(const std::string &name, const std::string &value)
RapidXmlWriterNode & append_optional_bool_attribute(const std::string &name, const std::string &trueValue, const std::string &falseValue, bool value, bool defaultValue)
RapidXmlWriterNode & append_attribute(const std::string &name, const std::string &value)
std::string print(bool indent)
void saveToFile(const std::string &path, bool indent)
RapidXmlWriterNode createRootNode(const std::string &name)
Ch * allocate_string(const Ch *source=0, std::size_t size=0)
Allocates a char array of given size from the pool, and optionally copies a given string to it.
xml_node< Ch > * allocate_node(node_type type, const Ch *name=nullptr, const Ch *value=nullptr, std::size_t name_size=0, std::size_t value_size=0)
Allocates a new node from the pool, and optionally assigns name and value to it.
This class represents root of the DOM hierarchy.
Class representing a node of XML document.
void append_node(xml_node< Ch > *child)
Appends a new child node.
This file offers overloads of toIce() and fromIce() functions for STL container types.
OutIt print(OutIt out, const xml_node< Ch > &node, int flags=0)
Prints XML to given output iterator.
node_type
Enumeration listing all node types produced by the parser.
@ node_data
A data node. Name is empty. Value contains data text.
@ node_element
An element node. Name contains element name. Value contains text of first data node.
@ node_declaration
A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalon...
const int print_no_indenting
Printer flag instructing the printer to suppress indenting of XML. See print() function.
This file contains rapidxml parser and DOM implementation.
This file contains rapidxml printer implementation.