xml_text_reader_by_node Class Reference

#include <by_node.h>

Inheritance diagram for xml_text_reader_by_node:

xml_text_reader

Public Member Functions

virtual ~xml_text_reader_by_node ()
 xml_text_reader_by_node (input &deeper, bool validate=false)
void register_node_handler (const nstring &name, xml_node &handler)
void process_node ()
void process_node_end (bool empty)

Private Member Functions

void push_name (const nstring &name)
void pop_name (const nstring &name)
void calculate_current_node_handler ()
 xml_text_reader_by_node ()
 xml_text_reader_by_node (const xml_text_reader_by_node &)
xml_text_reader_by_nodeoperator= (const xml_text_reader_by_node &)

Private Attributes

symtab< xml_nodehandlers
nstring_list names
xml_nodecurrent_node

Detailed Description

The xml_text_reader_by_node class is used to represent an XML text reader which dispatches nodes to their registered handlers.

Definition at line 32 of file by_node.h.


Constructor & Destructor Documentation

virtual xml_text_reader_by_node::~xml_text_reader_by_node (  )  [virtual]

The destructor.

xml_text_reader_by_node::xml_text_reader_by_node ( input deeper,
bool  validate = false 
)

The constructor.

xml_text_reader_by_node::xml_text_reader_by_node (  )  [private]

The default constructor. Do not use.

xml_text_reader_by_node::xml_text_reader_by_node ( const xml_text_reader_by_node  )  [private]

The copy constructor. Do not use.


Member Function Documentation

void xml_text_reader_by_node::register_node_handler ( const nstring name,
xml_node handler 
)

The register_node_handler method is sued to register a node name and a corresponding handler.

Parameters:
name The name of the node to be handled. Nodes are named ratyher like UNIX paths, they are slash separated. E.g. parent/ child/ subchild, etc. NO wildcards are available.
handler The object which will adela with the named nodes. Noth that (depending on the DTD) this may be called from more than one instance, but always with begin/end pairs, so it is possible to keep track.

void xml_text_reader_by_node::process_node (  )  [virtual]

The process_node method is used to process each node as it is read from the input. Each derived class must supply its own process_node method.

Implements xml_text_reader.

void xml_text_reader_by_node::process_node_end ( bool  empty  )  [virtual]

The process_node_end method is only ever called for ELEMENT nodes, and only after all of the attributes have been given to the process_node method.

The default implimentation does nothing.

Parameters:
empty Whether or not the original ELEMENT node was empty.

Reimplemented from xml_text_reader.

void xml_text_reader_by_node::push_name ( const nstring name  )  [private]

the push_name method is used to tack action when the beginning of an entity or element is seen.

void xml_text_reader_by_node::pop_name ( const nstring name  )  [private]

the pop_name method is used to tack action when the end of an entity or element is seen.

void xml_text_reader_by_node::calculate_current_node_handler (  )  [private]

The calculate_current_node_handler method is used to set the current_node from the name at the top of the names stack.

xml_text_reader_by_node& xml_text_reader_by_node::operator= ( const xml_text_reader_by_node  )  [private]

The assignment operator. Do not use.


Field Documentation

The handlers instance variable is used to remember what handler have been registered for what nodes.

Definition at line 73 of file by_node.h.

The name instance variable is used to rememeber the stack of names (elements and entities) seen to date.

Definition at line 79 of file by_node.h.

The current_node instance variable is used to cache the node handler corresponding to the name at the top of the name stack.

Definition at line 85 of file by_node.h.


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

Generated on Wed Mar 12 23:37:46 2008 for Aegis by  doxygen 1.5.5