00001
00002
00003 #ifndef MiX_COMMENT_H_
00004 #define MiX_COMMENT_H_
00005
00006 #include "classes.h"
00007 #include "misc.h"
00008 #include "XMLString.h"
00009 #include "NodeList.h"
00010 #include "Value.h"
00011 #include "extern/noncopyable.hpp"
00012
00013 namespace MiX{
00014
00015 template <class charT,class char_traits,class xml_traits>
00016 class Comment : boost::noncopyable,
00017 public Value<charT,char_traits,xml_traits>{
00018 public:
00019 MiX_Template_Typedef(charT,char_traits,xml_traits);
00020 typedef Comment<charT,char_traits,xml_traits> this_type;
00021 typedef NodeContainer<charT,char_traits,xml_traits> nodecontainer_type;
00022 typedef typename nodelist_type::iterator nodelist_iter;
00023 private:
00024 const static typename nodelist_type::iterator dmy_it;
00025 protected:
00032 Comment(const string_type& val) : Value<charT,char_traits,xml_traits>(val) { };
00038 Comment(const this_type& src){ };
00039
00040 public:
00042 virtual ~Comment()throw() { };
00044 virtual NodeType getType()const { return Node_Comment; };
00050 static NodeType type() { return Node_Comment; } ;
00057 virtual string_type toString(bool is_indent=false,int indent_off=0)const;
00064 node_type& clone(nodecontainer_type& parent,const nodelist_iter& it = dmy_it) const
00065 { return create(getValue(),dynamic_cast<element_type&>(parent),it); }
00075 static this_type& create(const string_type& str,element_type& parent,const typename nodelist_type::iterator& it = dmy_it);
00076
00077 friend class DOM_Parser<charT,char_traits,xml_traits>;
00078
00079 };
00080 }
00081
00082 #ifndef MiX_COMMENT_CPP_
00083 #include "Comment.cpp"
00084 #endif
00085
00086 #endif