00001
00002
00003 #ifndef MIX_DOCUMENT_H_
00004 #define MIX_DOCUMENT_H_
00005
00006 #include "classes.h"
00007 #include "misc.h"
00008 #include "XMLString.h"
00009 #include "extern/noncopyable.hpp"
00010
00011 namespace MiX{
00017 template <class charT,class traitsT>
00018 class Document : boost::noncopyable,
00019 public NodeContainer<charT,traitsT>{
00020 public:
00021 MiX_Template_Typedef(charT,traitsT);
00022 typedef Document<charT,traitsT> this_type;
00023 typedef NodeContainer<charT,traitsT> nodecontainer_type;
00024 protected:
00031 Document() { };
00032 public:
00034 virtual ~Document()throw() { };
00036 virtual NodeType getType() const{ return Node_Document; };
00042 static NodeType type(){ return Node_Document; } ;
00044 element_type& getRoot()const;
00051 virtual string_type toString(bool is_indent=false,int indent_off=0)const;
00058 attribute_type& operator[](const string_type& name){
00059 return getAttribute(name);
00060 }
00064 this_type& clone()const;
00071 static this_type& create(const string_type& rootname);
00072
00073 friend class DOM_Parser<charT,traitsT>;
00074 };
00075 }
00076
00077 #ifndef MIX_DOCUMENT_CPP_
00078 #include "Document.cpp"
00079 #endif
00080
00081 #endif