00001 /* 00002 * $Id: FileException.h 562 2007-12-02 08:04:16Z mindstorm2600 $ 00003 * 00004 * X-VR2 00005 * 00006 * Copyright (C) Juan V. Guerrero 2007 00007 * 00008 * Juan V. Guerrero <mindstorm2600@users.sourceforge.net> 00009 * 00010 * This program is free software, distributed under the terms of 00011 * the GNU General Public License Version 2. See the LICENSE file 00012 * at the top of the source tree. 00013 */ 00014 #ifndef __XVR2_FILE_EXCEPTION_H__ 00015 #define __XVR2_FILE_EXCEPTION_H__ 00016 #include<xvr2/CoreExceptions.h> 00017 #include<xvr2/SystemException.h> 00018 00019 namespace xvr2 { 00024 class FileExists:public FileException{ 00025 public: 00027 FileExists(); 00028 }; 00033 class FeatureNotAvailableOnPipesOrSocket:public FileException{ 00034 public: 00036 FeatureNotAvailableOnPipesOrSocket(); 00037 }; 00038 00042 class ThisIsADirectory:public FileException{ 00043 public: 00045 ThisIsADirectory(); 00046 }; 00050 class PermissionDenied:public FileException{ 00051 public: 00053 PermissionDenied(); 00054 }; 00058 class FilenameTooLong:public FileException{ 00059 public: 00061 FilenameTooLong(); 00062 }; 00066 class FileOrDirectoryNotFound:public FileException{ 00067 public: 00069 FileOrDirectoryNotFound(); 00070 }; 00074 class ThisIsNotADirectory:public FileException{ 00075 public: 00077 ThisIsNotADirectory(); 00078 }; 00082 class FileNotOpened:public FileException{ 00083 public: 00085 FileNotOpened(); 00086 }; 00090 class UnableToWriteOnReadOnlyFile:public FileException{ 00091 public: 00093 UnableToWriteOnReadOnlyFile(); 00094 }; 00098 class UnableToWriteOnRunningExecutableFile:public FileException{ 00099 public: 00101 UnableToWriteOnRunningExecutableFile(); 00102 }; 00106 class FilenameExceedsAddressSpace:public FileException{ 00107 public: 00109 FilenameExceedsAddressSpace(); 00110 }; 00114 class TooManySymlinks:public FileException{ 00115 public: 00117 TooManySymlinks(); 00118 }; 00122 class NotEnoughStorageSpace:public FileException{ 00123 public: 00125 NotEnoughStorageSpace(); 00126 }; 00130 class MaximumNumberOfOpenFilesForThisProcess:public FileException{ 00131 public: 00133 MaximumNumberOfOpenFilesForThisProcess(); 00134 }; 00138 class MaximumNumberOfOpenFilesForThisSystem:public FileException{ 00139 public: 00143 MaximumNumberOfOpenFilesForThisSystem(); 00144 }; 00145 00150 class FileTooBig:public FileException{ 00151 public: 00153 FileTooBig(); 00154 }; 00155 00159 class WriteWillBlock:public FileException{ 00160 public: 00162 WriteWillBlock(); 00163 }; 00164 00167 class FileNotFound:public FileException{ 00168 public: 00170 FileNotFound(); 00171 }; 00172 00175 class InvalidFileDescriptor:public FileException { 00176 private: 00177 int _fd; 00178 public: 00179 InvalidFileDescriptor(); 00180 InvalidFileDescriptor(int __fd); 00182 int fd(); 00183 }; 00184 00185 } 00186 00187 00188 #endif