CppSQLite3Exception::CppSQLite3Exception(const int nErrCode, TCHAR* szErrMess, bool bDeleteMsg/*=true*/) : mnErrCode(nErrCode) { #ifdef _UNICODE swprintf(mpszErrMess, _T("%s[%d]: %s"), errorCodeAsString(nErrCode), nErrCode, szErrMess ? szErrMess : _T("")); #else sprintf(mpszErrMess, "%s[%d]: %s", errorCodeAsString(nErrCode), nErrCode, szErrMess ? szErrMess : ""); #endif // if (bDeleteMsg && szErrMess) // { // sqlite3_free(szErrMess); // } }
CSQLite3Exception(const int nErrCode, char* szErrMess, bool bDeleteMsg=true) { m_pErrMess = sqlite3_mprintf("%s[%d]: %s", errorCodeAsString(nErrCode), nErrCode, szErrMess ? szErrMess : ""); if (bDeleteMsg && szErrMess) { sqlite3_free(szErrMess); } }
CppSQLite3Exception::CppSQLite3Exception(const int nErrCode, const char* szErrMess, bool bDeleteMsg/*=true*/) : mnErrCode(nErrCode) { mpszErrMess = sqlite3_mprintf("%s[%d]: %s", errorCodeAsString(nErrCode), nErrCode, szErrMess ? szErrMess : ""); if (bDeleteMsg && szErrMess) { sqlite3_free((void*)szErrMess); } }
CppSQLite3Exception::CppSQLite3Exception(const int nErrCode, LPTSTR szErrMess, bool bDeleteMsg/*=true*/) : mnErrCode(nErrCode) { mpszErrMess=new TCHAR[ szErrMess ? _tcslen(szErrMess)+50 : 50]; _stprintf(mpszErrMess, _T("%s[%d]: %s"), errorCodeAsString(nErrCode), nErrCode, szErrMess ? szErrMess : _T("")); if (bDeleteMsg && szErrMess) { _sqlite3_free((char*)szErrMess); } }
CppSQLite3Exception::CppSQLite3Exception(const int nErrCode, const CString& errMessage) : mnErrCode(nErrCode) { msErrMessage = WizFormatString3("%1[%2]: %3", errorCodeAsString(nErrCode), WizIntToStr(nErrCode), errMessage); }