8 #include "Arp/System/Core/TypeName.hxx"
9 #include "Arp/System/Commons/Logging.h"
10 #include "Arp/System/Commons/Exceptions/InvalidFormatException.hpp"
12 #include "cppformat/format.h"
14 namespace Arp {
namespace System {
namespace Commons {
namespace Xml
31 XmlWriter(
const String& filename,
bool indent,
const char* encoding =
"UTF-8");
32 XmlWriter(XmlBuffer& buffer,
bool indent,
const char* encoding);
65 static XmlWriter Create(XmlBuffer& buffer,
bool indent,
const char* encoding =
"UTF-8");
149 fmt::MemoryWriter tmpWriter;
151 SetAttributeValueInternal(attributeName, tmpWriter.c_str());
153 catch(std::exception& e)
170 void SetAttributeValueInternal(
const char* attributeName,
const char *value);
Class to write an XML File
Definition: XmlWriter.hpp:21
void WriteElementContent(const String &value)
writes the content inside the currently open element characters not allowed in xml are encoded
void WriteStartElement(const char *elementName)
writes an start element with the given name <elementName>
void WriteEndElement(void)
ends the currently open start element if no content was written inside this element,...
const char * GetEncoding(void) const
Gets the encoding used by this XmlWriter
XmlWriter(XmlWriter &&arg)
Move contructor.
void WriteStartDocument(void)
writes the start of an xml document e.g. xml tag
void WriteEndDocument(void)
completes the xml document, must be called after the document data was written
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
static XmlWriter Create(const String &filename, bool indent, const char *encoding="UTF-8")
Creates a new Instance of the XmlWriter
bool GetIndent(void) const
Reads the indent status of this XmlWriter
void WriteElementContentCData(const String &text)
writes the content inside the currently open element enclosed in a CDATA section characters not allow...
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
Definition: XmlWriter.hpp:145
~XmlWriter(void)
Destructs this instance and frees all resources.
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API