FilePtr.h++
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __ccxx_FilePtr_hxx
00024 #define __ccxx_FilePtr_hxx
00025
00026 #include <commonc++/Common.h++>
00027 #include <commonc++/String.h++>
00028
00029 #include <cstdio>
00030
00031 namespace ccxx {
00032
00037 class COMMONCPP_API FilePtr
00038 {
00039 public:
00040
00047 FilePtr(const char *name, const char *mode) throw();
00048
00055 FilePtr(const String& name, const String& mode) throw();
00056
00061 FilePtr(FILE *fp) throw();
00062
00064 ~FilePtr() throw();
00065
00067 inline operator FILE*() throw() { return(_fp); }
00068
00070 inline bool isValid() const throw() { return(_fp != NULL); }
00071
00073 inline bool operator!() const throw()
00074 { return(! isValid()); }
00075
00076 private:
00077
00078 FILE *_fp;
00079
00080 CCXX_COPY_DECLS(FilePtr);
00081 };
00082
00083 };
00084
00085 #endif // __ccxx_FilePtr_hxx
00086
00087