Class to write an XML File
More...
#include <XmlWriter.hpp>
|
| XmlWriter (XmlWriter &&arg) |
| Move contructor.
|
|
| ~XmlWriter (void) |
| Destructs this instance and frees all resources.
|
|
void | WriteStartDocument (void) |
| writes the start of an xml document e.g. xml tag More...
|
|
void | WriteEndDocument (void) |
| completes the xml document, must be called after the document data was written More...
|
|
void | WriteStartElement (const char *elementName) |
| writes an start element with the given name <elementName> More...
|
|
void | WriteEndElement (void) |
| ends the currently open start element if no content was written inside this element, an empty element is written if content was written inside this element, an end element is written More...
|
|
void | WriteElementContent (const String &value) |
| writes the content inside the currently open element characters not allowed in xml are encoded More...
|
|
void | WriteElementContentCData (const String &text) |
| writes the content inside the currently open element enclosed in a CDATA section characters not allowed in xml are not encoded More...
|
|
template<class T > |
void | SetAttributeValue (const char *attributeName, const T &value) |
| writes a new attribute for the currently open element characters not allowed in xml are not encoded More...
|
|
void | SetAttributeValue (const char *attributeName, const char *value) |
|
void | SetAttributeValue (const char *attributeName, const String &value) |
|
void | SetAttributeValue (const char *attributeName, boolean value) |
|
Class to write an XML File
◆ Create() [1/2]
XmlWriter Arp::System::Commons::Xml::XmlWriter::Create |
( |
const String & |
filename, |
|
|
bool |
indent, |
|
|
const char * |
encoding = "UTF-8" |
|
) |
| |
|
static |
Creates a new Instance of the XmlWriter
- Parameters
-
filename | The Filename the writer uses to write the xml data |
indent | if true indenting is used by the writer to format the xml so it is easier to read |
encoding | the encoding to use for the xml file |
- Exceptions
-
◆ Create() [2/2]
XmlWriter Arp::System::Commons::Xml::XmlWriter::Create |
( |
XmlBuffer & |
buffer, |
|
|
bool |
indent, |
|
|
const char * |
encoding = "UTF-8" |
|
) |
| |
|
static |
Creates a new Instance of the XmlWriter writing to an XmlBuffer in memory
- Parameters
-
buffer | The buffer the writer uses to write the xml data |
indent | if true indenting is used by the writer to format the xml so it is easier to read |
encoding | the encoding to use for the xml data |
- Exceptions
-
◆ SetAttributeValue()
template<class T >
void Arp::System::Commons::Xml::XmlWriter::SetAttributeValue |
( |
const char * |
attributeName, |
|
|
const T & |
value |
|
) |
| |
|
inline |
writes a new attribute for the currently open element characters not allowed in xml are not encoded
- Parameters
-
attributeName | the name of the new attribute |
value | the value of the new attribute the type of value must be const char*, Arp::String, boolean or be supported by fmt::MemoryWriter |
- Exceptions
-
◆ WriteElementContent()
void Arp::System::Commons::Xml::XmlWriter::WriteElementContent |
( |
const String & |
value | ) |
|
writes the content inside the currently open element characters not allowed in xml are encoded
- Parameters
-
value | the content as String which should be written |
- Exceptions
-
◆ WriteElementContentCData()
void Arp::System::Commons::Xml::XmlWriter::WriteElementContentCData |
( |
const String & |
text | ) |
|
writes the content inside the currently open element enclosed in a CDATA section characters not allowed in xml are not encoded
- Parameters
-
text | the CDATA content as String which should be written |
- Exceptions
-
◆ WriteEndDocument()
void Arp::System::Commons::Xml::XmlWriter::WriteEndDocument |
( |
void |
| ) |
|
completes the xml document, must be called after the document data was written
- Exceptions
-
◆ WriteEndElement()
void Arp::System::Commons::Xml::XmlWriter::WriteEndElement |
( |
void |
| ) |
|
ends the currently open start element if no content was written inside this element, an empty element is written if content was written inside this element, an end element is written
- Exceptions
-
◆ WriteStartDocument()
void Arp::System::Commons::Xml::XmlWriter::WriteStartDocument |
( |
void |
| ) |
|
writes the start of an xml document e.g. xml tag
- Exceptions
-
◆ WriteStartElement()
void Arp::System::Commons::Xml::XmlWriter::WriteStartElement |
( |
const char * |
elementName | ) |
|
writes an start element with the given name <elementName>
- Parameters
-
elementName | name of the xml element |
- Exceptions
-
The documentation for this class was generated from the following files:
- Arp/System/Commons/Xml/XmlWriter.hpp
- Arp/System/Commons/Xml/XmlWriter.cpp