#ifndef JEZUK_SIMPLEDOM_CDATASECTIONIMPL_H #define JEZUK_SIMPLEDOM_CDATASECTIONIMPL_H #include namespace SimpleDOM { template class CDATASectionImpl : public DOM::CDATASection_impl, public CharacterDataImpl { typedef CharacterDataImpl CharDataT; public: CDATASectionImpl(DocumentImpl* ownerDoc, const stringT& data) : CharacterDataImpl(ownerDoc, data) { } // CDATASectionImpl virtual ~CDATASectionImpl() { } ////////////////////////////////////////////////////////////////// // DOM::CDATASection methods // on a compiler which implemented covariant return types this would return DOM::CDATASection virtual DOM::Text_impl* splitText(int offset) { CharDataT::throwIfReadOnly(); stringT second = CharDataT::substringData(offset, CharDataT::getLength() - offset); CharDataT::deleteData(offset, CharDataT::getLength() - offset); CDATASectionImpl* splitNode = new CDATASectionImpl(CharDataT::getOwnerDoc(), second); CharDataT::getParentNode()->insertBefore(splitNode, CharDataT::getNextSibling()); return splitNode; } // splitText /////////////////////////////////////////////////////// // DOM::Node methods virtual DOM::Node_base::Type getNodeType() const { return DOM::Node_base::CDATA_SECTION_NODE; } // getNodeType virtual DOM::Node_impl* cloneNode(bool deep) const { return CharDataT::ownerDoc_->createCDATASection(CharDataT::getData()); } // cloneNode virtual stringT getNodeName() const { return string_adaptorT::construct_from_utf8("#cdata-section"); } // getNodeName }; // class CDATAImpl } // namespace SAX2DOM #endif