00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef IXE_io_File_H
00026 #define IXE_io_File_H
00027
00028
00029 #include "platform.h"
00030
00031
00032 #ifdef _WIN32
00033 # include <sys/utime.h>
00034 #else
00035 # include <utime.h>
00036 # include <unistd.h>
00037 #endif
00038 #include <string>
00039
00040 namespace IXE {
00044 namespace io {
00045
00046 class File
00047 {
00048 public:
00049 File(char const* pathname)
00050 : pathname(pathname)
00051 { }
00052
00053 File(std::string& pathname)
00054 : pathname(pathname.c_str())
00055 { }
00056
00057 bool create();
00059 bool exists();
00061 bool canRead();
00063 bool canWrite();
00064 bool isEmpty();
00066 bool isDirectory();
00068 bool isFile();
00069 bool isHidden();
00070 bool isIndexable();
00071 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 protected:
00097 char const* pathname;
00098 };
00099
00100 }
00101 }
00102
00103 #endif // IXE_io_File_H