| 1069 | } |
| 1070 | |
| 1071 | StringView FileSystem::GetFileNameWithoutExtension(StringView path) |
| 1072 | { |
| 1073 | StringView fileName = GetFileName(path); |
| 1074 | if (fileName.empty()) return {}; |
| 1075 | |
| 1076 | const StringView foundDot = fileName.findLastOr('.', fileName.end()); |
| 1077 | if (foundDot.begin() == fileName.end()) return fileName; |
| 1078 | |
| 1079 | bool initialDots = true; |
| 1080 | for (char c : fileName.prefix(foundDot.begin())) { |
| 1081 | if (c != '.') { |
| 1082 | initialDots = false; |
| 1083 | break; |
| 1084 | } |
| 1085 | } |
| 1086 | if (initialDots) return fileName; |
| 1087 | return fileName.prefix(foundDot.begin()); |
| 1088 | } |
| 1089 | |
| 1090 | String FileSystem::GetExtension(StringView path) |
| 1091 | { |
nothing calls this directly
no test coverage detected