MCPcopy Create free account
hub / github.com/QuasarApp/CQtDeployer / getFilesSet

Method getFilesSet

tests/units/testutils.cpp:45–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45QSet<QString> TestUtils::getFilesSet(const QString &path, int limit, int depch) {
46 QFileInfo info(path);
47
48 if (limit > 0 && depch >= limit) {
49 return {};
50 }
51
52 if (!info.exists()) {
53 return {};
54 }
55
56 auto result = QSet<QString>{};
57
58 if (!info.isDir()) {
59 result.insert(getFilePath(info.fileName()));
60 return result;
61 }
62
63 QDir dir(info.absoluteFilePath());
64 auto list = dir.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden);
65 for (const auto &i: std::as_const(list)) {
66 result.unite(getFilesSet(i.absoluteFilePath(), limit, depch + 1));
67 }
68
69 return result;
70}
71
72QString TestUtils::getFilePath(const QString& i) {
73 auto file = i;

Callers 1

tstMainMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected