arabica/DOM/Simple/CommentImpl.h

45 lines
1.2 KiB
C
Raw Normal View History

2002-06-21 13:16:28 +02:00
#ifndef JEZUK_SimpleDOM_COMMENTIMPL_H
#define JEZUK_SimpleDOM_COMMENTIMPL_H
#include <DOM/Comment.h>
#include <DOM/Simple/CharacterDataImpl.h>
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
virtual stringT getNodeName() const
{
2005-09-30 23:36:11 +02:00
return string_adaptorT::construct_from_utf8("#comment");
2002-06-21 13:16:28 +02:00
} // getNodeName
}; // class CommentImpl
} // namespace SAX2DOM
#endif