00001
00002
00003 #ifndef MIX_TEXT_H_
00004 #define MIX_TEXT_H_
00005
00006 #include "classes.h"
00007 #include "misc.h"
00008 #include "XMLString.h"
00009 #include "NodeList.h"
00010 #include "extern/noncopyable.hpp"
00011
00012 namespace MiX{
00014 template <class charT,class traitsT>
00015 class Text : boost::noncopyable,
00016 public Value<charT,traitsT>{
00017 public:
00018 MiX_Template_Typedef(charT,traitsT);
00019 typedef Text<charT,traitsT> this_type;
00020 typedef NodeContainer<charT,traitsT> nodecontainer_type;
00021 protected:
00022 const static typename NodeList<charT,traitsT>::iterator dmy_it;
00029 Text(const string_type& val) : Value<charT,traitsT>(val){ };
00030 public:
00032 virtual ~Text()throw(){ };
00034 virtual NodeType getType()const{ return Node_Text; };
00040 static NodeType type(){ return Node_Text; };
00047 virtual string_type toString(bool indent=false,int indent_off=0)const;
00054 this_type& clone(element_type& parent,const typename nodelist_type::iterator& it = dmy_it) const
00055 { return text_type::create(getValue(),parent,it); };
00056
00064 static this_type& create(const string_type& str,element_type& parent,const typename nodelist_type::iterator& it = dmy_it);
00065
00066 friend class DOM_Parser<charT,traitsT>;
00067 };
00068 }
00069
00070 #ifndef MIX_TEXT_CPP_
00071 #include "Text.cpp"
00072 #endif
00073
00074 #endif