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 '/'.
| 7573 | // returns an empty FilePath (""). |
| 7574 | // On Windows platform, '\' is the path separator, otherwise it is '/'. |
| 7575 | FilePath FilePath::RemoveDirectoryName() const { |
| 7576 | const char* const last_sep = FindLastPathSeparator(); |
| 7577 | return last_sep ? FilePath(String(last_sep + 1)) : *this; |
| 7578 | } |
| 7579 | |
| 7580 | // RemoveFileName returns the directory path with the filename removed. |
| 7581 | // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/". |
no test coverage detected