#include <cxxtools/xmltag.h>
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 ¶meter, 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 () |
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.