SOAPException.h

00001 // $Id: SOAPException.h 21 2010-09-05 04:18:17Z cschwarz1 $
00002 
00003 #ifndef BASE_SOAP_SOAPEXCEPTION_H
00004 #define BASE_SOAP_SOAPEXCEPTION_H
00005 
00006 #include "libppbase/base/Exception.h"
00007 
00008 namespace base_soap {
00010 
00014     class PPBASE_SOAP_EXPORT SOAPException: public base::Exception {
00015     public:
00017         enum {
00018             errDOM = 1,                 
00019             errEmptyDocument,           
00020             errNoParameters,            
00021             errBadParameterStructure,   
00022             errNoSuchAttachment,        
00023             errOutOfMemory,             
00024             errProtocol,                
00025             errConfig,                  
00026             errIO,                      
00027             errDB,                      
00028             errBadClass,                
00029             errMissingInstance,         
00030             errLockInstance,            
00031             errBadMethod,               
00032             errBadArgument,             
00033             errNoSuchChildNode,         
00034             errNoSuchParameter,         
00035             errTypeCast,                
00036             errInputMissing,            
00037             errSelectionMissing,        
00038             errFileMissing,             
00039             errFileTooSmall,            
00040             errFileTooLarge,            
00041             errInvalid,                 
00042             errInvalidChar,             
00043             errBadLength,               
00044             errTooShort,                
00045             errTooLong,                 
00046             errDuplicate,               
00047             errSigned,                  
00048             errPrecision,               
00049             errPermissionDenied,        
00050             errRemote                   
00051         };
00052 
00053         static const char *_cgierrors[];    
00054 
00056         SOAPException();
00057 
00059 
00064         SOAPException(int errcode, const char *fmt = NULL, ...)
00065         #ifdef __GNUC__
00066             __attribute__((format(printf, 3, 4)))
00067         #endif
00068             ;
00069 
00071 
00077         SOAPException(int errcode, const base::Exception &ex, const char *fmt = NULL, ...)
00078         #ifdef __GNUC__
00079             __attribute__((format(printf, 4, 5)))
00080         #endif
00081             ;
00082 
00084 
00094         SOAPException(const base::String &field, int errcode, size_t len = 0, size_t min = 0, size_t max = 0, const base::String &character = "",
00095             const char *fmt = NULL, ...)
00096         #ifdef __GNUC__
00097             __attribute__((format(printf, 8, 9)))
00098         #endif
00099             ;
00100 
00102         virtual ~SOAPException() throw();
00103 
00105 
00108         const char *getCgiError() const;
00109 
00111 
00114         const base::String &getChar() const;
00115 
00117 
00120         const base::String &getField() const;
00121 
00123 
00126         size_t getLength() const;
00127 
00129 
00132         size_t getMaxLength() const;
00133 
00135 
00138         size_t getMinLength() const;
00139 
00140     private:
00141         base::String _char;     
00142         base::String _field;    
00143         size_t      _len;      
00144         size_t      _maxlen;   
00145         size_t      _minlen;   
00146     };
00147 }
00148 
00149 #endif