00001 #ifndef SCT_IOEXCEPTIONS_H
00002 #define SCT_IOEXCEPTIONS_H
00003
00004 #include "Sct/Exception.h"
00005
00006 namespace Sct {
00007
00014 class IoException : public Exception {
00015 public:
00019 IoException(const string& msg, const string& file, int line) throw();
00020
00025 IoException(Throwable& cause, const string& file, int line) throw();
00026
00030 IoException(const string& msg, Throwable& cause, const string& file, int line) throw();
00031
00032 protected:
00033 IoException() throw() {}
00034 };
00035
00037 typedef IoException IoError;
00038
00045 class IsException : public IoException {
00046 public:
00050 IsException(int status, const string& msg, const string& file, int line) throw();
00051
00056 IsException(int status, Throwable& cause, const string& file, int line) throw();
00057
00061 IsException(int status, const string& msg, Throwable& cause, const string& file, int line) throw();
00062
00064 int getStatus() const throw();
00065 virtual shared_ptr<Throwable> clone() const throw();
00066 virtual string getMessage() const throw();
00067
00068 protected:
00069 IsException() throw() {}
00070
00071 int status;
00072 };
00073
00074
00080 class FileException : public IoException {
00081 public:
00085 FileException(const string& fileName, const string& msg, const string& file, int line) throw();
00086
00091 FileException(const string& fileName, Throwable& cause, const string& file, int line) throw();
00092
00096 FileException(const string& fileName, const string& msg, Throwable& cause, const string& file, int line) throw();
00097
00098 ~FileException() throw() {}
00099
00101 const string& getFileName() const throw();
00102 virtual shared_ptr<Throwable> clone() const throw();
00103 virtual string getMessage() const throw();
00104
00105 protected:
00106 FileException() throw() {}
00107
00108 string fileName;
00109 };
00110
00117 class StreamCorruptedException : public IoException {
00118 public:
00122 StreamCorruptedException(const string& msg, const string& file, int line) throw();
00123
00128 StreamCorruptedException(Throwable& cause, const string& file, int line) throw();
00129
00133 StreamCorruptedException(const string& msg, Throwable& cause, const string& file, int line) throw();
00134
00135 protected:
00136 StreamCorruptedException() throw() {}
00137 };
00138
00139
00145 class NoSuchStreamerException : public IoException {
00146 public:
00150 NoSuchStreamerException(const string& className, const string& msg, const string& file, int line) throw();
00151
00156 NoSuchStreamerException(const string& className, Throwable& cause, const string& file, int line) throw();
00157
00161 NoSuchStreamerException(const string& className, const string& msg, Throwable& cause, const string& file, int line) throw();
00162
00163 ~NoSuchStreamerException() throw() {}
00164
00166 const string& getClassName() const throw();
00167 virtual shared_ptr<Throwable> clone() const throw();
00168 virtual string getMessage() const throw();
00169
00170 protected:
00171 NoSuchStreamerException() throw() {}
00172
00173 string className;
00174 };
00175
00176 }
00177
00178 #endif //SCT_IOEXCEPTIONS_H