arabica/include/DOM/Comment.hpp

44 lines
1 KiB
C++
Raw Normal View History

2002-06-21 13:16:28 +02:00
#ifndef JEZUK_DOM_COMMENT_H
#define JEZUK_DOM_COMMENT_H
////////////////////////////
// C++ DOM definition
//
// $Id$
////////////////////////////
2007-09-05 00:55:47 +02:00
#include <DOM/CharacterData.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 Comment_impl;
template<class stringT>
class Comment : public CharacterData<stringT>
{
public:
Comment() : CharacterData<stringT>() { }
explicit Comment(Comment_impl<stringT>* impl) : CharacterData<stringT>(dynamic_cast<Comment_impl<stringT>*>(impl)) { }
Comment(const Comment& rhs) : CharacterData<stringT>(rhs) { }
explicit Comment(const Node<stringT>& rhs) : CharacterData<stringT>(rhs)
{
if(dynamic_cast<Comment_impl<stringT>*>(rhs.impl()) == 0)
throw std::bad_cast();
} // Comment
}; // class Comment
////////////////////////////////////////////////////////////////////
template<class stringT>
class Comment_impl : virtual public CharacterData_impl<stringT>
{
public:
virtual ~Comment_impl() { }
}; // Comment_impl
} // namespace DOM
2007-09-05 13:47:13 +02:00
} // namespace Arabica
2002-06-21 13:16:28 +02:00
#endif