decXmlWriter Class Reference

XML Writer. More...

#include <decXmlWriter.h>

List of all members.

Public Member Functions

Constructors and Destructors
 decXmlWriter (decBaseFileWriter *file)
 Creates a new xml writer.
 ~decXmlWriter ()
 Cleans up the xml writer.
Management
int GetIndent () const
 Retrieves the indent level.
void SetIndent (int indent)
 Sets the indent level.
void IncreaseIndent ()
 Increases the indent level by one.
void DecreaseIndent ()
 Decreases the indent level by one if larger than 0.
void WriteIndent ()
 Writes the current indent.
void WriteXMLDeclaration ()
 Writes the XML Declaration using UTF-8 as encoding.
void WriteUnicodeString (const decUnicodeString &string)
 Writes an unicode string in UTF-8 encoding.
void WriteNewline ()
 Writes a newline useful for structuring content.
void WriteDocTypeDeclaration (const char *rootTag, const char *dtdSource)
 Writes the Document Type Declaration.
void WriteDocTypeDeclaration (const decUnicodeString &rootTag, const decUnicodeString &dtdSource)
 Writes the Document Type Declaration.
void WriteOpeningTag (const char *name, bool empty=false, bool indent=true, bool newline=true)
 Writes opening tag with no arguments.
void WriteOpeningTag (const decUnicodeString &name, bool empty=false, bool indent=true, bool newline=true)
 Writes opening tag with no arguments.
void WriteOpeningTagStart (const char *name, bool indent=true)
 Writes the start of an opening tag.
void WriteOpeningTagStart (const decUnicodeString &name, bool indent=true)
 Writes the start of an opening tag.
void WriteAttributeString (const char *name, const char *string)
 Writes a string argument.
void WriteAttributeString (const decUnicodeString &name, const decUnicodeString &string)
 Writes a string argument.
void WriteAttributeInt (const char *name, int value)
 Writes an integer argument.
void WriteAttributeInt (const decUnicodeString &name, int value)
 Writes an integer argument.
void WriteAttributeFloat (const char *name, float value)
 Writes a float argument.
void WriteAttributeFloat (const decUnicodeString &name, float value)
 Writes a float argument.
void WriteAttributeDouble (const char *name, double value)
 Writes a double argument.
void WriteAttributeDouble (const decUnicodeString &name, double value)
 Writes a double argument.
void WriteOpeningTagEnd (bool empty=false, bool newline=true)
 Writes the end of an opening tag.
void WriteTextString (const char *text)
 Writes text with proper escaping.
void WriteTextString (const decUnicodeString &text)
 Writes text with proper escaping.
void WriteTextInt (int value)
 Writes text.
void WriteTextFloat (float value)
 Writes text.
void WriteTextDouble (double value)
 Writes text.
void WriteClosingTag (const char *name, bool indent=true, bool newline=true)
 Writes a closing tag.
void WriteClosingTag (const decUnicodeString &name, bool indent=true, bool newline=true)
 Writes a closing tag.
void WriteComment (const char *comment, bool indent=true, bool newline=true)
 Writes a comment.
void WriteComment (const decUnicodeString &comment, bool indent=true, bool newline=true)
 Writes a comment.
void WriteDataTagString (const char *tagName, const char *string, bool indent=true, bool newline=true)
 Writes an entire data tag.
void WriteDataTagString (const decUnicodeString &tagName, const decUnicodeString &string, bool indent=true, bool newline=true)
 Writes an entire data tag.
void WriteDataTagInt (const char *tagName, int value, bool indent=true, bool newline=true)
 Writes an entire data tag.
void WriteDataTagInt (const decUnicodeString &tagName, int value, bool indent=true, bool newline=true)
 Writes an entire data tag.
void WriteDataTagFloat (const char *tagName, float value, bool indent=true, bool newline=true)
 Writes an entire data tag.
void WriteDataTagFloat (const decUnicodeString &tagName, float value, bool indent=true, bool newline=true)
 Writes an entire data tag.
void WriteDataTagDouble (const char *tagName, double value, bool indent=true, bool newline=true)
 Writes an entire data tag.
