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

Method getTree

tests/units/testutils.cpp:18–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18QSet<QString> TestUtils::getTree(const QString &path, int limit, int depch) {
19 QFileInfo info(path);
20
21 if (limit > 0 && depch >= limit) {
22 return {};
23 }
24
25 if (!info.exists()) {
26 return {};
27 }
28
29 auto result = QSet<QString>{};
30
31 if (!info.isDir()) {
32 result.insert(getFilePath(info.absoluteFilePath()));
33 return result;
34 }
35
36 QDir dir(info.absoluteFilePath());
37 auto list = dir.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden);
38 for (const auto &i: std::as_const(list)) {
39 result.unite(getTree(i.absoluteFilePath(), limit, depch + 1));
40 }
41
42 return result;
43}
44
45QSet<QString> TestUtils::getFilesSet(const QString &path, int limit, int depch) {
46 QFileInfo info(path);

Callers 2

checkResultsMethod · 0.80
testMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected