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

Function getRelativeFilename

lib/preprocessor.cpp:183–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183static std::string getRelativeFilename(const simplecpp::TokenList &tokens, const simplecpp::Token* tok, const Settings &settings) {
184 if (!tok)
185 return "";
186 std::string relativeFilename(tokens.file(tok->location));
187 if (settings.relativePaths) {
188 for (const std::string & basePath : settings.basePaths) {
189 const std::string bp = basePath + "/";
190 if (relativeFilename.compare(0,bp.size(),bp)==0) {
191 relativeFilename = relativeFilename.substr(bp.size());
192 }
193 }
194 }
195 return Path::simplifyPath(std::move(relativeFilename));
196}
197
198static void addInlineSuppressions(const simplecpp::TokenList &tokens, const Settings &settings, SuppressionList &suppressions, std::list<BadInlineSuppression> &bad)
199{

Callers 2

addInlineSuppressionsFunction · 0.85
addRemarkCommentsMethod · 0.85

Calls 3

simplifyPathFunction · 0.85
compareMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected