00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _ENUM_T_H
00029 #define _ENUM_T_H
00030
00031 #include <string>
00032 #include <map>
00033 #ifdef WIN32
00034 #include <config-win.h>
00035 #include <mysql.h>
00036 typedef unsigned __int64 uint64_t;
00037 #define strcasecmp stricmp
00038 #else
00039 #include <stdint.h>
00040 #endif
00041
00042 #ifdef MYSQLW_NAMESPACE
00043 namespace MYSQLW_NAMESPACE {
00044 #endif
00045
00046
00048 class enum_t
00049 {
00050 public:
00051 enum_t(std::map<std::string, uint64_t>& );
00052
00053 const std::string& String();
00054 unsigned short Value();
00055 const char *c_str();
00056
00057 void operator=(const std::string& );
00058 void operator=(unsigned short);
00059 bool operator==(const std::string& );
00060 bool operator==(unsigned short);
00061 bool operator!=(const std::string& );
00062
00063 private:
00064 std::map<std::string, uint64_t>& m_mmap;
00065 std::map<unsigned short, std::string> m_vmap;
00066 unsigned short m_value;
00067
00068 };
00069
00070
00071 #ifdef MYSQLW_NAMESPACE
00072 }
00073 #endif
00074
00075 #endif // _ENUM_T_H