00001 00006 #ifndef _EXCEPT_H_ 00007 #define _EXCEPT_H_ 00008 00009 #include <stdexcept> 00010 00016 class eOpenFailed : public std::exception 00017 { 00018 public: 00019 eOpenFailed(const char *filename) { m_filename = filename; } 00020 const char *filename() const { return m_filename; } 00021 private: 00022 const char *m_filename; 00023 }; 00024 00031 class eEOF : public std::exception 00032 { 00033 public: 00034 enum { partial, final }; 00035 eEOF(int type, int bytes) { m_type = type; m_bytes = bytes; } 00036 int bytes_read() const { return m_bytes; } 00037 int type() const { return m_type; } 00038 private: 00039 int m_bytes; 00040 int m_type; 00041 }; 00042 00048 class eCannotProceed : public std::runtime_error 00049 { 00050 public: 00051 eCannotProceed(const char *str) : runtime_error(str) {} 00052 }; 00053 00054 #endif //_EXCEPT_H_