Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

DataXML::DataObjectTreeCreator Class Reference

Traversal & creation of the object tree (utility for parsers). More...

#include <DataObject.h>

Collaboration diagram for DataXML::DataObjectTreeCreator:

Collaboration graph
[legend]
List of all members.

Public Methods

 DataObjectTreeCreator ()
bool empty ()
 no current object yet (nothing parsed in, true at the begining). More...

bool finished ()
 root object entirely parsed-in (true at the end). More...

DataObjectroot ()
 get root object (null if empty()). More...

DataObjectcurrent ()
 get current data object. More...

void createAndOpenSubObject ()
 append empty data object at end and open it (becomes current). if tree is empty, then create root and open it. More...

void backToParent ()
 go up in the tree (parent object becomes current). More...

void appendTextAsSubObject ()
 append new child as text object with the text in current_freemarkup() buffer and clean the buffer. More...

std::string current_freemarkup ()
 buffer with current free markup, if "" then no free markup being read. More...

void append_next_freemarkup_segment (std::string text)

Private Attributes

DataObjectm_current_obj
std::stack<DataObject*> m_parent_stack
DataObject m_root_obj
bool m_finished
std::string m_freemarkup_buffer

Detailed Description

Initially the tree is empty, so root object is created first.

Using this tree creator, you can get the following behaviour of your parser:

The first XML element encountered is treated as a root element. It is not possible to have multiple root elements (only first XML element may be read-in). The rest is ignored.

Definition at line 204 of file DataObject.h.


Constructor & Destructor Documentation

DataXML::DataObjectTreeCreator::DataObjectTreeCreator ( ) [inline]
 

Definition at line 208 of file DataObject.h.


Member Function Documentation

void DataXML::DataObjectTreeCreator::appendTextAsSubObject ( )
 

void DataXML::DataObjectTreeCreator::append_next_freemarkup_segment ( std::string text )
 

void DataXML::DataObjectTreeCreator::backToParent ( )
 

void DataXML::DataObjectTreeCreator::createAndOpenSubObject ( )
 

DataObject * DataXML::DataObjectTreeCreator::current ( )
 

std::string DataXML::DataObjectTreeCreator::current_freemarkup ( )
 

bool DataXML::DataObjectTreeCreator::empty ( )
 

bool DataXML::DataObjectTreeCreator::finished ( )
 

DataObject * DataXML::DataObjectTreeCreator::root ( )
 


Member Data Documentation

DataObject * DataXML::DataObjectTreeCreator::m_current_obj [private]
 

Definition at line 241 of file DataObject.h.

bool DataXML::DataObjectTreeCreator::m_finished [private]
 

Definition at line 244 of file DataObject.h.

std::string DataXML::DataObjectTreeCreator::m_freemarkup_buffer [private]
 

Definition at line 245 of file DataObject.h.

std::stack< DataObject *> DataXML::DataObjectTreeCreator::m_parent_stack<DataObject*> [private]
 

Definition at line 242 of file DataObject.h.

DataObject DataXML::DataObjectTreeCreator::m_root_obj [private]
 

Definition at line 243 of file DataObject.h.


The documentation for this class was generated from the following file:
Generated at Tue Jan 28 15:35:29 2003 for DataXML by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001