#include <mi32/errhandler.h>
Public Member Functions | |
| ERRORSTATE (const ERRORSTATE &rhs) | |
| ERRORSTATE () | |
| ~ERRORSTATE () | |
| void | Clear () |
| void | CopyFromThread () |
| void | Disable () |
| void | Enable () |
| const MISTRING & | GetDetails () const |
| ERRVALUE | GetErrValue () const |
| const MISTRING & | GetMessage () const |
| MISTRING & | GetMessageRef () |
| MISTRING & | GetPlaceHolderRef () |
| MISTRING | GetReport () const |
| const MISTRING & | GetTrace () const |
| bool | IsDisabled () const |
| ERRORSTATE & | operator= (const ERRORSTATE &rhs) |
| void | SetDetails (const MISTRING &details) |
| ERRVALUE | SetPosn (ERRVALUE errcode, const char *rcsid, int line) |
Static Public Member Functions | |
| static MISTRING | GetMessageFirstLine (int errcode) |
| static MISTRING | GetMessageSingleLine (int errcode) |
| static ERRORSTATE & | GetThreadErrStateRef () |
| static ERRORSTATE & | GetThreadErrStateRefFast () |
| ERRORSTATE::ERRORSTATE | ( | ) |
Ctor.
| ERRORSTATE::ERRORSTATE | ( | const ERRORSTATE & | rhs | ) |
Copy ctor.
| ERRORSTATE::~ERRORSTATE | ( | ) |
Dtor.
| void ERRORSTATE::Clear | ( | ) |
Clear the current error, Message string, Trace stack, and the Details string.
| void ERRORSTATE::CopyFromThread | ( | ) | [inline] |
Copy the thread's error state instance into 'this'.
| void ERRORSTATE::Disable | ( | ) |
Disable error position reporting.
This is important when cleaning up after an error. It often happens that if you get an error, you need to cleanup (close files, etc) before returning. If something in your cleanup code also causes an error, it will wipe out the error trace that you're trying to report. Therefore, always bracket cleanup code with Diaable()/Enable().
| void ERRORSTATE::Enable | ( | ) |
Reenable error position reporting.
| const MISTRING& ERRORSTATE::GetDetails | ( | ) | const |
Get the details string set by SetDetails().
| ERRVALUE ERRORSTATE::GetErrValue | ( | ) | const |
Get current error value.
| static MISTRING ERRORSTATE::GetMessageFirstLine | ( | int | errcode | ) | [static] |
Get the first line of the Message string generated by 'errcode'.
| MISTRING& ERRORSTATE::GetMessageRef | ( | ) |
Get MISTRING reference to current error message.
This allows subsequent use of the << operator on the string to substitute or append additional error values for -format or $-position codes.
| static MISTRING ERRORSTATE::GetMessageSingleLine | ( | int | errcode | ) | [static] |
Get the Message string as a single line (All newlines replaced with spaces) generated by 'errcode'.
| MISTRING& ERRORSTATE::GetPlaceHolderRef | ( | ) |
In some cases getting the message string is not possible or desired, therefore we need to have a place holder.
Usually a static declaration in a method would suffice, but ERRORSTATE is stored in Thread Local Storage, therefore we need the place holder string in thread local storage.
| MISTRING ERRORSTATE::GetReport | ( | ) | const |
Get the standard combination of "Message + errcode + Trace" string set by SetPosn().
| static ERRORSTATE& ERRORSTATE::GetThreadErrStateRef | ( | ) | [static] |
Get the thread's current error state.
When calling SetErrPosn(), the error is stored in thread local storage. This method allows the caller to get the current error state for the current thread. If copying to another thread, a copy MUST be made in order not to mess up the class internals of the thread's error state. This restores the value of GetLastError() through the call to TlsGetValue() for Windows, so it is slower.
| static ERRORSTATE& ERRORSTATE::GetThreadErrStateRefFast | ( | ) | [static] |
Get the thread's current error state.
When calling SetErrPosn(), the error is stored in thread local storage. This method allows the caller to get the current error state for the current thread. If copying to another thread, a copy MUST be made in order not to mess up the class internals of the thread's error state.
| bool ERRORSTATE::IsDisabled | ( | ) | const |
Determine if error position recording is disabled.
| ERRORSTATE& ERRORSTATE::operator= | ( | const ERRORSTATE & | rhs | ) |
Assignment.
| void ERRORSTATE::SetDetails | ( | const MISTRING & | details | ) |
Set the details string for an error.
This can be used to report any extra details about an error. If set, the standard error dialog will have a "detail..." button which will let the user see the details.
Sets the error value and appends the stack trace line to the Trace string.
1.6.1