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

Function readCacheValues

plugins/cmake/cmakeutils.cpp:460–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458}
459
460QHash<QString, QString> readCacheValues(const KDevelop::Path& cmakeCachePath, QSet<QString> variables)
461{
462 QHash<QString, QString> ret;
463 QFile file(cmakeCachePath.toLocalFile());
464 if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
465 qCWarning(CMAKE) << "couldn't open CMakeCache.txt" << cmakeCachePath;
466 return ret;
467 }
468
469 QTextStream in(&file);
470 while (!in.atEnd() && !variables.isEmpty())
471 {
472 QString line = in.readLine().trimmed();
473 if(!line.isEmpty() && line[0].isLetter())
474 {
475 CacheLine c;
476 c.readLine(line);
477
478 if(!c.isCorrect())
479 continue;
480
481 if (variables.remove(c.name())) {
482 ret[c.name()] = c.value();
483 }
484 }
485 }
486 return ret;
487}
488
489void updateConfig( KDevelop::IProject* project, int buildDirIndex)
490{

Callers 3

compilerMethod · 0.85
handshakeMethod · 0.85
updateConfigFunction · 0.85

Calls 9

toLocalFileMethod · 0.80
atEndMethod · 0.80
readLineMethod · 0.80
openMethod · 0.45
isEmptyMethod · 0.45
isCorrectMethod · 0.45
removeMethod · 0.45
nameMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected