Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

s11n::io::tree_builder Class Reference

tree_builder exists mainly so some lex-based code can get access to a non-templated type (so we don't have to hard-code the parsers to a node_type). More...

#include <data_node_format.h>

Inheritance diagram for s11n::io::tree_builder:

s11n::io::data_node_tree_builder< NodeType > List of all members.

Public Member Functions

virtual bool open_node (const std::string &classname, const std::string &nodename)=0
 Starts a new node with the the given class name and node name.

virtual bool close_node ()=0
 Closes the current node.

virtual bool add_property (const std::string &key, const std::string &val)=0
 Sets property key to val for the current node.

virtual size_t node_depth () const =0
 Returns the depth level of the parser, where the root node is 1.

virtual bool change_node_class (const std::string &newclassname)=0
 Changes the implementation class name of the current node.

void auto_delete (bool b)
 If auto_delete() is on (the default) then this object should delete it's children when it is destroyed, otherwise it will not.

bool auto_delete () const
 This is the getter for auto_delete( bool ).


Detailed Description

tree_builder exists mainly so some lex-based code can get access to a non-templated type (so we don't have to hard-code the parsers to a node_type).

It provides only the interface needed by the current lex-based parsers, not some ultimately reusable interface.

It is not functionally useful by itself - it must be subclassed and all of it's virtual methods must be implemented.

Definition at line 76 of file data_node_format.h.


Member Function Documentation

virtual bool s11n::io::tree_builder::add_property const std::string &  key,
const std::string &  val
[pure virtual]
 

Sets property key to val for the current node.

Return value indicates success or failure.

Implemented in s11n::io::data_node_tree_builder< NodeType >.

void s11n::io::tree_builder::auto_delete bool  b  )  [inline]
 

If auto_delete() is on (the default) then this object should delete it's children when it is destroyed, otherwise it will not.

It is up to subclasses to honor this, as this base type does no handling of children.

Definition at line 129 of file data_node_format.h.

virtual bool s11n::io::tree_builder::close_node  )  [pure virtual]
 

Closes the current node.

Return value indicates success or failure.

Implemented in s11n::io::data_node_tree_builder< NodeType >.

virtual bool s11n::io::tree_builder::open_node const std::string &  classname,
const std::string &  nodename
[pure virtual]
 

Starts a new node with the the given class name and node name.

Return value indicates success or failure.

Implemented in s11n::io::data_node_tree_builder< NodeType >.


The documentation for this class was generated from the following file:
Generated on Tue Jul 20 10:46:50 2004 for s11n by doxygen 1.3.7