Public Methods | |
status (bool ok, string err=string()) | |
Constructor. Uses a default success or failure string if err is empty. | |
status (string err) | |
Constructor for failure state. | |
status (const char *err) | |
Constructor for failure state. | |
operator const void * () const | |
Returns a non-null pointer if and only if the status is "good." Useful for casting to a boolean. | |
string | as_string () const |
Returns the status as a string. | |
Static Public Methods | |
status | good () |
Returns a "good" status object. | |
status | bad (string err=string()) |
Returns a "bad" status object. | |
status | syserr (int errcode, string err=string()) |
Returns a "bad" status object using the system error code err, and optionally a further description, as the failure reason. | |
status | syserr (string err=string()) |
Returns a "bad" status object using the error code contained in errno, and optionally a further description, as the failure reason. |
|
Constructor. Uses a default success or failure string if err is empty.
|
|
Constructor for failure state.
|
|
Constructor for failure state.
|
|
Returns the status as a string.
|
|
Returns a "bad" status object.
|
|
Returns a "good" status object.
|
|
Returns a non-null pointer if and only if the status is "good." Useful for casting to a boolean.
|
|
Returns a "bad" status object using the error code contained in errno, and optionally a further description, as the failure reason.
|
|
Returns a "bad" status object using the system error code err, and optionally a further description, as the failure reason.
|