Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cXmlWriter Class Reference

#include <cXmlWriter.h>

Inheritance diagram for GrayLib::cXmlWriter:
GrayLib::cXmlWriterV

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

cStreamOutputm_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...
 

Detailed Description

Print/Write to memory functionality.

Constructor & Destructor Documentation

◆ cXmlWriter()

GrayLib::cXmlWriter::cXmlWriter ( cStreamOutput pOutput)

◆ ~cXmlWriter()

GrayLib::cXmlWriter::~cXmlWriter ( )

Member Function Documentation

◆ get_Indent()

const char* GrayLib::cXmlWriter::get_Indent ( ) const
inline

Query the indention string.

◆ get_LineBreak()

const char* GrayLib::cXmlWriter::get_LineBreak ( ) const
inline

Query the current line breaking string.

◆ put_Indent()

void GrayLib::cXmlWriter::put_Indent ( const char *  pszIndent)
inline

Set the indent characters for printing. By default 4 spaces but tab "\t" is also useful, or null/empty string for no indentation.

◆ put_LineBreak()

void GrayLib::cXmlWriter::put_LineBreak ( const char *  pszLineBreak)
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.

◆ SetStreamPrinting()

void GrayLib::cXmlWriter::SetStreamPrinting ( )
inline

Switch over to "stream printing" which is the most dense formatting without line-breaks. Common when the XML is needed for network transmission.

◆ WriteComment()

void GrayLib::cXmlWriter::WriteComment ( const char *  pszComment)

◆ WriteElement1()

void GrayLib::cXmlWriter::WriteElement1 ( const char *  pszName,
const char *  pszData 
)

◆ WriteElementBegin()

void GrayLib::cXmlWriter::WriteElementBegin ( const char *  pszName,
const cXmlAttributeSet pAttr = nullptr,
bool  bClose = false,
bool  bLineBreak = true 
)

◆ WriteElementData()

void GrayLib::cXmlWriter::WriteElementData ( const char *  pszData,
bool  bCData = false 
)

◆ WriteElementEnd()

void GrayLib::cXmlWriter::WriteElementEnd ( const char *  pszName)

◆ WriteIndent()

void GrayLib::cXmlWriter::WriteIndent ( )
inlineprotected

◆ WriteLine()

void GrayLib::cXmlWriter::WriteLine ( const char *  pszData)

◆ WriteLineBreak()

void GrayLib::cXmlWriter::WriteLineBreak ( )
inlineprotected

◆ WriteNull()

void GrayLib::cXmlWriter::WriteNull ( )
inline

Member Data Documentation

◆ m_bElementOnOneLine

bool GrayLib::cXmlWriter::m_bElementOnOneLine
protected

All on the same line. "<X>sdfsdf</X>".

◆ m_iDepth

int GrayLib::cXmlWriter::m_iDepth
protected

Indent depth of writer.

◆ m_pOutput

cStreamOutput* GrayLib::cXmlWriter::m_pOutput

Hold output we are building.

◆ m_sIndent

cXmlString GrayLib::cXmlWriter::m_sIndent
protected

Tab = 4 spaces.

◆ m_sLineBreak

cXmlString GrayLib::cXmlWriter::m_sLineBreak
protected

STR_NL.


The documentation for this class was generated from the following files: