2002-06-21 13:16:28 +02:00
|
|
|
#ifndef JEZUK_DOM_PROCESSINGINSTRUCTION_H
|
|
|
|
#define JEZUK_DOM_PROCESSINGINSTRUCTION_H
|
|
|
|
|
|
|
|
////////////////////////////
|
|
|
|
// C++ DOM definition
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
////////////////////////////
|
|
|
|
|
2007-09-05 00:55:47 +02:00
|
|
|
#include <DOM/Node.hpp>
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
namespace DOM
|
|
|
|
{
|
|
|
|
|
|
|
|
template<class stringT> class ProcessingInstruction_impl;
|
|
|
|
|
|
|
|
template<class stringT>
|
|
|
|
class ProcessingInstruction : public Node<stringT>
|
|
|
|
{
|
2004-09-18 01:17:51 +02:00
|
|
|
typedef Node<stringT> NodeT;
|
2002-06-21 13:16:28 +02:00
|
|
|
public:
|
|
|
|
ProcessingInstruction() : Node<stringT>(0) { }
|
|
|
|
explicit ProcessingInstruction(ProcessingInstruction_impl<stringT>* impl) : Node<stringT>(dynamic_cast<Node_impl<stringT>*>(impl)) { }
|
|
|
|
ProcessingInstruction(const ProcessingInstruction& rhs) : Node<stringT>(rhs) { }
|
|
|
|
explicit ProcessingInstruction(const Node<stringT>& rhs) : Node<stringT>(rhs)
|
|
|
|
{
|
|
|
|
if(rhs.getNodeType() != Node<stringT>::PROCESSING_INSTRUCTION_NODE)
|
|
|
|
throw std::bad_cast();
|
|
|
|
}
|
|
|
|
|
2005-12-09 16:55:29 +01:00
|
|
|
const stringT& getTarget() const { return piImpl()->getTarget(); }
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2005-12-09 16:57:21 +01:00
|
|
|
const stringT& getData() const { return piImpl()->getData(); }
|
2002-06-21 13:16:28 +02:00
|
|
|
void setData(const stringT& data) { piImpl()->setData(data); }
|
|
|
|
|
|
|
|
private:
|
2004-09-18 01:17:51 +02:00
|
|
|
ProcessingInstruction_impl<stringT>* piImpl() const { return dynamic_cast<ProcessingInstruction_impl<stringT>*>(*NodeT::impl_); }
|
2002-06-21 13:16:28 +02:00
|
|
|
}; // class DocumentFragment
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////
|
|
|
|
template<class stringT>
|
|
|
|
class ProcessingInstruction_impl : virtual public Node_impl<stringT>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~ProcessingInstruction_impl () { }
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
// DOM::ProcessingInstruction methods
|
2005-12-09 16:55:29 +01:00
|
|
|
virtual const stringT& getTarget() const = 0;
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2005-12-09 16:57:21 +01:00
|
|
|
virtual const stringT& getData() const = 0;
|
2002-06-21 13:16:28 +02:00
|
|
|
virtual void setData(const stringT& data) = 0;
|
|
|
|
}; // class ProcessingInstruction_impl
|
|
|
|
|
|
|
|
} // namespace DOM
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|