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

WvErrorBase Class Reference

#include <wverror.h>

Inheritance diagram for WvErrorBase:

[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.

This object is most useful for using as a base class of your own class, for historical/backwards compatibility reasons. Consider using a WvError instead, and making it a member of your class instead of a parent.


Public Member Functions

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 WvErrorBase &err)
void noerr ()
 Reset our error state - there's no error condition anymore.

Protected Attributes

int errnum
WvString errstring


Member Function Documentation

virtual bool WvErrorBase::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 WvRSAKey, and WvX509Mgr.

virtual int WvErrorBase::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 WvX509Mgr.

void WvErrorBase::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).


The documentation for this class was generated from the following files:
Generated on Sun Apr 3 14:47:09 2005 for WvStreams by  doxygen 1.4.2