| 1031 | } |
| 1032 | |
| 1033 | StringView FileSystem::GetDirectoryName(StringView path) |
| 1034 | { |
| 1035 | if (path.empty()) return {}; |
| 1036 | |
| 1037 | std::size_t pathRootLength = GetPathRootLength(path); |
| 1038 | std::size_t i = path.size(); |
| 1039 | // Strip any trailing path separators |
| 1040 | while (i > pathRootLength && (path[i - 1] == '/' || path[i - 1] == '\\')) { |
| 1041 | i--; |
| 1042 | } |
| 1043 | if (i <= pathRootLength) return {}; |
| 1044 | // Try to get the last path separator |
| 1045 | while (i > pathRootLength && path[--i] != '/' && path[i] != '\\'); |
| 1046 | |
| 1047 | return path.slice(0, i); |
| 1048 | } |
| 1049 | |
| 1050 | StringView FileSystem::GetFileName(StringView path) |
| 1051 | { |
nothing calls this directly
no test coverage detected