#ifndef JEZUK_DOM_TEXT_H #define JEZUK_DOM_TEXT_H //////////////////////////// // C++ DOM definition // // $Id$ //////////////////////////// #include namespace DOM { template class Text_impl; template class Text : public CharacterData { typedef CharacterData CharDataT; public: Text() : CharacterData() { } explicit Text(Text_impl* impl) : CharacterData(impl) { } Text(const Text& rhs) : CharacterData(rhs) { } explicit Text(const Node& rhs) : CharacterData(rhs) { if(dynamic_cast*>(rhs.impl()) == 0) throw std::bad_cast("Cannot cast Node to Text"); } // Text Text splitText(int offset) { return tImpl()->splitText(offset); } // splitText protected: Text_impl* tImpl() const { return dynamic_cast*>(CharDataT::impl()); } }; // class Text //////////////////////////////////////////////////////////////////// template class Text_impl : virtual public CharacterData_impl { public: virtual ~Text_impl() { } //////////////////////////////////////////////////////////// // DOM::Text methods virtual Text_impl* splitText(int offset) = 0; }; // Text_impl } // namespace DOM #endif