Merge pull request #2317 from jwillemsen/jwi-deleteop
[ACE_TAO.git] / ACE / ace / XML_Utils / XSCRT / Parser.hpp
blob0f7fb87edb3f1443d40efe4d1e67205ab78ba201
1 // file : XSCRT/Parser.hpp
2 // author : Boris Kolpackov <boris@dre.vanderbilt.edu>
3 #ifndef XSCRT_PARSER_HPP
4 #define XSCRT_PARSER_HPP
6 #include <string>
8 #include "ace/XML_Utils/XSCRT/XML.hpp"
10 namespace XSCRT
12 template <typename C>
13 class Parser
15 public:
16 Parser (XML::Element<C> const& e)
17 : e_ (e.dom_element ()->getChildNodes ()), ei_ (0),
18 a_ (e.dom_element ()->getAttributes ()), ai_ (0)
22 bool
23 more_elements () const
25 return e_->getLength () > ei_;
28 XML::Element<C>
29 next_element ()
31 return XML::Element<C> (XML::dom_cast <xercesc::DOMElement*> (e_->item (ei_++)));
34 bool
35 more_attributes () const
37 return a_->getLength () > ai_;
40 XML::Attribute<C>
41 next_attribute ()
43 return XML::Attribute<C> (
44 XML::dom_cast <xercesc::DOMAttr*> (a_->item (ai_++)));
47 private:
48 xercesc::DOMNodeList const* e_;
49 unsigned long ei_;
51 xercesc::DOMNamedNodeMap const* a_;
52 unsigned long ai_;
54 private:
55 Parser (Parser const&);
57 void
58 operator= (Parser const&);
62 #endif // XSCRT_PARSER_HPP