#include <QFileInfo.h>
While most of what is offered by this class can be done manually via the static methods in FX::QFile, it can be useful to have a container knowing everything there is to know about an entry in a file system, particularly for purposes of comparison.
Like Qt's QFileInfo, this class also caches its information by default and thus after construction or refresh()
, queries are far quicker (this is the default). API compatibility with QFileInfo has been mostly maintained - however, the old system of permissions has been replaced with an ACL based one so that NT file permissions are available. On Linux or BSD, suitable entries are created to reflect the much simpler POSIX security model though it could be easily extended to reflect the ACL security implemented by SE-Linux. For these reasons, I recommend you use QFileInfo over QFile directly (it's just as efficient at worst as the original FOX code does a stat()
even where on Win32 there's a separate faster call - except for isFile()
and isDirectory()
). Note that if FX::FXACL throws an exception when reading the file entry's security info (this could happen if the file entry does not give you permission to read its ACL), QFileInfo will simply create an empty ACL belonging to FX::FXACLEntity::root() for that file entry.
If you wish to enumerate the contents of a directory, please see FX::QDir. The default operators <, > and == compare by case insensitive name.
Definition at line 62 of file QFileInfo.h.
Public Member Functions | |
QFileInfo () | |
QFileInfo (const FXString &path) | |
QFileInfo (const QFile &file) | |
QFileInfo (const QDir &dir, const FXString &leafname) | |
QFileInfo (const QFileInfo &o) | |
QFileInfo & | operator= (const QFileInfo &o) |
~QFileInfo () | |
bool | operator< (const QFileInfo &o) const |
bool | operator== (const QFileInfo &o) const |
bool | operator!= (const QFileInfo &o) const |
bool | operator> (const QFileInfo &o) const |
void | setFile (const FXString &path) |
void | setFile (const QFile &file) |
void | setFile (const QDir &dir, const FXString &leafname) |
bool | exists () const |
void | refresh () |
bool | caching () const |
void | setCaching (bool newon) |
const FXString & | filePath () const |
FXString | fileName () const |
FXString | absFilePath () const |
FXString | baseName (bool complete=false) const |
FXString | extension (bool complete=true) const |
FXString | dirPath (bool absPath=false) const |
QDir | dir (bool absPath=false) const |
bool | isReadable () const |
bool | isWriteable () const |
bool | isWritable () const |
bool | isExecutable () const |
FXuint | metaFlags () const |
bool | isHidden () const |
bool | isRelative () const |
bool | convertToAbs () |
bool | isFile () const |
bool | isDir () const |
bool | isSymLink () const |
FXString | readLink () const |
const FXACLEntity & | owner () const |
const FXACL & | permissions () const |
bool | permission (FXACL::Perms what) const |
FXString | permissionsAsString () const |
FXfval | size () const |
FXString | sizeAsString () const |
FXTime | created () const |
FXString | createdAsString (const FXString &format="%Y/%b/%d %H:%M:%S.%F %Z", bool inLocalTime=true) const |
FXTime | lastModified () const |
FXString | lastModifiedAsString (const FXString &format="%Y/%b/%d %H:%M:%S.%F %Z", bool inLocalTime=true) const |
FXTime | lastRead () const |
FXString | lastReadAsString (const FXString &format="%Y/%b/%d %H:%M:%S.%F %Z", bool inLocalTime=true) const |