00001
00002 #ifndef __MIX_PARSINGEXCEPTION_H_
00003 #define __MIX_PARSINGEXCEPTION_H_
00004
00005 #include <exception>
00006 #include "misc.h"
00007
00008 namespace MiX{
00015 class ParsingException : public std::exception{
00016 long index_;
00017 ErrorType type_;
00018 std::string data_;
00019 public:
00021 ParsingException(long index,ErrorType type,const std::string& data) : index_(index),type_(type),data_(data){ };
00023 virtual ~ParsingException() throw(){ };
00025 const char* what()const throw(){ return data_.c_str(); };
00027 long getIndex()const{ return index_; };
00029 ErrorType getType()const{
00030 return type_;
00031 };
00032 };
00033 }
00034
00035 #ifndef MIX_PARSINGEXCEPTION_CPP_
00036 #include "ParsingException.cpp"
00037 #endif
00038
00039 #endif