20 std::vector<std::pair<std::string, unsigned int>>* pErrorList;
25 static unsigned int maxErrorCode = 0;
28 std::string s = std::string(
NVL( errorName,
"" ) );
31 unsigned code = maxErrorCode;
33 unsigned errorIndex = -1;
35 if (pErrorList ==
NULL)
37 pErrorList =
new std::vector<std::pair<std::string, unsigned int>>;
40 for (
int i = 0; (i < static_cast<int>(pErrorList->size())) && (errorIndex == -1); i++)
42 if ((*pErrorList)[i].first.compare(errorName) == 0)
48 if( errorIndex == -1 ) {
49 pErrorList->push_back(std::pair<std::string, unsigned int>(errorName, code));
53 code = (*pErrorList)[errorIndex].second;
62 unsigned errorIndex = -1;
65 for (
int i = 0; (i < static_cast<int>(pErrorList->size())) && (errorIndex == -1); i++)
67 if ((*pErrorList)[i].second == errorCode)
75 return (*pErrorList)[errorIndex].first.c_str();
unsigned int errorcode(const char *errorName)
get new error code
common error code definition
#define NVL(checkVal, replaceVal)
const char * errorstring(unsigned int errorCode)
get error string for an existing error
void errorcleanup(void)
deallocate error strings object