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

Function getFilename

lib/analyzerinfo.cpp:42–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42static std::string getFilename(const std::string &fullpath)
43{
44 std::string::size_type pos1 = fullpath.find_last_of("/\\");
45 pos1 = (pos1 == std::string::npos) ? 0U : (pos1 + 1U);
46 std::string::size_type pos2 = fullpath.rfind('.');
47 if (pos2 < pos1)
48 pos2 = std::string::npos;
49 if (pos2 != std::string::npos)
50 pos2 = pos2 - pos1;
51 return fullpath.substr(pos1,pos2);
52}
53
54void AnalyzerInformation::writeFilesTxt(const std::string &buildDir, const std::list<std::string> &sourcefiles, const std::list<FileSettings> &fileSettings)
55{

Callers 1

getFilesTxtMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected