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

Function parseFile

plugins/cmake/cmakefileapi.cpp:40–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40QJsonObject parseFile(const QString& path)
41{
42 QFile file(path);
43 if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
44 qCWarning(CMAKE) << "failed to read json file" << path << file.errorString();
45 return {};
46 }
47 QJsonParseError error;
48 const auto document = QJsonDocument::fromJson(file.readAll(), &error);
49 if (error.error) {
50 qCWarning(CMAKE) << "failed to parse json file" << path << error.errorString() << error.offset;
51 return {};
52 }
53 return document.object();
54}
55
56bool isKDevelopClientResponse(const QJsonObject& indexObject)
57{

Callers 3

findReplyIndexFileFunction · 0.85
parseCodeModelFunction · 0.85
parseReplyIndexFileFunction · 0.85

Calls 3

objectMethod · 0.80
openMethod · 0.45
errorStringMethod · 0.45

Tested by

no test coverage detected