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