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 /.
| 9574 | // name, otherwise return the name string unmodified. |
| 9575 | // On Windows platform, uses \ as the separator, other platforms use /. |
| 9576 | FilePath 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 |
no test coverage detected