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>
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. |
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.
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.
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 >, and s11n::io::data_node_tree_builder< node_type >.
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.
Referenced by s11n::io::data_node_tree_builder< node_type >::reset(), and s11n::io::data_node_tree_builder< node_type >::~data_node_tree_builder().
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.
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 >, and s11n::io::data_node_tree_builder< node_type >.
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 >, and s11n::io::data_node_tree_builder< node_type >.
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 >, and s11n::io::data_node_tree_builder< node_type >.
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 >, and s11n::io::data_node_tree_builder< node_type >.
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 >, and s11n::io::data_node_tree_builder< node_type >.
Definition at line 145 of file data_node_format.hpp.