diff options
author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
---|---|---|
committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
commit | b71531b42b3325fd6079a7039aae8641262c8adf (patch) | |
tree | a5b9aa16924c541fcb424ee9460b1ac7f5a89352 /modules/CIAO/tools/Config_Handlers/XSCRT/Parser.hpp | |
parent | a0f67cc97c0050d907145e312135b60c0125e56e (diff) | |
download | ATCD-DS-main.tar.gz |
branching/taggingDS-main
Diffstat (limited to 'modules/CIAO/tools/Config_Handlers/XSCRT/Parser.hpp')
-rw-r--r-- | modules/CIAO/tools/Config_Handlers/XSCRT/Parser.hpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/modules/CIAO/tools/Config_Handlers/XSCRT/Parser.hpp b/modules/CIAO/tools/Config_Handlers/XSCRT/Parser.hpp new file mode 100644 index 00000000000..5fa1e827f8d --- /dev/null +++ b/modules/CIAO/tools/Config_Handlers/XSCRT/Parser.hpp @@ -0,0 +1,67 @@ +// file : XSCRT/Parser.hpp +// author : Boris Kolpackov <boris@dre.vanderbilt.edu> +// cvs-id : $Id$ + +#ifndef XSCRT_PARSER_HPP +#define XSCRT_PARSER_HPP + +#include <string> + +#include "XSCRT/XML.hpp" + +namespace XSCRT +{ + template <typename C> + class Parser + { + public: + Parser (XML::Element<C> const& e) + : e_ (e.dom_element ()->getChildNodes ()), ei_ (0), + a_ (e.dom_element ()->getAttributes ()), ai_ (0) + { + } + + bool + more_elements () const + { + return e_->getLength () > ei_; + } + + XML::Element<C> + next_element () + { + return XML::Element<C> (XML::dom_cast <xercesc::DOMElement*> (e_->item (ei_++))); + } + + bool + more_attributes () const + { + return a_->getLength () > ai_; + } + + XML::Attribute<C> + next_attribute () + { + return XML::Attribute<C> ( + XML::dom_cast <xercesc::DOMAttr*> (a_->item (ai_++))); + } + + private: + xercesc::DOMNodeList const* e_; + unsigned long ei_; + + xercesc::DOMNamedNodeMap const* a_; + unsigned long ai_; + + private: + Parser (Parser const&); + + void + operator= (Parser const&); + }; +} + +#include "XSCRT/Parser.ipp" +#include "XSCRT/Parser.tpp" + +#endif // XSCRT_PARSER_HPP |