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.hpp>

Inheritance diagram for s11n::io::tree_builder:

s11n::io::data_node_tree_builder< NodeType >

List of all members.

Public Member Functions

 tree_builder ()
virtual ~tree_builder ()
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 ).
virtual void reset ()
 Should reset the state of this object to it's default.


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 72 of file data_node_format.hpp.


Constructor & Destructor Documentation

s11n::io::tree_builder::tree_builder (  )  [inline]

Definition at line 75 of file data_node_format.hpp.

virtual s11n::io::tree_builder::~tree_builder (  )  [inline, virtual]

Definition at line 77 of file data_node_format.hpp.


Member Function Documentation

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 >.

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::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 >.

virtual size_t s11n::io::tree_builder::node_depth (  )  const [pure virtual]

Returns the depth level of the parser, where the root node is 1.

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

virtual bool s11n::io::tree_builder::change_node_class ( const std::string &  newclassname  )  [pure virtual]

Changes the implementation class name of the current node.

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 125 of file data_node_format.hpp.

bool s11n::io::tree_builder::auto_delete (  )  const [inline]

This is the getter for auto_delete( bool ).

Definition at line 133 of file data_node_format.hpp.

virtual void s11n::io::tree_builder::reset (  )  [inline, virtual]

Should reset the state of this object to it's default.

How it sets the auto_delete() flag is implementation-dependent. The default implementation does nothing, as this type has no state other than the auto_delete() flag.

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

Definition at line 145 of file data_node_format.hpp.


The documentation for this class was generated from the following file:
Generated on Sun Apr 27 13:16:05 2008 for libs11n by  doxygen 1.5.3