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.
| 8392 | // FilePath("dir/file"). If a case-insensitive extension is not |
| 8393 | // found, returns a copy of the original FilePath. |
| 8394 | FilePath FilePath::RemoveExtension(const char* extension) const { |
| 8395 | const std::string dot_extension = std::string(".") + extension; |
| 8396 | if (String::EndsWithCaseInsensitive(pathname_, dot_extension)) { |
| 8397 | return FilePath(pathname_.substr( |
| 8398 | 0, pathname_.length() - dot_extension.length())); |
| 8399 | } |
| 8400 | return *this; |
| 8401 | } |
| 8402 | |
| 8403 | // Returns a pointer to the last occurence of a valid path separator in |
| 8404 | // the FilePath. On Windows, for example, both '/' and '\' are valid path |
no test coverage detected