arabica/include/DOM/CDATASection.hpp

55 lines
1.7 KiB
C++
Raw Permalink Normal View History

2002-06-21 13:16:28 +02:00
#ifndef JEZUK_DOM_CDATASECTION_H
#define JEZUK_DOM_CDATASECTION_H
////////////////////////////
// C++ DOM definition
//
// $Id$
////////////////////////////
2007-09-05 00:55:47 +02:00
#include <DOM/Text.hpp>
2002-06-21 13:16:28 +02:00
2007-09-05 13:47:13 +02:00
namespace Arabica
{
2002-06-21 13:16:28 +02:00
namespace DOM
{
template<class stringT, class string_adaptorT> class CDATASection_impl;
2002-06-21 13:16:28 +02:00
template<class stringT, class string_adaptorT = Arabica::default_string_adaptor<stringT> >
class CDATASection : public Text<stringT, string_adaptorT>
2002-06-21 13:16:28 +02:00
{
typedef Text<stringT, string_adaptorT> TextT;
2002-06-21 13:16:28 +02:00
public:
typedef Node<stringT, string_adaptorT> NodeT;
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 13:16:28 +02:00
{
if(NodeT::impl_ == 0) // null nodes can always be cast
return;
if(rhs.getNodeType() != Node_base::CDATA_SECTION_NODE)
2010-12-10 10:24:34 +01:00
throw DOMBadCast("CDATASection");
2002-06-21 13:16:28 +02:00
} // CDATASection
CDATASection<stringT, string_adaptorT> splitText(int offset)
2002-06-21 13:16:28 +02:00
{
TextT::tImpl()->throwIfReadOnly();
return static_cast<CDATASection<stringT, string_adaptorT> >(TextT::tImpl()->splitText(offset));
2002-06-21 13:16:28 +02:00
} // splitText
}; // class CDATASection
////////////////////////////////////////////////////////////////////
template<class stringT, class string_adaptorT>
class CDATASection_impl : public virtual Text_impl<stringT, string_adaptorT>
2002-06-21 13:16:28 +02:00
{
public:
virtual ~CDATASection_impl() { }
}; // CDATASection_impl
} // namespace DOM
2007-09-05 13:47:13 +02:00
} // namespace Arabica
2002-06-21 13:16:28 +02:00
#endif