Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

WvError Class Reference

#include <wverror.h>

Inherited by IWvStream, WvBdbHashBase, WvMagicCircle, WvRSAKey, and WvShmZone.

Collaboration diagram for WvError:

[legend]
List of all members.

Detailed Description

A class for managing error numbers and strings.

It can have either a system error value, like those defined in errno.h, or an arbitrary error string. In either case, it can return a string representation of the error message.

Definition at line 19 of file wverror.h.

Public Member Functions

 WvError ()
virtual ~WvError ()
virtual bool isok () const
 By default, returns true if geterr() == 0.
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.
virtual WvString errstr () const
virtual void seterr (int _errnum)
 Set the errnum variable -- we have an error.
void seterr (WvStringParm specialerr)
void seterr (WVSTRING_FORMAT_DECL)
void seterr (const WvError &err)
void noerr ()
 Reset our error state - there's no error condition anymore.

Protected Attributes

int errnum
WvString errstring


Constructor & Destructor Documentation

WvError::WvError  )  [inline]
 

Definition at line 26 of file wverror.h.

WvError::~WvError  )  [virtual]
 

Definition at line 14 of file wverror.cc.


Member Function Documentation

WvString WvError::errstr  )  const [virtual]
 

Reimplemented in WvHTTPStream, and WvStreamClone.

Definition at line 20 of file wverror.cc.

References errnum, and errstring.

Referenced by UniIniGen::commit(), WvStreamClone::errstr(), main(), UniIniGen::refresh(), seterr(), UniConfDaemon::setupsslsocket(), UniConfDaemon::setuptcpsocket(), UniConfDaemon::setupunixsocket(), WvX509Mgr::WvX509Mgr(), and WvHttpPool::~WvHttpPool().

virtual int WvError::geterr  )  const [inline, virtual]
 

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 WvHTTPStream, and WvStreamClone.

Definition at line 44 of file wverror.h.

Referenced by UniIniGen::commit(), WvStreamClone::geterr(), WvEncoderStream::isok(), WvConf::load_file(), WvLockDev::lock(), main(), WvHTTPStream::pre_select(), UniIniGen::refresh(), WvConf::save(), seterr(), WvMagicCircle::WvMagicCircle(), and WvHttpPool::~WvHttpPool().

virtual bool WvError::isok  )  const [inline, virtual]
 

By default, returns true if geterr() == 0.

Might be overridden so that isok() == false even though no error code has been specified.

Reimplemented in UniClientConn, WvBufStream, WvDailyEvent, WvDsp, WvEncoderStream, WvFDStream, WvHTTPStream, WvIStreamList, WvLog, WvPamStream, WvSSLStream, IWvStream, WvStream, WvStreamClone, WvStreamList, WvTCPConn, WvTimeoutStream, WvTimeStream, WvFileWatcher, and UniConfDaemon.

Definition at line 35 of file wverror.h.

Referenced by WvStreamList::isok(), WvStream::isok(), main(), WvBdbHash< K, D >::Iter::next(), WvRSAEncoder::WvRSAEncoder(), WvRSAStream::WvRSAStream(), and WvX509Mgr::WvX509Mgr().

void WvError::noerr  )  [inline]
 

Reset our error state - there's no error condition anymore.

Definition at line 65 of file wverror.h.

void WvError::seterr const WvError err  ) 
 

Definition at line 64 of file wverror.cc.

References errstr(), geterr(), and seterr().

void WvError::seterr WVSTRING_FORMAT_DECL   )  [inline]
 

Reimplemented in WvStream.

Definition at line 60 of file wverror.h.

References WVSTRING_FORMAT_CALL.

void WvError::seterr WvStringParm  specialerr  ) 
 

Reimplemented in WvStream.

Definition at line 54 of file wverror.cc.

References errstring, seterr(), and WvStringParm.

void WvError::seterr int  _errnum  )  [virtual]
 

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 47 of file wverror.cc.

References errnum.

Referenced by main(), WvStream::seterr(), seterr(), WvMagicCircle::WvMagicCircle(), WvRSAKey::WvRSAKey(), and WvShmZone::WvShmZone().


Member Data Documentation

int WvError::errnum [protected]
 

Definition at line 22 of file wverror.h.

Referenced by errstr(), and seterr().

WvString WvError::errstring [protected]
 

Definition at line 23 of file wverror.h.

Referenced by errstr(), and seterr().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 15:08:17 2004 for WvStreams by  doxygen 1.3.9.1