PLCnext API Documentation 23.6.0.37
|
Class to write an XML File More...
#include <XmlWriter.hpp>
Public Member Functions | |
XmlWriter (XmlWriter &&arg) | |
Move contructor. | |
~XmlWriter (void) | |
Destructs this instance and frees all resources. | |
bool | GetIndent (void) const |
Reads the indent status of this XmlWriter More... | |
const char * | GetEncoding (void) const |
Gets the encoding used by this XmlWriter More... | |
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) |
Static Public Member Functions | |
static XmlWriter | Create (const String &filename, bool indent, const char *encoding="UTF-8") |
Creates a new Instance of the XmlWriter More... | |
static XmlWriter | Create (XmlBuffer &buffer, bool indent, const char *encoding="UTF-8") |
Creates a new Instance of the XmlWriter writing to an XmlBuffer in memory More... | |
Class to write an XML File
|
static |
Creates a new Instance of the XmlWriter
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 |
XmlException |
|
static |
Creates a new Instance of the XmlWriter writing to an XmlBuffer in memory
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 |
XmlException |
const char * Arp::System::Commons::Xml::XmlWriter::GetEncoding | ( | void | ) | const |
Gets the encoding used by this XmlWriter
bool Arp::System::Commons::Xml::XmlWriter::GetIndent | ( | void | ) | const |
Reads the indent status of this XmlWriter
|
inline |
writes a new attribute for the currently open element characters not allowed in xml are not encoded
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 |
XmlException |
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
value | the content as String which should be written |
XmlException |
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
text | the CDATA content as String which should be written |
XmlException |
void Arp::System::Commons::Xml::XmlWriter::WriteEndDocument | ( | void | ) |
completes the xml document, must be called after the document data was written
XmlException |
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
XmlException |
void Arp::System::Commons::Xml::XmlWriter::WriteStartDocument | ( | void | ) |
writes the start of an xml document e.g. xml tag
XmlException |
void Arp::System::Commons::Xml::XmlWriter::WriteStartElement | ( | const char * | elementName | ) |
writes an start element with the given name <elementName>
elementName | name of the xml element |
XmlException |