CLAM::XmlWriteContext Class Reference

#include <XmlWriteContext.hxx>

List of all members.


Detailed Description

This class provides primitives to write an XML document to a target stream and to keep track of the writting state.

You can only have an instance of that class at a time. Instances of this class are created normally by as members of a root Scoped object like XmlDocument or XmlFragment. You can also instanciate this class directly whenever you want to use its primitives without intermediates.

Todo:
Indentation
Todo:
Explicit namespaces (now are supported by hand)
Todo:
Checks on element levels

Definition at line 43 of file XmlWriteContext.hxx.


Public Member Functions

 XmlWriteContext (std::ostream &targetStream)
 ~XmlWriteContext ()
std::ostream & GetTarget ()
template<typename T>
void InsertContent (const T &content)
void OpenElement (const std::string &name)
void CloseElement (const std::string &name)
template<typename T>
void InsertAttribute (const std::string &name, const T &content)
bool LastWasAContent ()
bool ElementInserted ()
unsigned int CurrentLevel ()
void UseIndentation (bool useIt)

Static Public Member Functions

static XmlWriteContextCurrentContext ()

Constructor & Destructor Documentation

CLAM::XmlWriteContext::XmlWriteContext ( std::ostream &  targetStream  )  [inline]

Definition at line 46 of file XmlWriteContext.hxx.

References CLAM_ASSERT.

CLAM::XmlWriteContext::~XmlWriteContext (  )  [inline]

Definition at line 59 of file XmlWriteContext.hxx.


Member Function Documentation

static XmlWriteContext& CLAM::XmlWriteContext::CurrentContext (  )  [inline, static]

Definition at line 64 of file XmlWriteContext.hxx.

References CLAM_ASSERT.

std::ostream& CLAM::XmlWriteContext::GetTarget (  )  [inline]

Definition at line 70 of file XmlWriteContext.hxx.

template<typename T>
void CLAM::XmlWriteContext::InsertContent ( const T &  content  )  [inline]

Definition at line 76 of file XmlWriteContext.hxx.

Referenced by CLAM::XmlContent::XmlContent().

void CLAM::XmlWriteContext::OpenElement ( const std::string &  name  )  [inline]

Definition at line 85 of file XmlWriteContext.hxx.

Referenced by CLAM::XmlElement::XmlElement().

void CLAM::XmlWriteContext::CloseElement ( const std::string &  name  )  [inline]

Definition at line 97 of file XmlWriteContext.hxx.

Referenced by CLAM::XmlElement::~XmlElement().

template<typename T>
void CLAM::XmlWriteContext::InsertAttribute ( const std::string &  name,
const T &  content 
) [inline]

Definition at line 109 of file XmlWriteContext.hxx.

References CLAM_ASSERT.

Referenced by CLAM::XmlAttribute::XmlAttribute().

bool CLAM::XmlWriteContext::LastWasAContent (  )  [inline]

Returns:
true when the last thing inserted on the current node has been plain content.

Definition at line 120 of file XmlWriteContext.hxx.

bool CLAM::XmlWriteContext::ElementInserted (  )  [inline]

Returns:
true when an element has been inserted on the current node.

Definition at line 128 of file XmlWriteContext.hxx.

unsigned int CLAM::XmlWriteContext::CurrentLevel (  )  [inline]

Definition at line 133 of file XmlWriteContext.hxx.

void CLAM::XmlWriteContext::UseIndentation ( bool  useIt  )  [inline]

Definition at line 138 of file XmlWriteContext.hxx.


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

Generated on Tue Aug 12 22:33:50 2008 for CLAM by  doxygen 1.5.5