MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / RemoveExtension

Method RemoveExtension

rtpose_wrapper/src/gtest/gtest-all.cpp:7545–7551  ·  view source on GitHub ↗

Returns a copy of the FilePath with the case-insensitive extension removed. Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns FilePath("dir/file"). If a case-insensitive extension is not found, returns a copy of the original FilePath.

Source from the content-addressed store, hash-verified

7543// FilePath("dir/file"). If a case-insensitive extension is not
7544// found, returns a copy of the original FilePath.
7545FilePath FilePath::RemoveExtension(const char* extension) const {
7546 String dot_extension(String::Format(".%s", extension));
7547 if (pathname_.EndsWithCaseInsensitive(dot_extension.c_str())) {
7548 return FilePath(String(pathname_.c_str(), pathname_.length() - 4));
7549 }
7550 return *this;
7551}
7552
7553// Returns a pointer to the last occurence of a valid path separator in
7554// the FilePath. On Windows, for example, both '/' and '\' are valid path

Callers 1

GetCurrentExecutableNameFunction · 0.80

Calls 4

FormatClass · 0.85
FilePathFunction · 0.85
StringFunction · 0.70

Tested by

no test coverage detected