00001 #ifndef __cmt_error_h__ 00002 #define __cmt_error_h__ 00003 00004 #include "cmt_std.h" 00005 #include "cmt_string.h" 00006 00007 class CmtError 00008 { 00009 public: 00010 00011 typedef enum 00012 { 00013 ok, 00014 symbol_not_found, 00015 pattern_not_found, 00016 syntax_error, 00017 command_not_implemented, 00018 package_not_found, 00019 path_not_found, 00020 version_conflict, 00021 file_access_error, 00022 execution_error, 00023 cannot_lock, 00024 cannot_write_lock, 00025 cannot_run_lock_command, 00026 cannot_unlock, 00027 cannot_run_unlock_command, 00028 cannot_remove_lock, 00029 conflicting_lock 00030 } code; 00031 00032 static void clear (); 00033 static code get_last_error_code (); 00034 static bool has_pending_error (); 00035 static const cmt_string& get_error_name (code error); 00036 static void set (code error, const cmt_string& text); 00037 static cmt_string get_last_error (); 00038 static void print (); 00039 }; 00040 00041 #endif