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.
| 7543 | // FilePath("dir/file"). If a case-insensitive extension is not |
| 7544 | // found, returns a copy of the original FilePath. |
| 7545 | FilePath FilePath::RemoveExtension(const char* extension) const { |
| 7546 | String dot_extension(String::Format(".%s", extension)); |
| 7547 | if (pathname_.EndsWithCaseInsensitive(dot_extension.c_str())) { |
| 7548 | return FilePath(String(pathname_.c_str(), pathname_.length() - 4)); |
| 7549 | } |
| 7550 | return *this; |
| 7551 | } |
| 7552 | |
| 7553 | // Returns a pointer to the last occurence of a valid path separator in |
| 7554 | // the FilePath. On Windows, for example, both '/' and '\' are valid path |
no test coverage detected