LibreOffice Module tools (master) 1
|
XmlWriter writes a XML to a SvStream. More...
#include <XmlWriter.hxx>
Public Member Functions | |
XmlWriter (SvStream *pStream) | |
~XmlWriter () | |
bool | startDocument (sal_Int32 nIndent=2, bool bWriteXmlHeader=true) |
void | endDocument () |
void | startElement (const char *sName) |
void | startElement (const OString &sName) |
void | startElement (const OString &sPrefix, const OString &sName, const OString &sNamespaceUri) |
void | endElement () |
void | attribute (const char *sTagName, const OString &aValue) |
void | attribute (const OString &sTagName, const OString &aValue) |
void | attribute (const char *sTagName, std::u16string_view aValue) |
void | attribute (const char *sTagName, sal_Int32 aNumber) |
void | attributeDouble (const char *sTagName, double aNumber) |
void | attributeBase64 (const char *sTagName, std::vector< sal_uInt8 > const &rValueInBytes) |
void | attributeBase64 (const char *sTagName, std::vector< char > const &rValueInBytes) |
void | content (const OString &sValue) |
void | content (std::u16string_view sValue) |
void | element (const char *sName) |
Private Attributes | |
std::unique_ptr< XmlWriterImpl > | mpImpl |
XmlWriter writes a XML to a SvStream.
It uses libxml2 for writing but hides all the internal libxml2 workings and uses types that are native for LO development.
The codepage used for XML is always "utf-8" and the output is indented by default so it is easier to read.
Definition at line 34 of file XmlWriter.hxx.
tools::XmlWriter::XmlWriter | ( | SvStream * | pStream | ) |
Definition at line 48 of file XmlWriter.cxx.
tools::XmlWriter::~XmlWriter | ( | ) |
Definition at line 53 of file XmlWriter.cxx.
References endDocument(), and mpImpl.
void tools::XmlWriter::attribute | ( | const char * | sTagName, |
const OString & | aValue | ||
) |
Definition at line 124 of file XmlWriter.cxx.
References mpImpl, name, and value.
Referenced by attribute(), and attributeDouble().
void tools::XmlWriter::attribute | ( | const char * | sTagName, |
sal_Int32 | aNumber | ||
) |
Definition at line 143 of file XmlWriter.cxx.
References attribute(), and name.
void tools::XmlWriter::attribute | ( | const char * | sTagName, |
std::u16string_view | aValue | ||
) |
Definition at line 138 of file XmlWriter.cxx.
References attribute(), name, OUStringToOString(), and value.
void tools::XmlWriter::attribute | ( | const OString & | sTagName, |
const OString & | aValue | ||
) |
Definition at line 131 of file XmlWriter.cxx.
void tools::XmlWriter::attributeBase64 | ( | const char * | sTagName, |
std::vector< char > const & | rValueInBytes | ||
) |
Definition at line 116 of file XmlWriter.cxx.
void tools::XmlWriter::attributeBase64 | ( | const char * | sTagName, |
std::vector< sal_uInt8 > const & | rValueInBytes | ||
) |
Definition at line 110 of file XmlWriter.cxx.
References attributeBase64(), and pName.
Referenced by attributeBase64().
void tools::XmlWriter::attributeDouble | ( | const char * | sTagName, |
double | aNumber | ||
) |
Definition at line 148 of file XmlWriter.cxx.
References attribute(), and name.
void tools::XmlWriter::content | ( | const OString & | sValue | ) |
void tools::XmlWriter::content | ( | std::u16string_view | sValue | ) |
Definition at line 159 of file XmlWriter.cxx.
References content(), and OUStringToOString().
void tools::XmlWriter::element | ( | const char * | sName | ) |
Definition at line 164 of file XmlWriter.cxx.
References endElement(), sName, and startElement().
void tools::XmlWriter::endDocument | ( | ) |
void tools::XmlWriter::endElement | ( | ) |
bool tools::XmlWriter::startDocument | ( | sal_Int32 | nIndent = 2 , |
bool | bWriteXmlHeader = true |
||
) |
Definition at line 59 of file XmlWriter.cxx.
References mpImpl.
void tools::XmlWriter::startElement | ( | const char * | sName | ) |
void tools::XmlWriter::startElement | ( | const OString & | sName | ) |
Definition at line 102 of file XmlWriter.cxx.
References mpImpl.
void tools::XmlWriter::startElement | ( | const OString & | sPrefix, |
const OString & | sName, | ||
const OString & | sNamespaceUri | ||
) |
Definition at line 82 of file XmlWriter.cxx.
|
private |
Definition at line 37 of file XmlWriter.hxx.
Referenced by attribute(), attributeBase64(), content(), endDocument(), endElement(), startDocument(), startElement(), and ~XmlWriter().