This class provides primitives to write an XML document to a target stream and to keep track of the writting state. More...
#include <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 XmlWriteContext & | CurrentContext () |
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.
Indentation
Explicit namespaces (now are supported by hand)
Checks on element levels
Definition at line 43 of file XmlWriteContext.hxx.
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.
void CLAM::XmlWriteContext::CloseElement | ( | const std::string & | name | ) | [inline] |
Definition at line 97 of file XmlWriteContext.hxx.
static XmlWriteContext& CLAM::XmlWriteContext::CurrentContext | ( | ) | [inline, static] |
Definition at line 64 of file XmlWriteContext.hxx.
References CLAM_ASSERT.
Definition at line 133 of file XmlWriteContext.hxx.
bool CLAM::XmlWriteContext::ElementInserted | ( | ) | [inline] |
Definition at line 128 of file XmlWriteContext.hxx.
std::ostream& CLAM::XmlWriteContext::GetTarget | ( | ) | [inline] |
Definition at line 70 of file XmlWriteContext.hxx.
void CLAM::XmlWriteContext::InsertAttribute | ( | const std::string & | name, | |
const T & | content | |||
) | [inline] |
Definition at line 109 of file XmlWriteContext.hxx.
References CLAM_ASSERT.
void CLAM::XmlWriteContext::InsertContent | ( | const T & | content | ) | [inline] |
Definition at line 76 of file XmlWriteContext.hxx.
bool CLAM::XmlWriteContext::LastWasAContent | ( | ) | [inline] |
Definition at line 120 of file XmlWriteContext.hxx.
void CLAM::XmlWriteContext::OpenElement | ( | const std::string & | name | ) | [inline] |
Definition at line 85 of file XmlWriteContext.hxx.
void CLAM::XmlWriteContext::UseIndentation | ( | bool | useIt | ) | [inline] |
Definition at line 138 of file XmlWriteContext.hxx.