00001
00002 #ifndef MIX_ATTRIBUTE_H_
00003 #define MIX_ATTRIBUTE_H_
00004
00005 #include "classes.h"
00006 #include "misc.h"
00007 #include "XMLString.h"
00008 #include "NamedNode.h"
00009 #include "Value.h"
00010
00011 namespace MiX{
00017 template <class Char,class Traits,class XMLTraits>
00018 class Attribute : public Value<Char,Traits,XMLTraits> ,
00019 public NamedNode<Char,Traits,XMLTraits>{
00020 public:
00021 MiX_Template_Typedef(Char,Traits,XMLTraits);
00022 typedef Attribute<Char,Traits,XMLTraits> this_type;
00023 typedef NodeContainer<Char,Traits,XMLTraits> nodecontainer_type;
00024 protected:
00031 Attribute(const string_type& name,const string_type& val)
00032 : Value<Char,Traits,XMLTraits>(val),
00033 NamedNode<Char,Traits,XMLTraits>(name){ };
00039 Attribute(const this_type& src){ };
00040 public:
00042 virtual ~Attribute()throw() { };
00044 virtual NodeType getType()const { return Node_Attribute; };
00050 static NodeType type(){ return Node_Attribute; };
00056 virtual string_type toString(bool dmy=false,int dmy2=0)const;
00057
00070 static this_type& create(const string_type& key,const string_type& val,nodecontainer_type& parent);
00071
00072 friend class DOM_Parser<Char,Traits,XMLTraits>;
00073 };
00074 }
00075
00076 #ifndef MIX_ATTRIBUTE_CPP_
00077 #include "Attribute.cpp"
00078 #endif//MIX_ATTRIBUTE_CPP_
00079
00080 #endif