00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __CODEX_EXCEPTIONS_FILEEXCEPTIONS_H__
00019 #define __CODEX_EXCEPTIONS_FILEEXCEPTIONS_H__
00020
00021 #include "ExceptionBase.h"
00022
00023 namespace CODEX_Exceptions
00024 {
00028 class FileException : public ExceptionBase
00029 {
00030 public :
00037 FileException( const string& fname, int line, const string& file ) :
00038 ExceptionBase( fname, line ),
00039 m_file( file )
00040 {}
00041
00043 virtual ~FileException() {}
00044
00045 void report() const;
00046
00047 protected :
00052 virtual void derivedMsg() const = 0;
00053
00054 private :
00055 string m_file;
00056 };
00057
00059 class FileCannotCreateException : public FileException
00060 {
00061 public :
00063 FileCannotCreateException( const string& fname,
00064 int line,
00065 const string& file ) :
00066 FileException( fname, line, file )
00067 {}
00068
00070 virtual ~FileCannotCreateException() {}
00071
00072 protected :
00073 void derivedMsg() const;
00074 };
00075
00077 class FileCannotOpenException : public FileException
00078 {
00079 public :
00081 FileCannotOpenException( const string& fname,
00082 int line,
00083 const string& file ) :
00084 FileException( fname, line, file )
00085 {}
00086
00088 virtual ~FileCannotOpenException() {}
00089
00090 protected :
00091 void derivedMsg() const;
00092 };
00093
00094 }
00095
00096 #endif