#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 { 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(); } stringT getTarget() const { return piImpl()->getTarget(); } stringT getData() const { return piImpl()->getData(); } void setData(const stringT& data) { piImpl()->setData(data); } private: ProcessingInstruction_impl* piImpl() const { return dynamic_cast*>(*impl_); } }; // class DocumentFragment ////////////////////////////////////////////////////////// template class ProcessingInstruction_impl : virtual public Node_impl { public: virtual ~ProcessingInstruction_impl () { } //////////////////////////////////////////////////////// // DOM::ProcessingInstruction methods virtual stringT getTarget() const = 0; virtual stringT getData() const = 0; virtual void setData(const stringT& data) = 0; }; // class ProcessingInstruction_impl } // namespace DOM #endif