MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / RemoveExtension

Method RemoveExtension

tests/gtest/gtest-all.cc:9357–9364  ·  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

9355// FilePath("dir/file"). If a case-insensitive extension is not
9356// found, returns a copy of the original FilePath.
9357FilePath FilePath::RemoveExtension(const char* extension) const {
9358 const std::string dot_extension = std::string(".") + extension;
9359 if (String::EndsWithCaseInsensitive(pathname_, dot_extension)) {
9360 return FilePath(pathname_.substr(
9361 0, pathname_.length() - dot_extension.length()));
9362 }
9363 return *this;
9364}
9365
9366// Returns a pointer to the last occurrence of a valid path separator in
9367// the FilePath. On Windows, for example, both '/' and '\' are valid path

Callers 1

GetCurrentExecutableNameFunction · 0.80

Calls 1

FilePathFunction · 0.85

Tested by

no test coverage detected