00001
00002 #ifndef MIX_DOMEXCEPTION_H_
00003 #define MIX_DOMEXCEPTION_H_
00004
00005 #include <exception>
00006 #include "misc.h"
00007 #include "classes.h"
00008
00009 namespace MiX{
00015 template <class Char,class Traits,class XMLTraits>
00016 class DOM_Exception : public MiX_STD::exception{
00017 public:
00018 MiX_Template_Typedef(Char,Traits,XMLTraits);
00019 typedef Element<Char,Traits,XMLTraits> this_type;
00020 typedef NodeContainer<Char,Traits,XMLTraits> nodecontainer_type;
00021 private:
00022 const node_type* node_;
00023 ErrorType type_;
00024 MiX_STD::string data_;
00025 public:
00027 DOM_Exception(const node_type* node,ErrorType type,const std::string& data) : node_(node),type_(type),data_(data){ };
00029 virtual ~DOM_Exception() throw(){ };
00031 const char* what()const throw(){ return data_.c_str(); }
00033 const node_type* getNode()const throw(){ return node_; }
00035 ErrorType getType() const throw() { return type_; };
00036 };
00037 }
00038
00039 #ifndef MIX_DOMEXCEPTION_CPP_
00040 #include "DOM_Exception.cpp"
00041 #endif//MIX_DOMEXCEPTION_CPP_
00042
00043 #endif