WvStreams
|
A variant of WvErrorBase suitable for embedding as a member of your own object, preferably called 'err'. More...
#include <wverror.h>
Public Member Functions | |
int | get () const |
WvString | str () const |
void | set (int _errnum) |
void | set (WvStringParm specialerr) |
void | set (WVSTRING_FORMAT_DECL) |
void | set_both (int _errnum, WvStringParm specialerr) |
void | set (const WvErrorBase &err) |
void | reset () |
virtual bool | isok () const |
By default, returns true if geterr() == 0. More... | |
virtual int | geterr () const |
If isok() is false, return the system error number corresponding to the error, -1 for a special error string (which you can obtain with errstr()) or 0 on end of file. More... | |
virtual WvString | errstr () const |
virtual void | seterr (int _errnum) |
Set the errnum variable – we have an error. More... | |
void | seterr (WvStringParm specialerr) |
void | seterr (WVSTRING_FORMAT_DECL) |
void | seterr (const WvErrorBase &err) |
void | seterr_both (int _errnum, WvStringParm specialerr) |
void | seterr_both (int _errnum, WVSTRING_FORMAT_DECL) |
void | noerr () |
Reset our error state - there's no error condition anymore. | |
Static Public Member Functions | |
static WvString | strerror (int errnum) |
A replacement for the operating system ::strerror() function that can map more kinds of error strings (especially in win32). | |
Protected Attributes | |
int | errnum |
WvString | errstring |
A variant of WvErrorBase suitable for embedding as a member of your own object, preferably called 'err'.
It adds some extra convenience functions to remove function name redundancy, so you can say "obj.err.get()" instead of "obj.err.geterr()", for example.
|
inlinevirtualinherited |
By default, returns true if geterr() == 0.
Might be overridden so that isok() == false even though no error code has been specified.
Reimplemented in IWvStream, WvEncoderStream, WvReadLineStream, WvTCPConn, WvNullListener, WvFdStream, WvLog, WvStream, WvStreamClone, WvSSLStream, WvDBusServer, WvDSAKey, WvTimeStream, WvBufStream, WvListener, WvTimeoutStream, WvIStreamList, and _WvConStream.
Definition at line 39 of file wverror.h.
Referenced by WvListener::isok(), WvStream::isok(), and WvGlob::set().
|
inlinevirtualinherited |
If isok() is false, return the system error number corresponding to the error, -1 for a special error string (which you can obtain with errstr()) or 0 on end of file.
If isok() is true, returns an undefined number.
Reimplemented in WvStreamClone, and WvDBusServer.
Definition at line 48 of file wverror.h.
Referenced by UniIniGen::commit(), UniFileSystemGen::get(), WvDBusServer::geterr(), WvStreamClone::geterr(), WvEncoderStream::isok(), UniConfDaemon::listen(), WvStream::seterr(), and WvMagicCircle::WvMagicCircle().
|
virtualinherited |
Set the errnum variable – we have an error.
If called more than once, seterr() doesn't change the error code away from the previous one. That way, we remember the original cause of our problems.
Subclasses may want to override seterr(int) to shut themselves down (eg. WvStream::close()) when an error condition is set.
Note that seterr(WvString) will call seterr(-1).
Reimplemented in WvStream.
Definition at line 144 of file wverror.cc.
Referenced by WvUnixListener::accept(), WvTCPListener::accept(), WvDSAKey::getpem(), WvGlob::set(), WvStream::seterr(), WvMagicCircle::WvMagicCircle(), WvPam::WvPam(), WvShmZone::WvShmZone(), and WvTCPListener::WvTCPListener().