/******************************************************** Exception object Copyright 2000 Eugene Kuznetsov (divx@euro.ru) *********************************************************/ #ifndef __except_h #define __except_h #include #include /** * * The idea is to use error codes for non-fatal problems * ( for example, problem in decompressing one frame is not fatal * for video decoder ) and exceptions for problems which leave * object in unusable state. GenError is an intermediate case. * */ class BaseError { char* module; char* description; const char* file; char* severity; int line; public: ~BaseError() { delete module; delete description; delete severity; } BaseError(const char* sev, const char* mod, const char* desc, const char* f=0, int l=0):file(f),line(l) { module=new char[std::strlen(mod)+1]; std::strcpy(module, mod); severity=new char[std::strlen(sev)+1]; std::strcpy(severity, sev); description=new char[std::strlen(desc)+1]; std::strcpy(description, desc); } BaseError(const BaseError& f) { module=new char[std::strlen(f.module)+1]; std::strcpy(module, f.module); description=new char[std::strlen(f.description)+1]; std::strcpy(description, f.description); severity=new char[std::strlen(f.severity)+1]; std::strcpy(severity, f.severity); file=f.file; line=f.line; } void Print() { std::cerr<