Aegis  4.25.D505
/home/archives/aegis/branch.4/branch.25/delta28933.505/libaegis/xmltextread/by_node.h
Go to the documentation of this file.
00001 //
00002 // aegis - project change supervisor
00003 // Copyright (C) 2005, 2006, 2008, 2012 Peter Miller
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or (at
00008 // your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program. If not, see <http://www.gnu.org/licenses/>.
00017 //
00018 
00019 #ifndef LIBAEGIS_XMLTEXTREAD_BY_NODE_H
00020 #define LIBAEGIS_XMLTEXTREAD_BY_NODE_H
00021 
00022 #include <common/symtab/template.h>
00023 #include <libaegis/xmltextread.h>
00024 
00025 class xml_node; // forward
00026 
00031 class xml_text_reader_by_node:
00032     public xml_text_reader
00033 {
00034 public:
00038     virtual ~xml_text_reader_by_node();
00039 
00043     xml_text_reader_by_node(input &deeper, bool validate = false);
00044 
00059     void register_node_handler(const nstring &name, xml_node &handler);
00060 
00061     // See base class for documentation.
00062     void process_node(void);
00063 
00064     // See base class for documentation.
00065     void process_node_end(bool empty);
00066 
00067 private:
00072     symtab<xml_node> handlers;
00073 
00078     nstring_list names;
00079 
00084     xml_node *current_node;
00085 
00090     void push_name(const nstring &name);
00091 
00096     void pop_name(const nstring &name);
00097 
00102     void calculate_current_node_handler(void);
00103 
00107     xml_text_reader_by_node();
00108 
00112     xml_text_reader_by_node(const xml_text_reader_by_node &);
00113 
00117     xml_text_reader_by_node &operator=(const xml_text_reader_by_node &);
00118 };
00119 
00120 #endif // LIBAEGIS_XMLTEXTREAD_BY_NODE_H
00121 // vim: set ts=8 sw=4 et :