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

Method RemoveDirectoryName

tests/gtest/gtest-all.cc:9388–9391  ·  view source on GitHub ↗

Returns a copy of the FilePath with the directory part removed. Example: FilePath("path/to/file").RemoveDirectoryName() returns FilePath("file"). If there is no directory part ("just_a_file"), it returns the FilePath unmodified. If there is no file part ("just_a_dir/") it returns an empty FilePath (""). On Windows platform, '\' is the path separator, otherwise it is '/'.

Source from the content-addressed store, hash-verified

9386// returns an empty FilePath ("").
9387// On Windows platform, '\' is the path separator, otherwise it is '/'.
9388FilePath FilePath::RemoveDirectoryName() const {
9389 const char* const last_sep = FindLastPathSeparator();
9390 return last_sep ? FilePath(last_sep + 1) : *this;
9391}
9392
9393// RemoveFileName returns the directory path with the filename removed.
9394// Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".

Callers 1

GetCurrentExecutableNameFunction · 0.80

Calls 1

FilePathFunction · 0.85

Tested by

no test coverage detected