MCPcopy Create free account
hub / github.com/KDE/kdevelop / resolveShellGlobbingInternal

Function resolveShellGlobbingInternal

plugins/qmakemanager/qmakefile.cpp:23–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21 int offset);
22
23QStringList resolveShellGlobbingInternal(const QStringList& segments, QDir& dir, int offset = 0)
24{
25 if (offset >= segments.size()) {
26 return QStringList();
27 }
28
29 const QString& pathPattern = segments.at(offset);
30
31 QStringList entries;
32 if (pathPattern.contains(QLatin1Char('*')) ||
33 pathPattern.contains(QLatin1Char('?')) ||
34 pathPattern.contains(QLatin1Char('['))) {
35 // pattern contains globbing chars
36 const auto dirEntries =
37 dir.entryInfoList(QStringList() << pathPattern, QDir::AllEntries | QDir::NoDotAndDotDot, QDir::Unsorted);
38 for (const auto& match : dirEntries) {
39 resolveShellGlobbingInternal(entries, segments, match, dir, offset);
40 }
41 } else {
42 // pattern is "simple" hence be fast, but make sure the file exists
43 QFileInfo info(dir.filePath(pathPattern));
44 if (info.exists()) {
45 resolveShellGlobbingInternal(entries, segments, info, dir, offset);
46 }
47 }
48
49 return entries;
50}
51
52void resolveShellGlobbingInternal(QStringList& entries, const QStringList& segments, const QFileInfo& match, QDir& dir,
53 int offset)

Callers 1

resolveShellGlobbingMethod · 0.85

Calls 10

QStringListClass · 0.85
existsMethod · 0.80
cdMethod · 0.80
sizeMethod · 0.45
atMethod · 0.45
containsMethod · 0.45
filePathMethod · 0.45
fileNameMethod · 0.45
isEmptyMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected