IOException.h

00001 // $Id: IOException.h 21 2010-09-05 04:18:17Z cschwarz1 $
00002 
00003 #ifndef BASE_IOEXCEPTION_H
00004 #define BASE_IOEXCEPTION_H
00005 
00006 #include "Exception.h"
00007 
00008 namespace base {
00010 
00014     class PPBASE_EXPORT IOException: public Exception {
00015     public:
00017         enum {
00018             errDir = 1,             
00019             errFile,                
00020             errMutex,               
00021             errSig,                 
00022             errSock,                
00023             errSockNoSuchHost,      
00024             errSockNoSuchService,   
00025             errSockAcceptTimeout,   
00026             errSockConnectTimeout,  
00027             errSockReadTimeout,     
00028             errSockWriteTimeout,    
00029             errSys,                 
00030             errThread,              
00031             errDNS,                 
00032             errIConv,               
00033             errDL,                  
00034             errMMap,                
00035             errEnv,                 
00036             errPipe,                
00037             errShMem                
00038         };
00039 
00041 
00047         IOException(int errcode, int errn, const char *fmt = NULL, ...)
00048         #ifdef __GNUC__
00049             __attribute__((format(printf, 4, 5)));
00050         #else
00051             ;
00052         #endif
00053 
00055 
00061         static void allowErrorPopups(bool allow = true);
00062 
00064 
00067         int getErrno() const;
00068 
00070 
00073         virtual String toString() const;
00074 
00075     private:
00076         int _errno;  
00077     };
00078 }
00079 
00080 #endif