00001 00014 #ifndef _cConnect_h 00015 #define _cConnect_h 00016 00017 #include "TypesDef.h" 00018 #include <string> 00019 00020 using std::string; 00021 00022 const Int MAX_SZ_CONNECT = 4; 00023 00024 const Int USERNAME = 0; 00025 const Int PASSWORD = 1; 00026 const Int RDMS = 2; 00027 const Int HOST = 3; 00028 00029 class cConnect 00030 { 00031 private: 00032 string m_sConnectDataStr[MAX_SZ_CONNECT]; 00033 00035 static cConnect *m_pConnectHandler; 00036 00038 cConnect(void); 00039 00040 Bool m_bConnection; 00041 00042 string m_sDbName; 00043 00044 public: 00045 00047 ~cConnect(void); 00048 00049 static cConnect *GetConnectInstance(void); 00050 00051 Bool GetConnection(void); 00052 void SetConnection(Bool bConnection); 00053 00054 const string *GetAllDataStr(void); 00055 void SetAllDataStr(string *s); 00056 00057 void SetUsername(string sUsername); 00058 void SetPassword(string sPassword); 00059 void SetRdms (string sDatabase); 00060 void SetHost (string sHost); 00061 00062 string GetUsername (void); 00063 string GetPassword (void); 00064 string GetRdms (void); 00065 string GetHost (void); 00066 00067 void SetDbName (string sDbName); 00068 string GetDbName (void); 00069 }; 00070 00071 #endif // _cConnect_h