Aegis  4.25.D505
Public Member Functions | Private Member Functions | Private Attributes
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)
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 (void)
 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 31 of file by_node.h.


Constructor & Destructor Documentation

The destructor.

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

The constructor.

The default constructor. Do not use.

The copy constructor. Do not use.


Member Function Documentation

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.

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::process_node ( void  ) [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:
emptyWhether 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::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:
nameThe 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.
handlerThe object which will process the named nodes. Note 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.

Field Documentation

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 84 of file by_node.h.

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

Definition at line 72 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 78 of file by_node.h.


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