#ifndef JEZUK_DOM_NAMEDNODEMAP_H #define JEZUK_DOM_NAMEDNODEMAP_H //////////////////////////// // C++ DOM definition // // $Id$ //////////////////////////// #include namespace DOM { template class Node; template class NamedNodeMap_impl; template class NamedNodeMap { public: NamedNodeMap() : impl_(0) { } explicit NamedNodeMap(NamedNodeMap_impl* impl) : impl_(impl) { } NamedNodeMap(const NamedNodeMap& rhs) : impl_(rhs.impl_) { } virtual ~NamedNodeMap() { } bool operator==(const NamedNodeMap& rhs) const { return impl_ == rhs.impl_; } bool operator!=(const NamedNodeMap& rhs) const { return impl_ != rhs.impl_; } bool operator==(int dummy) const { return impl_ == dummy; } bool operator!=(int dummy) const { return impl_ != dummy; } NamedNodeMap& operator=(const NamedNodeMap& rhs) { impl_ = rhs.impl_; return *this; } // operator= Node getNamedItem(const stringT& name) const { return Node(impl_->getNamedItem(name)); } Node setNamedItem(const Node& arg) { return Node(impl_->setNamedItem(arg)); } Node removeNamedItem(const stringT& name) const { return Node(impl_->removeNamedItem(name)); } Node item(unsigned int index) const { return Node(impl_->item(index)); } unsigned int getLength() const { return impl_->getLength(); } Node getNamedItemNS(const stringT& namespaceURI, const stringT& localName) const { return Node(impl_->getNamedItemNS(namespaceURI, localName)); } // getNamedItemNS Node setNamedItemNS(const Node& arg) { return Node(impl_->setNamedItemNS(arg)); } Node removeNamedItemNS(const stringT& namespaceURI, const stringT& localName) const { return Node(impl_->removeNamedItem(namespaceURI, localName)); } // removeNamedItemNS private: Proxy > impl_; }; // class NamedNodeMap //////////////////////////////////////////////////// // NamedNodeMap_impl template class Node_impl; template class NamedNodeMap_impl { public: virtual ~NamedNodeMap_impl() { } /////////////////////////////////////////////////////// // Ref counting virtual void addRef() = 0; virtual void releaseRef() = 0; /////////////////////////////////////////////////////// // NamedNodeMap methods virtual Node_impl* getNamedItem(const stringT& name) const = 0; virtual Node_impl* setNamedItem(Node_impl* arg) = 0; virtual Node_impl* removeNamedItem(const stringT& name) = 0; virtual Node_impl* item(unsigned int index) const = 0; virtual unsigned int getLength() const = 0; virtual Node_impl* getNamedItemNS(const stringT& namespaceURI, const stringT& localName) const = 0; virtual Node_impl* setNamedItemNS(Node_impl* arg) = 0; virtual Node_impl* removeNamedItemNS(const stringT& namespaceURI, const stringT& localName) = 0; }; // class NamedNodeMap_impl } // namespace DOM #endif