MCPcopy Create free account
hub / github.com/Kitware/CMake / GetPathBasename

Method GetPathBasename

Source/cmExtraKateGenerator.cxx:334–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332}
333
334std::string cmExtraKateGenerator::GetPathBasename(
335 std::string const& path) const
336{
337 std::string outputBasename = path;
338 while (!outputBasename.empty() &&
339 (outputBasename.back() == '/' || outputBasename.back() == '\\')) {
340 outputBasename.resize(outputBasename.size() - 1);
341 }
342 std::string::size_type loc = outputBasename.find_last_of("/\\");
343 if (loc != std::string::npos) {
344 outputBasename = outputBasename.substr(loc + 1);
345 }
346
347 return outputBasename;
348}

Callers 1

GenerateMethod · 0.95

Calls 6

find_last_ofMethod · 0.80
emptyMethod · 0.45
backMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected