00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef IXE_io_File_H
00025 #define IXE_io_File_H
00026
00027
00028 #include "platform.h"
00029
00030
00031 #ifdef _WIN32
00032 # include <sys/utime.h>
00033 #else
00034 # include <utime.h>
00035 # include <unistd.h>
00036 #endif
00037 #include <string>
00038
00039 namespace IXE {
00043 namespace io {
00044
00045 class File
00046 {
00047 public:
00048 File(char const* pathname)
00049 : pathname(pathname)
00050 { }
00051
00052 File(std::string& pathname)
00053 : pathname(pathname.c_str())
00054 { }
00055
00056 bool create();
00058 bool exists();
00060 bool canRead();
00062 bool canWrite();
00063 bool isEmpty();
00065 bool isDirectory();
00067 bool isFile();
00068 bool isHidden();
00069 bool isIndexable();
00070 bool isLink();
00072 off64_t length();
00073 bool remove();
00075 std::string mimeType();
00079 time_t lastAccessed();
00080 bool lastAccessed(time_t);
00084 time_t lastModified();
00085 bool lastModified(time_t);
00089 time_t fileCreated();
00090 bool makedir(int mode = 0755);
00094 bool makedirs(int mode = 0755);
00095 bool rename(char const* dest);
00096
00098 char const* name() { return pathname; }
00099
00100 protected:
00101 char const* pathname;
00102 };
00103
00104 }
00105 }
00106
00107 #endif // IXE_io_File_H