#ifndef JEZUK_DOM_DOCUMENTTYPE_H #define JEZUK_DOM_DOCUMENTTYPE_H //////////////////////////// // C++ DOM definition // // $Id$ //////////////////////////// #include #include #include namespace DOM { template class Document_impl; template class DocumentType_impl; template class DocumentType : public Node { typedef Node NodeT; public: DocumentType() : Node(0) { } DocumentType(DocumentType_impl* impl) : Node(impl) { } DocumentType(const DocumentType& rhs) : Node(rhs) { } explicit DocumentType(const Node& rhs) : Node(rhs) { if(rhs.getNodeType() != Node::DOCUMENT_TYPE_NODE) throw std::bad_cast(); } // DocumentType const stringT& getName() const { return dtImpl()->getName(); } const NamedNodeMap getEntities() const { return NamedNodeMap(dtImpl()->getEntities()); } const NamedNodeMap getNotations() const { return NamedNodeMap(dtImpl()->getNotations()); } stringT getPublicId() const { return dtImpl()->getPublicId(); } stringT getSystemId() const { return dtImpl()->getSystemId(); } stringT getInternalSubset() const { return dtImpl()->getInternalSubset(); } protected: DocumentType_impl* dtImpl() const { return dynamic_cast*>(*NodeT::impl_); } typedef DOMImplementation DOMImplementationT; friend class DOMImplementation; }; // class DocumentType ////////////////////////////////////////////////////////// template class DocumentType_impl : virtual public Node_impl { public: virtual ~DocumentType_impl() { } ///////////////////////////////////////////// // DOM::DocumentType methods virtual const stringT& getName() const = 0; virtual NamedNodeMap_impl* getEntities() = 0; virtual NamedNodeMap_impl* getNotations() = 0; virtual stringT getPublicId() const = 0; virtual stringT getSystemId() const = 0; virtual stringT getInternalSubset() const = 0; }; // class DocumentType_impl } // namespace DOM #endif