void WriteDataTagDouble (const decUnicodeString &tagName, double value, bool indent=true, bool newline=true)
 Writes an entire data tag.

Detailed Description

XML Writer.

Simple class to help writing XML files. Does not use a constructed XML document and is therefore very light weight.

Author:
Plüss Roland
Version:
1.0
Date:
2009

Constructor & Destructor Documentation

decXmlWriter::decXmlWriter ( decBaseFileWriter file )

Creates a new xml writer.

decXmlWriter::~decXmlWriter (  )

Cleans up the xml writer.


Member Function Documentation

void decXmlWriter::DecreaseIndent (  )

Decreases the indent level by one if larger than 0.

int decXmlWriter::GetIndent (  ) const [inline]

Retrieves the indent level.

void decXmlWriter::IncreaseIndent (  )

Increases the indent level by one.

void decXmlWriter::SetIndent ( int  indent )

Sets the indent level.

void decXmlWriter::WriteAttributeDouble ( const char *  name,
double  value 
)

Writes a double argument.

Writes ' NAME="VALUE"' without single quotes. The value is written similar to the g format flag from the printf family of functions.

void decXmlWriter::WriteAttributeDouble ( const decUnicodeString name,
double  value 
)

Writes a double argument.

Writes ' NAME="VALUE"' without single quotes. The value is written similar to the g format flag from the printf family of functions.

void decXmlWriter::WriteAttributeFloat ( const char *  name,
float  value 
)

Writes a float argument.

Writes ' NAME="VALUE"' without single quotes. The value is written similar to the g format flag from the printf family of functions.

void decXmlWriter::WriteAttributeFloat ( const decUnicodeString name,
float  value 
)

Writes a float argument.

Writes ' NAME="VALUE"' without single quotes. The value is written similar to the g format flag from the printf family of functions.

void decXmlWriter::WriteAttributeInt ( const char *  name,
int  value 
)

Writes an integer argument.

Writes ' NAME="VALUE"' without single quotes.

void decXmlWriter::WriteAttributeInt ( const decUnicodeString name,
int  value 
)

Writes an integer argument.

Writes ' NAME="VALUE"' without single quotes.

void decXmlWriter::WriteAttributeString ( const decUnicodeString name,
const decUnicodeString string 
)

Writes a string argument.

Writes ' NAME="STRING"' without single quotes. The string value is properly escaped.

void decXmlWriter::WriteAttributeString ( const char *  name,
const char *  string 
)

Writes a string argument.

Writes ' NAME="STRING"' without single quotes. The string value is properly escaped.

void decXmlWriter::WriteClosingTag ( const char *  name,
bool  indent = true,
bool  newline = true 
)

Writes a closing tag.

Writes first the current indent and then '</NAME>' without the quotes. If newline is true a newline is written after the closing tag and the indent decreased by one.

void decXmlWriter::WriteClosingTag ( const decUnicodeString name,
bool  indent = true,
bool  newline = true 
)

Writes a closing tag.

Writes first the current indent and then '</NAME>' without the quotes. If newline is true a newline is written after the closing tag and the indent decreased by one before writing the tag.

void decXmlWriter::WriteComment ( const char *  comment,
bool  indent = true,
bool  newline = true 
)

Writes a comment.

void decXmlWriter::WriteComment ( const decUnicodeString comment,
bool  indent = true,
bool  newline = true 
)

Writes a comment.

void decXmlWriter::WriteDataTagDouble ( const char *  tagName,
double  value,
bool  indent = true,
bool  newline = true 
)

Writes an entire data tag.

A data tag composes of an opening tag with no parameters, a text and an ending tag on the same line ( if the text is not multi line ).

void decXmlWriter::WriteDataTagDouble ( const decUnicodeString tagName,
double  value,
bool  indent = true,
bool  newline = true 
)

Writes an entire data tag.

A data tag composes of an opening tag with no parameters, a text and an ending tag on the same line ( if the text is not multi line ).

void decXmlWriter::WriteDataTagFloat ( const char *  tagName,
float  value,
bool  indent = true,
bool  newline = true 
)

Writes an entire data tag.

