MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / reopen

Method reopen

lib/analyzerinfo.cpp:297–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297void AnalyzerInformation::reopen(const std::string &buildDir, const std::string &sourcefile, const std::string &cfg, std::size_t fsFileId)
298{
299 if (buildDir.empty() || sourcefile.empty())
300 return;
301
302 const std::string analyzerInfoFile = AnalyzerInformation::getAnalyzerInfoFile(buildDir,sourcefile,cfg,fsFileId);
303 std::ifstream ifs(analyzerInfoFile);
304 if (!ifs.is_open())
305 return;
306
307 std::ostringstream iss;
308 iss << ifs.rdbuf();
309 ifs.close();
310
311 std::string content = iss.str();
312 content.resize(content.find("</analyzerinfo>"));
313
314 mOutputStream.open(analyzerInfoFile, std::ios::trunc);
315 mOutputStream << content;
316}

Callers 1

Calls 5

emptyMethod · 0.45
closeMethod · 0.45
strMethod · 0.45
findMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected