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

Method getFilenameExtension

lib/path.cpp:118–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118std::string Path::getFilenameExtension(const std::string &path, bool lowercase)
119{
120 const std::string::size_type dotLocation = path.find_last_of('.');
121 if (dotLocation == std::string::npos)
122 return "";
123
124 std::string extension = path.substr(dotLocation);
125 if (lowercase || caseInsensitiveFilesystem()) {
126 // on a case insensitive filesystem the case doesn't matter so
127 // let's return the extension in lowercase
128 strTolower(extension);
129 }
130 return extension;
131}
132
133std::string Path::getFilenameExtensionInLowerCase(const std::string &path)
134{

Callers

nothing calls this directly

Calls 2

strTolowerFunction · 0.85

Tested by

no test coverage detected