#ifndef JEZUK_DOM_PROCESSINGINSTRUCTION_H #define JEZUK_DOM_PROCESSINGINSTRUCTION_H //////////////////////////// // C++ DOM definition // // $Id$ //////////////////////////// #include namespace DOM { template class ProcessingInstruction_impl; template class ProcessingInstruction : public Node { typedef Node NodeT; public: ProcessingInstruction() : Node(0) { } explicit ProcessingInstruction(ProcessingInstruction_impl* impl) : Node(dynamic_cast*>(impl)) { } ProcessingInstruction(const ProcessingInstruction& rhs) : Node(rhs) { } explicit ProcessingInstruction(const Node& rhs) : Node(rhs) { if(rhs.getNodeType() != Node::PROCESSING_INSTRUCTION_NODE) throw std::bad_cast(); } const stringT& getTarget() const { return piImpl()->getTarget(); } const stringT& getData() const { return piImpl()->getData(); } void setData(const stringT& data) { piImpl()->setData(data); } private: ProcessingInstruction_impl* piImpl() const { return dynamic_cast*>(*NodeT::impl_); } }; // class DocumentFragment ////////////////////////////////////////////////////////// template class ProcessingInstruction_impl : virtual public Node_impl { public: virtual ~ProcessingInstruction_impl () { } //////////////////////////////////////////////////////// // DOM::ProcessingInstruction methods virtual const stringT& getTarget() const = 0; virtual const stringT& getData() const = 0; virtual void setData(const stringT& data) = 0; }; // class ProcessingInstruction_impl } // namespace DOM #endif