00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_ERROR_H
00012 #define CAL_ERROR_H
00013
00014 #include "cal3d/global.h"
00015
00016
00017 namespace CalError
00018 {
00019 enum Code
00020 {
00021 OK = 0,
00022 INTERNAL,
00023 INVALID_HANDLE,
00024 MEMORY_ALLOCATION_FAILED,
00025 FILE_NOT_FOUND,
00026 INVALID_FILE_FORMAT,
00027 FILE_PARSER_FAILED,
00028 INDEX_BUILD_FAILED,
00029 NO_PARSER_DOCUMENT,
00030 INVALID_ANIMATION_DURATION,
00031 BONE_NOT_FOUND,
00032 INVALID_ATTRIBUTE_VALUE,
00033 INVALID_KEYFRAME_COUNT,
00034 INVALID_ANIMATION_TYPE,
00035 FILE_CREATION_FAILED,
00036 FILE_WRITING_FAILED,
00037 INCOMPATIBLE_FILE_VERSION,
00038 NO_MESH_IN_MODEL,
00039 BAD_DATA_SOURCE,
00040 NULL_BUFFER,
00041 INVALID_MIXER_TYPE,
00042 MAX_ERROR_CODE
00043 };
00044
00045 CAL3D_API Code getLastErrorCode();
00046 CAL3D_API const std::string& getLastErrorFile();
00047 CAL3D_API int getLastErrorLine();
00048 CAL3D_API const std::string& getLastErrorText();
00049 CAL3D_API void printLastError();
00050 CAL3D_API void setLastError(Code code, const std::string& strFile, int line, const std::string& strText = "");
00051
00052 CAL3D_API std::string getErrorDescription(Code code);
00053
00054 inline std::string getLastErrorDescription() {
00055 return getErrorDescription(getLastErrorCode());
00056 }
00057 }
00058
00059 #endif