#include <errcode.h>
List of all members.
Detailed Description
Definition at line 69 of file errcode.h.
Constructor & Destructor Documentation
ERRCODE::ERRCODE |
( |
const char * |
string | ) |
[inline] |
Member Function Documentation
void ERRCODE::error |
( |
const char * |
caller, |
|
|
TessErrorLogCode |
action, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| const |
Definition at line 41 of file errcode.cpp.
{
va_list args;
char msg[MAX_MSG];
char *msgptr = msg;
if (caller != NULL)
msgptr += sprintf (msgptr, "%s:", caller);
msgptr += sprintf (msgptr, "Error:%s", message);
if (format != NULL) {
msgptr += sprintf (msgptr, ":");
va_start(args, format);
#ifdef _WIN32
msgptr += _vsnprintf (msgptr, MAX_MSG - 2 - (msgptr - msg), format, args);
msg[MAX_MSG - 2] = '\0';
strcat (msg, "\n");
#else
msgptr += vsprintf (msgptr, format, args);
msgptr += sprintf (msgptr, "\n");
#endif
va_end(args);
}
else
msgptr += sprintf (msgptr, "\n");
fprintf(stderr, msg);
int* p = NULL;
switch (action) {
case DBG:
case TESSLOG:
return;
case TESSEXIT:
case ABORT:
if (!*p)
abort();
default:
BADERRACTION.error ("error", ABORT, NULL);
}
}
The documentation for this class was generated from the following files: