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

Method getFilesTxt

lib/analyzerinfo.cpp:61–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61std::string AnalyzerInformation::getFilesTxt(const std::list<std::string> &sourcefiles, const std::list<FileSettings> &fileSettings) {
62 std::ostringstream ret;
63
64 std::map<std::string, unsigned int> fileCount;
65
66 for (const std::string &f : sourcefiles) {
67 const std::string afile = getFilename(f);
68 ret << afile << ".a" << (++fileCount[afile]) << sep << sep << sep << Path::simplifyPath(f) << '\n';
69 }
70
71 for (const FileSettings &fs : fileSettings) {
72 const std::string afile = getFilename(fs.filename());
73 const std::string id = fs.file.fsFileId() > 0 ? std::to_string(fs.file.fsFileId()) : "";
74 ret << afile << ".a" << (++fileCount[afile]) << sep << fs.cfg << sep << id << sep << Path::simplifyPath(fs.filename()) << std::endl;
75 }
76
77 return ret.str();
78}
79
80void AnalyzerInformation::close()
81{

Callers

nothing calls this directly

Calls 4

getFilenameFunction · 0.85
simplifyPathFunction · 0.85
fsFileIdMethod · 0.80
strMethod · 0.45

Tested by

no test coverage detected