#include <serror.h>
Collaboration diagram for SError:
Public Member Functions | |
SError () | |
Default constructor: success. | |
SError (const SError &e) | |
Copy constructor. | |
SError (GError *&g) | |
SError (const char *str, int _code, int _domain=-1) | |
Set an error specifying a string, a code and a domain. | |
SError (const TLString &str, int _code, int _domain=-1) | |
Set an error specifying a string, a code and a domain. | |
~SError () | |
Destructor. | |
SError & | operator= (GError *&g) |
SError & | operator= (const SError &e) |
Assignment operator. | |
operator bool () const | |
Check for error. Retuens 1 on error and 0 on success. | |
bool | operator! () const |
Check for error. Returns 1 on success and 0 on error. | |
void | clear () |
Clear error (change it into "success"). | |
const TLString & | msg () const |
Get the error message:. | |
void | AppendMsg (const TLString &str) |
Append to the error message; will separate parts by ";". | |
void | AppendMsg (const char *str) |
Append to the error message; will separate parts by ";". | |
int | code () const |
Get the error code. | |
Private Member Functions | |
void | _assign (GError *&g) |
Private Attributes | |
TLString | errmsg |
string representation of error | |
int | ecode |
Numerical error code; 0 -> success, <0 -> warning. | |
int | edomain |
Error domain for code; -1 -> unset. |
The class contains a string representation of the error to be easily displayed to the user.
A numerical representation of the error is provided with the code and domain variables. The code is the numerical error code inside the error domain. For example, two error domains could be 0 for "file error" and 1 for "network error" and the numerical error codes can be chosen idependently in both domains (e.g. code 1 in domain 0 may mean "file does not exist" while code 1 in domain 1 may mean "connection refused").
The code using this library is responsible for understanding the domain and code values; they are not altered by the SError class.
Definition at line 54 of file serror.h.
|
Default constructor: success.
|
|
Copy constructor.
|
|
Assign a GError from GLib. This will destroy the GError setting the passed pointer to NULL. |
|
Set an error specifying a string, a code and a domain.
|
|
Set an error specifying a string, a code and a domain.
|
|
Destructor.
|
|
Definition at line 21 of file serror_g.cc. References ecode, edomain, and errmsg. Referenced by operator=(), and SError(). |
|
Append to the error message; will separate parts by ";".
Definition at line 29 of file serror.cc. References errmsg. |
|
Append to the error message; will separate parts by ";".
Definition at line 21 of file serror.cc. References errmsg. Referenced by ParseFloatSpec(). |
|
Clear error (change it into "success").
Definition at line 97 of file serror.h. References ecode, edomain, and errmsg. Referenced by _ParseInt(), _ParseUInt(), and TLString::ParseString(). |
|
Get the error code.
Definition at line 110 of file serror.h. References ecode. |
|
Get the error message:.
Definition at line 101 of file serror.h. References errmsg. Referenced by _DoParseFile(), _ParseInt(), _ParseUInt(), and main(). |
|
Check for error. Retuens 1 on error and 0 on success.
Definition at line 90 of file serror.h. References ecode. |
|
Check for error. Returns 1 on success and 0 on error.
Definition at line 93 of file serror.h. References ecode. |
|
Assignment operator.
|
|
Assign a GError from GLib. This will destroy the GError setting the passed pointer to NULL. Definition at line 83 of file serror.h. References _assign(). |
|
Numerical error code; 0 -> success, <0 -> warning.
Definition at line 58 of file serror.h. Referenced by _assign(), clear(), code(), operator bool(), operator!(), operator=(), and SError(). |
|
Error domain for code; -1 -> unset.
Definition at line 59 of file serror.h. Referenced by _assign(), clear(), operator=(), and SError(). |
|
string representation of error
Definition at line 57 of file serror.h. Referenced by _assign(), AppendMsg(), clear(), msg(), operator=(), and SError(). |