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 typename nodelist_type::iterator nodelist_iter;
00022 private:
00023 const static typename nodelist_type::iterator dmy_it;
00024 protected:
00031 Comment(const string_type& val) : Value<charT,char_traits,xml_traits>(val) { };
00037 Comment(const this_type& src){ };
00038
00039 public:
00041 virtual ~Comment()throw() { };
00043 virtual NodeType getType()const { return Node_Comment; };
00049 static NodeType type() { return Node_Comment; } ;
00056 virtual string_type toString(bool is_indent=false,const string_type& idt=xml_traits::indent(),int indent_off=0)const;
00063 node_type& clone(nodecontainer_type& parent,const nodelist_iter& it = dmy_it) const
00064 { return create(getValue(),dynamic_cast<element_type&>(parent),it); }
00074 static this_type& create(const string_type& str,element_type& parent,const typename nodelist_type::iterator& it = dmy_it);
00075
00076 friend class DOM_Parser<charT,char_traits,xml_traits>;
00077
00078 };
00079 }
00080
00081 #ifndef MiX_COMMENT_CPP_
00082 #include "Comment.cpp"
00083 #endif
00084
00085 #endif