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.
| 9355 | // FilePath("dir/file"). If a case-insensitive extension is not |
| 9356 | // found, returns a copy of the original FilePath. |
| 9357 | FilePath 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 |
no test coverage detected