forked from qt-creator/qt-creator
Utils: Add/fix FilePath::isFile and FilePath::isDir
In general, the more specific isReadableFile etc are preferred, but for porting a 1:1 match to QFileInfo functionality is helpful. Change-Id: I5b575ca9a5053f13f63c0fbe0e3dcc222494280f Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -77,6 +77,8 @@ public:
|
||||
std::function<bool(const FilePath &)> isReadableDir;
|
||||
std::function<bool(const FilePath &)> isWritableDir;
|
||||
std::function<bool(const FilePath &)> isWritableFile;
|
||||
std::function<bool(const FilePath &)> isFile;
|
||||
std::function<bool(const FilePath &)> isDir;
|
||||
std::function<bool(const FilePath &)> ensureWritableDir;
|
||||
std::function<bool(const FilePath &)> ensureExistingFile;
|
||||
std::function<bool(const FilePath &)> createDir;
|
||||
@@ -149,6 +151,8 @@ public:
|
||||
bool isReadableDir() const;
|
||||
bool isRelativePath() const;
|
||||
bool isAbsolutePath() const { return !isRelativePath(); }
|
||||
bool isFile() const;
|
||||
bool isDir() const;
|
||||
|
||||
bool createDir() const;
|
||||
QList<FilePath> dirEntries(const QStringList &nameFilters,
|
||||
@@ -177,7 +181,6 @@ public:
|
||||
bool startsWith(const QString &s) const;
|
||||
bool endsWith(const QString &s) const;
|
||||
|
||||
bool isDir() const;
|
||||
bool isNewerThan(const QDateTime &timeStamp) const;
|
||||
QDateTime lastModified() const;
|
||||
QFile::Permissions permissions() const;
|
||||
|
||||
Reference in New Issue
Block a user