![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cXmlWriter.h>
Public Member Functions | |
cXmlWriter (cStreamOutput *pOutput) | |
~cXmlWriter () | |
void | put_Indent (const char *pszIndent) |
const char * | get_Indent () const |
void | put_LineBreak (const char *pszLineBreak) |
const char * | get_LineBreak () const |
void | SetStreamPrinting () |
void | WriteNull () |
void | WriteLine (const char *pszData) |
void | WriteComment (const char *pszComment) |
void | WriteElementBegin (const char *pszName, const cXmlAttributeSet *pAttr=nullptr, bool bClose=false, bool bLineBreak=true) |
void | WriteElementData (const char *pszData, bool bCData=false) |
void | WriteElementEnd (const char *pszName) |
void | WriteElement1 (const char *pszName, const char *pszData) |
Public Attributes | |
cStreamOutput * | m_pOutput |
Hold output we are building. More... | |
Protected Member Functions | |
void | WriteIndent () |
void | WriteLineBreak () |
Protected Attributes | |
cXmlString | m_sIndent |
Tab = 4 spaces. More... | |
cXmlString | m_sLineBreak |
STR_NL. More... | |
int | m_iDepth |
Indent depth of writer. More... | |
bool | m_bElementOnOneLine |
All on the same line. "<X>sdfsdf</X>". More... | |
Print/Write to memory functionality.
GrayLib::cXmlWriter::cXmlWriter | ( | cStreamOutput * | pOutput | ) |
GrayLib::cXmlWriter::~cXmlWriter | ( | ) |
|
inline |
Query the indention string.
|
inline |
Query the current line breaking string.
|
inline |
Set the indent characters for printing. By default 4 spaces but tab "\t" is also useful, or null/empty string for no indentation.
|
inline |
Set the line breaking string. By default set to newline (
). Some operating systems prefer other characters, or can be set to the null/empty string for no indentation.
|
inline |
Switch over to "stream printing" which is the most dense formatting without line-breaks. Common when the XML is needed for network transmission.
void GrayLib::cXmlWriter::WriteComment | ( | const char * | pszComment | ) |
void GrayLib::cXmlWriter::WriteElement1 | ( | const char * | pszName, |
const char * | pszData | ||
) |
void GrayLib::cXmlWriter::WriteElementBegin | ( | const char * | pszName, |
const cXmlAttributeSet * | pAttr = nullptr , |
||
bool | bClose = false , |
||
bool | bLineBreak = true |
||
) |
void GrayLib::cXmlWriter::WriteElementData | ( | const char * | pszData, |
bool | bCData = false |
||
) |
void GrayLib::cXmlWriter::WriteElementEnd | ( | const char * | pszName | ) |
|
inlineprotected |
void GrayLib::cXmlWriter::WriteLine | ( | const char * | pszData | ) |
|
inlineprotected |
|
inline |
|
protected |
All on the same line. "<X>sdfsdf</X>".
|
protected |
Indent depth of writer.
cStreamOutput* GrayLib::cXmlWriter::m_pOutput |
Hold output we are building.
|
protected |
Tab = 4 spaces.
|
protected |
STR_NL.