6 #ifndef SWIFT_MISC_DIRECTORYUTILS_H
7 #define SWIFT_MISC_DIRECTORYUTILS_H
10 #include <QFileInfoList>
98 static QSet<QString> fileNamesToQSet(
const QFileInfoList &fileInfoList);
101 static QSet<QString> canonicalFileNamesToQSet(
const QFileInfoList &fileInfoList);
104 static QSet<QString> filesToCanonicalNames(
const QSet<QString> &fileNames,
105 const QSet<QString> &canonicalFileNames);
108 static bool canPingUncMachine(
const QString &machine);
Utility class for directory operations.
static bool isDirExisting(const QDir &dir)
Directory existing? Also checking UNC paths upfront.
static QStringList getRelativeSubDirectories(const QString &rootDir)
All sub directories of given dir.
static bool mkPathIfNotExisting(const QString &dir)
Make directory if not already existing.
static DirComparison compareTwoDirectories(const QString &dirSource, const QString &dirTarget, bool nestedDirs)
Compare 2 directories (only files, but with hierarchy)
static QString decodeNormalizedDirectory(const QString &directory)
Virtually the inverse operation of CDirectoryUtils::normalizedApplicationDirectory.
static bool isMacOSAppBundle()
Is MacOS application bundle?
static bool isSameOrSubDirectoryOf(const QString &testDir, const QString &parentDir)
Is "testDir" a subdirectory (possibly nested) of "parentDir" or the same directory.
static bool isInApplicationDirectory(const QString &path)
Path in application directory.
static bool containsFileInDir(const QString &dir, const QString &filter, bool recursively)
Any file with filter like "*.txt".
static QStringList getExistingUnemptyDirectories(const QStringList &directories)
Get the existing directories.
static bool isSameOrSubDirectoryOfStringBased(const QString &testDir, const QString &parentDir)
Is "testDir" a subdirectory (possibly nested) of "parentDir" or the same directory.
static bool existsUnemptyDirectory(const QString &testDir)
Exists directory and does it contains files.
static bool isSameOrSubDirectoryOf(const QString &testDir, const QDir &parentDir)
Is "testDir" a subdirectory (possibly nested) of "parentDir" or the same directory.
static int copyDirectoryRecursively(const QString &fromDir, const QString &toDir, bool replaceOnConflict)
Copy directory recursively.
static bool isSameExistingDirectory(const QString &dir1, const QString &dir2)
Same existing directories.
static bool isDirExisting(const QString &path)
Directory existing? Also checking UNC paths upfront.
Free functions in swift::misc.
Result of directory comparison.
QSet< QString > missingInTarget
files not in target, but in source
QSet< QString > sameNameInTarget
file exists in source and target, target name
QSet< QString > source
all source files
QSet< QString > newerInTarget
file in target is newer
void insert(const DirComparison &otherComparison)
Insert values of another comparison.
QSet< QString > newerInSource
file exists in target, but source is newer
QSet< QString > sameNameInSource
file exists in source and target, source name
QSet< QString > missingInSource
files not in source, but in target
#define SWIFT_MISC_EXPORT
Export a class or function from the library.