#ifndef JEZUK_SimpleDOM_PROCESSINGINSTRUCTIONIMPL_H #define JEZUK_SimpleDOM_PROCESSINGINSTRUCTIONIMPL_H #include #include namespace Arabica { namespace SimpleDOM { template class ProcessingInstructionImpl : public DOM::ProcessingInstruction_impl, public ChildlessNodeImpl { public: typedef ChildlessNodeImpl NodeT; typedef DOM::ProcessingInstruction_impl DOMProcessingInstruction_implT; typedef DOM::Node_impl DOMNode_implT; ProcessingInstructionImpl(DocumentImpl* ownerDoc, stringT target, stringT data) : DOMProcessingInstruction_implT(), NodeT(ownerDoc), target_(target), data_(data) { } // ProcessingInstructionImpl virtual ~ProcessingInstructionImpl() { } /////////////////////////////////////////////////////// // DOM::ProcessingInstruction methods virtual const stringT& getTarget() const { return getNodeName(); } virtual const stringT& getData() const { return getNodeValue(); } virtual void setData(const stringT& data) { setNodeValue(data); } /////////////////////////////////////////////////////// // DOM::Node methods virtual DOM::Node_base::Type getNodeType() const { return DOM::Node_base::PROCESSING_INSTRUCTION_NODE; } // getNodeType virtual const stringT& getNodeName() const { return target_; } // getNodeName virtual const stringT& getNodeValue() const { return data_; } // getNodeValue virtual void setNodeValue(const stringT& nodeValue) { NodeT::throwIfReadOnly(); data_ = nodeValue; } // setNodeValue virtual DOMNode_implT* cloneNode(bool /*deep*/) const { return NodeT::ownerDoc_->createProcessingInstruction(target_, data_); } // cloneNode private: stringT target_; stringT data_; }; // class ProcessingInstructionImpl } // namespace SAX2DOM } // namespace Arabica #endif