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

Function preprocess

kdevplatform/tests/json/declarationvalidator.cpp:25–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23};
24
25QByteArray preprocess(QByteArray json)
26{
27 int commentIndex = json.indexOf('#', 0);
28 while (commentIndex > -1) {
29 int commentEnd = json.indexOf('\n', commentIndex);
30 if (commentEnd == -1) {
31 json.truncate(commentIndex);
32 break;
33 }
34 json.remove(commentIndex, commentEnd - commentIndex);
35 commentIndex = json.indexOf('#', commentIndex);
36 }
37
38 return '{' + json + '}';
39}
40
41DeclarationValidator::DeclarationValidator(TestDataEditor testDataAdjuster)
42 : d_ptr(new DeclarationValidatorPrivate{std::move(testDataAdjuster)})

Callers 1

visitMethod · 0.85

Calls 2

indexOfMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected