Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

FileExceptions.h

00001 /*
00002  * Copyright 2003 Michael A. Marsh, Cornell University. All rights reserved.
00003  * This software is released under the modified BSD license.
00004  * See the file LICENSE in the top-level directory for details.
00005  */
00006 //
00007 // $Id: FileExceptions.h,v 1.3 2004/05/19 15:56:50 mmarsh Exp $
00008 //
00009 // $Log: FileExceptions.h,v $
00010 // Revision 1.3  2004/05/19 15:56:50  mmarsh
00011 // *** empty log message ***
00012 //
00013 // Revision 1.2  2003/11/04 22:31:48  mmarsh
00014 // *** empty log message ***
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 /* __CODEX_EXCEPTIONS_FILEEXCEPTIONS_H__ */

Generated on Fri May 6 17:39:12 2005 for COrnell Data EXchange (CODEX) by  doxygen 1.4.1