An Open Architecture for Reconfigurable Tracking based on XML | Contact

ot::XMLWriter Class Reference

This class writes out the contents of the Context as a valid XML file. More...

#include <XMLWriter.h>

Collaboration diagram for ot::XMLWriter:

Collaboration graph
List of all members.

Public Member Functions

 XMLWriter (Context &context_, unsigned int indent_=2)
virtual ~XMLWriter ()
void write (const char *file)
unsigned int getIndent ()
void setIndent (unsigned int ind)

Protected Attributes

unsigned int indent

Detailed Description

This class writes out the contents of the Context as a valid XML file.

It can be used to store a changed tracker graph in a file or some other device accessible by an output stream. It can be reused on a context as often as desired and will allways record the current status of the context, as stored in the XML elements.

Gerhard Reitmayr

Definition at line 67 of file XMLWriter.h.

Constructor & Destructor Documentation

ot::XMLWriter::XMLWriter ( Context context_,
unsigned int  indent_ = 2 

constructor, takes a context to work with.

context_ the context to write out
indent_ the indentation step to use, default value is 2

Definition at line 81 of file XMLWriter.cxx.

ot::XMLWriter::~XMLWriter (  )  [virtual]

Definition at line 85 of file XMLWriter.cxx.

Member Function Documentation

unsigned int ot::XMLWriter::getIndent (  )  [inline]

returns the current indentation step

indentation step

Definition at line 96 of file XMLWriter.h.

void ot::XMLWriter::setIndent ( unsigned int  ind  )  [inline]

sets the indentation step

ind the new value

Definition at line 103 of file XMLWriter.h.

void ot::XMLWriter::write ( const char *  file  ) 

writes the tracker graph and configuration to a file given as the parameter.

It creates the file if necessary. If the file exists, it will be overwritten by the new configuration data.

file char array containing the file name.

Definition at line 90 of file XMLWriter.cxx.

References context, ot::Context::getRootNode(), ot::Node::parent, and ot::writeNode().

Referenced by main().

Member Data Documentation

the context to write out

Definition at line 71 of file XMLWriter.h.

Referenced by write().

unsigned int ot::XMLWriter::indent [protected]

amount of indentation per level

Definition at line 73 of file XMLWriter.h.

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

copyright (c) 2006 Graz University of Technology