X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FException.hh;h=8300746fc57c284411487e7548fbb100fadf73a8;hp=a63f761ad8b857e8c63e81ca11e68df799f73828;hb=d11d8c63ab52c7f6eca2815e47cd6401e72f2c8c;hpb=8a1acac01b444dccf8b57cedf08392ada2e473c1 diff --git a/src/Moof/Exception.hh b/src/Moof/Exception.hh index a63f761..8300746 100644 --- a/src/Moof/Exception.hh +++ b/src/Moof/Exception.hh @@ -31,6 +31,7 @@ #include #include +#include #include @@ -42,10 +43,10 @@ class Exception : public std::exception { public: - explicit Exception(unsigned code, const char* what = "") + explicit Exception(unsigned code, const std::string& what = "") { mWhat[sizeof(mWhat)-1] = '\0'; - strncpy(mWhat, what, sizeof(mWhat)-1); + strncpy(mWhat, what.c_str(), sizeof(mWhat)-1); mCode = code; } virtual ~Exception() throw() {} @@ -75,14 +76,15 @@ namespace ErrorCode { enum Code { NONE = 0, + ALC_INIT, // description FASTEVENTS_INIT, // description FILE_NOT_FOUND, // path of missing file RESOURCE_NOT_FOUND, // name of missing resource SCRIPT_ERROR, // description SDL_INIT, // description SDL_VIDEOMODE, // - - UNKNOWN_AUDIO_FORMAT, // - - UNKNOWN_IMAGE_FORMAT, // - + UNKNOWN_AUDIO_FORMAT, // name of resource + UNKNOWN_IMAGE_FORMAT, // name of resource }; } // namespace ErrorCode