00001
00002
00003
00004
00005
00006
00008
00010
00011
00012
00013 #ifndef _seException_h
00014 #define _seException_h
00015
00021
00022
00023
00024
00025
00026
00027
00028 namespace sedris {
00029
00039 class seException
00040 {
00041 public:
00042
00043 enum {
00045 MAX_EXCEPTION_STR_LEN = 2000
00046 };
00047
00049 enum seExceptionCode
00050 {
00052 NOT_IMPLEMENTED = 0,
00053
00063 TRANSMITTAL_INACCESSIBLE = 3,
00064
00071 UNRESOLVED_TRANSMITTAL,
00072
00094 INVALID_ACCESS_MODE,
00095
00102 UNSUPPORTED_ENCODING,
00103
00110 INVALID_TRANSMITTAL_URN,
00111
00121 UNPUBLISHED_OBJECT,
00122
00128 UNRESOLVED_OBJECT,
00129
00139 INVALID_OBJECT_LABEL = 11,
00140
00145 DELETED_OBJECT = 13,
00146
00153 INACTIONABLE_FAILURE = 1000,
00154
00156 OUT_OF_MEMORY,
00157
00159 INVALID_HANDLE,
00160
00162 FILE_ERROR,
00163
00167 INVALID_DRM_CLASS
00168 };
00169
00171 seException( seExceptionCode code )
00172 {
00173 setCodeAndWhat(code, "No details");
00174 }
00175
00177 seException( seExceptionCode code, const char *what )
00178 {
00179 setCodeAndWhat(code, what);
00180 }
00181
00183 seException( const seException &other )
00184 {
00185 setCodeAndWhat(other.getCode(), other.getWhat());
00186 }
00187
00189 virtual ~seException()
00190 {
00191 }
00192
00194 seException &operator =( const seException &other )
00195 {
00196 setCodeAndWhat(other.getCode(), other.getWhat());
00197 return *this;
00198 }
00199
00201 virtual void setCodeAndWhat( seExceptionCode code, const char *what )
00202 {
00203 int i=0;
00204 _code = code;
00205 while (what && *what && i < MAX_EXCEPTION_STR_LEN)
00206 _what[i] = *what, i++, what++;
00207 _what[i] = 0;
00208 }
00209
00211 virtual seExceptionCode getCode() const
00212 {
00213 return _code;
00214 }
00215
00217 virtual const char *getWhat() const
00218 {
00219 return _what;
00220 }
00221
00222 protected:
00223
00224 seExceptionCode _code;
00225 char _what[MAX_EXCEPTION_STR_LEN+1];
00226 };
00227
00228
00238 void EXPORT_DLL SE_ThrowEx( seException::seExceptionCode code,
00239 const char *format, ... );
00240
00244 void EXPORT_DLL SE_ThrowEx( const char *format, ... );
00245
00246
00247 }
00248
00249 #endif // _seException_h