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

Method RemoveTrailingPathSeparator

tests/gtest/gtest-all.cc:9576–9580  ·  view source on GitHub ↗

If input name has a trailing separator character, remove it and return the name, otherwise return the name string unmodified. On Windows platform, uses \ as the separator, other platforms use /.

Source from the content-addressed store, hash-verified

9574// name, otherwise return the name string unmodified.
9575// On Windows platform, uses \ as the separator, other platforms use /.
9576FilePath FilePath::RemoveTrailingPathSeparator() const {
9577 return IsDirectory()
9578 ? FilePath(pathname_.substr(0, pathname_.length() - 1))
9579 : *this;
9580}
9581
9582// Removes any redundant separators that might be in the pathname.
9583// For example, "bar///foo" becomes "bar/foo". Does not eliminate other

Callers 3

CreateFolderMethod · 0.95
ConcatPathsMethod · 0.80

Calls 1

FilePathFunction · 0.85

Tested by

no test coverage detected