Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

Xmltag Class Reference

#include <cxxtools/xmltag.h>

List of all members.

Public Member Functions

 Xmltag (const std::string &tag, std::ostream &out=*default_out)
 prints start-tag and remember tag
 Xmltag (const std::string &tag, const std::string &parameter, std::ostream &out=*default_out)
 prints start-tag with parameters and remember tag
 ~Xmltag ()
 closes tag
const std::string & get () const
void close ()
void clear ()

Static Public Member Functions

static void setDefaultOutstream (std::ostream &out)
static std::ostream & getDefaultOutstream ()


Detailed Description

This class outputs xml-tags and end-tags.

When the class is put on the stack it prints the start-tag to the outputstream and when leaving scope prints end-tag. The end-tag is the start tag with '/' inserted at the second position.

Tags are specified by text including or not including '<' and '>'. These brackets are recognized and printed also when not passed. Parameters in the tag can be passed as a separate parameter or delimited by space. After the first space everything is parameter and not repeated in the closing tag.

Tags are closed in the destructor, if not already closed explicitely by calling the close()-method.

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6