A data tag composes of an opening tag with no parameters, a text and an ending tag on the same line ( if the text is not multi line ).

void decXmlWriter::WriteDataTagFloat ( const decUnicodeString tagName,
float  value,
bool  indent = true,
bool  newline = true 
)

Writes an entire data tag.

A data tag composes of an opening tag with no parameters, a text and an ending tag on the same line ( if the text is not multi line ).

void decXmlWriter::WriteDataTagInt ( const char *  tagName,
int  value,
bool  indent = true,
bool  newline = true 
)

Writes an entire data tag.

A data tag composes of an opening tag with no parameters, a text and an ending tag on the same line ( if the text is not multi line ).

void decXmlWriter::WriteDataTagInt ( const decUnicodeString tagName,
int  value,
bool  indent = true,
bool  newline = true 
)

Writes an entire data tag.

A data tag composes of an opening tag with no parameters, a text and an ending tag on the same line ( if the text is not multi line ).

void decXmlWriter::WriteDataTagString ( const char *  tagName,
const char *  string,
bool  indent = true,
bool  newline = true 
)

Writes an entire data tag.

A data tag composes of an opening tag with no parameters, a text and an ending tag on the same line ( if the text is not multi line ).

void decXmlWriter::WriteDataTagString ( const decUnicodeString tagName,
const decUnicodeString string,
bool  indent = true,
bool  newline = true 
)

Writes an entire data tag.

A data tag composes of an opening tag with no parameters, a text and an ending tag on the same line ( if the text is not multi line ).

void decXmlWriter::WriteDocTypeDeclaration ( const decUnicodeString rootTag,
const decUnicodeString dtdSource 
)

Writes the Document Type Declaration.

void decXmlWriter::WriteDocTypeDeclaration ( const char *  rootTag,
const char *  dtdSource 
)

Writes the Document Type Declaration.

void decXmlWriter::WriteIndent (  )

Writes the current indent.

void decXmlWriter::WriteNewline (  )

Writes a newline useful for structuring content.

Writes first the current indent and then a newline.

void decXmlWriter::WriteOpeningTag ( const char *  name,
bool  empty = false,
bool  indent = true,
bool  newline = true 
)

Writes opening tag with no arguments.

Writes first the current indent and then '<NAME>' or '<NAME/>' without quotes depending on the empty parameter. If newline is true a newline is written after the tag. If empty is false and newline is true the indent is increased by one.

void decXmlWriter::WriteOpeningTag ( const decUnicodeString name,
bool  empty = false,
bool  indent = true,
bool  newline = true 
)

Writes opening tag with no arguments.

Writes first the current indent and then '<NAME>' or '<NAME/>' without quotes depending on the empty parameter. If newline is true a newline is written after the tag. If empty is false and newline is true the indent is increased by one.

void decXmlWriter::WriteOpeningTagEnd ( bool  empty = false,
bool  newline = true 
)

Writes the end of an opening tag.

Writes either "/>" or ">". If empty is true an empty tag using the first text is written otherwise an opening tag with the second text. If newline is true a newline is written after the text. If newline is true and empty is false the indent is increased by one.

void decXmlWriter::WriteOpeningTagStart ( const char *  name,
bool  indent = true 
)

Writes the start of an opening tag.

Writes first the current indent and then '<NAME' without quotes.

void decXmlWriter::WriteOpeningTagStart ( const decUnicodeString name,
bool  indent = true 
)

Writes the start of an opening tag.

Writes first the current indent and then '<NAME' without quotes.

void decXmlWriter::WriteTextDouble ( double  value )

Writes text.

void decXmlWriter::WriteTextFloat ( float  value )

Writes text.

void decXmlWriter::WriteTextInt ( int  value )

Writes text.

void decXmlWriter::WriteTextString ( const decUnicodeString text )

Writes text with proper escaping.

void decXmlWriter::WriteTextString ( const char *  text )

Writes text with proper escaping.

void decXmlWriter::WriteUnicodeString ( const decUnicodeString string )

Writes an unicode string in UTF-8 encoding.

void decXmlWriter::WriteXMLDeclaration (  )

Writes the XML Declaration using UTF-8 as encoding.


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