00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef QFILEINFO_H
00023 #define QFILEINFO_H
00024
00025 #include "FXTime.h"
00026 #include "QDir.h"
00027 #include "FXACL.h"
00028
00029 namespace FX {
00030
00035 class QFile;
00036
00061 struct QFileInfoPrivate;
00062 class FXAPIR QFileInfo
00063 {
00064 QFileInfoPrivate *p;
00065 public:
00067 QFileInfo();
00069 QFileInfo(const FXString &path);
00071 QFileInfo(const QFile &file);
00073 QFileInfo(const QDir &dir, const FXString &leafname);
00074 QFileInfo(const QFileInfo &o);
00075 QFileInfo &operator=(const QFileInfo &o);
00076 ~QFileInfo();
00077 bool operator<(const QFileInfo &o) const;
00078 bool operator==(const QFileInfo &o) const;
00079 bool operator!=(const QFileInfo &o) const { return !(*this==o); }
00080 bool operator>(const QFileInfo &o) const;
00081
00083 void setFile(const FXString &path);
00085 void setFile(const QFile &file);
00087 void setFile(const QDir &dir, const FXString &leafname);
00089 bool exists() const;
00091 void refresh();
00093 bool caching() const;
00095 void setCaching(bool newon);
00097 const FXString &filePath() const;
00099 FXString fileName() const;
00101 FXString absFilePath() const;
00105 FXString baseName(bool complete=false) const;
00109 FXString extension(bool complete=true) const;
00111 FXString dirPath(bool absPath=false) const;
00113 QDir dir(bool absPath=false) const { return QDir(absPath ? absFilePath() : fileName()); }
00115 bool isReadable() const;
00117 bool isWriteable() const;
00119 bool isWritable() const { return isWriteable(); }
00121 bool isExecutable() const;
00123 FXuint metaFlags() const;
00125 bool isHidden() const;
00127 bool isRelative() const;
00129 bool convertToAbs();
00131 bool isFile() const;
00133 bool isDir() const;
00135 bool isSymLink() const;
00137 FXString readLink() const;
00139 const FXACLEntity &owner() const;
00141 const FXACL &permissions() const;
00143 bool permission(FXACL::Perms what) const;
00145 FXString permissionsAsString() const;
00147 FXfval size() const;
00149 FXString sizeAsString() const;
00151 FXTime created() const;
00153 FXString createdAsString(const FXString &format="%Y/%b/%d %H:%M:%S.%F %Z", bool inLocalTime=true) const;
00155 FXTime lastModified() const;
00157 FXString lastModifiedAsString(const FXString &format="%Y/%b/%d %H:%M:%S.%F %Z", bool inLocalTime=true) const;
00159 FXTime lastRead() const;
00161 FXString lastReadAsString(const FXString &format="%Y/%b/%d %H:%M:%S.%F %Z", bool inLocalTime=true) const;
00162 };
00163
00164 }
00165
00166 #endif