arabica/include/DOM/Simple/CommentImpl.hpp

49 lines
1.3 KiB
C++
Raw Normal View History

2002-06-21 13:16:28 +02:00
#ifndef JEZUK_SimpleDOM_COMMENTIMPL_H
#define JEZUK_SimpleDOM_COMMENTIMPL_H
2007-09-05 00:55:47 +02:00
#include <DOM/Comment.hpp>
#include <DOM/Simple/CharacterDataImpl.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 SimpleDOM
{
template<class stringT, class string_adaptorT>
class CommentImpl : public DOM::Comment_impl<stringT>,
public CharacterDataImpl<stringT, string_adaptorT>
{
typedef CharacterDataImpl<stringT, string_adaptorT> CharDataT;
2002-06-21 13:16:28 +02:00
public:
CommentImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
CharacterDataImpl<stringT, string_adaptorT>(ownerDoc, data)
{
} // CommentImpl
virtual ~CommentImpl() { }
///////////////////////////////////////////////////////
// DOM::Node methods
virtual DOM::Node_base::Type getNodeType() const
{
return DOM::Node_base::COMMENT_NODE;
} // getNodeType
virtual DOM::Node_impl<stringT>* cloneNode(bool deep) const
{
return CharDataT::ownerDoc_->createComment(CharDataT::getData());
2002-06-21 13:16:28 +02:00
} // cloneNode
2005-12-09 15:09:32 +01:00
virtual const stringT& getNodeName() const
2002-06-21 13:16:28 +02:00
{
2005-12-09 15:09:32 +01:00
static const stringT comment = string_adaptorT::construct_from_utf8("#comment");
return comment;
2002-06-21 13:16:28 +02:00
} // getNodeName
}; // class CommentImpl
} // namespace SAX2DOM
2007-09-05 13:47:13 +02:00
} // namespace Arabica
2002-06-21 13:16:28 +02:00
#endif