2002-06-21 13:16:28 +02:00
|
|
|
#ifndef JEZUK_DOM_CDATASECTION_H
|
|
|
|
#define JEZUK_DOM_CDATASECTION_H
|
|
|
|
|
|
|
|
////////////////////////////
|
|
|
|
// C++ DOM definition
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
////////////////////////////
|
|
|
|
|
|
|
|
#include <DOM/Text.h>
|
|
|
|
|
|
|
|
namespace DOM
|
|
|
|
{
|
|
|
|
template<class stringT> class CDATASection_impl;
|
|
|
|
|
|
|
|
template<class stringT>
|
|
|
|
class CDATASection : public Text<stringT>
|
|
|
|
{
|
2004-09-18 01:17:51 +02:00
|
|
|
typedef Text<stringT> TextT;
|
2002-06-21 13:16:28 +02:00
|
|
|
public:
|
|
|
|
CDATASection() : Text<stringT>() { }
|
|
|
|
explicit CDATASection(CDATASection_impl<stringT>* impl) : Text<stringT>(impl) { }
|
|
|
|
CDATASection(const CDATASection& rhs) : Text<stringT>(rhs) { }
|
2005-08-30 13:35:12 +02:00
|
|
|
explicit CDATASection(const Node<stringT>& rhs) : Text<stringT>(rhs, 0)
|
2002-06-21 13:16:28 +02:00
|
|
|
{
|
2005-10-22 05:17:39 +02:00
|
|
|
if(rhs.getNodeType() != Node_base::CDATA_SECTION_NODE)
|
2005-12-09 12:46:53 +01:00
|
|
|
//throw std::runtime_error("bad_cast: Cannot convert Node to CDATA section");
|
|
|
|
throw std::bad_cast();
|
2002-06-21 13:16:28 +02:00
|
|
|
} // CDATASection
|
|
|
|
|
|
|
|
CDATASection<stringT> splitText(int offset)
|
|
|
|
{
|
2004-09-18 01:17:51 +02:00
|
|
|
TextT::tImpl()->throwIfReadOnly();
|
|
|
|
return static_cast<CDATASection<stringT> >(TextT::tImpl()->splitText(offset));
|
2002-06-21 13:16:28 +02:00
|
|
|
} // splitText
|
|
|
|
}; // class CDATASection
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
template<class stringT>
|
|
|
|
class CDATASection_impl : public virtual Text_impl<stringT>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~CDATASection_impl() { }
|
|
|
|
}; // CDATASection_impl
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace DOM
|
|
|
|
|
|
|
|
#endif
|