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

Function cmStripSuffixIfExists

Source/cmStringAlgorithms.h:363–368  ·  view source on GitHub ↗

Removes an existing suffix character of from the string @a str. */

Source from the content-addressed store, hash-verified

361
362/** Removes an existing suffix character of from the string @a str. */
363inline void cmStripSuffixIfExists(std::string& str, char suffix)
364{
365 if (cmHasSuffix(str, suffix)) {
366 str.pop_back();
367 }
368}
369
370/** Removes an existing suffix string of from the string @a str. */
371inline void cmStripSuffixIfExists(std::string& str, cm::string_view suffix)

Calls 4

cmHasSuffixFunction · 0.85
pop_backMethod · 0.80
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…