| 213 | } |
| 214 | |
| 215 | StringView parent_dir(const char *path) |
| 216 | { |
| 217 | const char *ls = strrchr(path, PATH_SEPARATOR); |
| 218 | |
| 219 | if (!ls) |
| 220 | return { NULL, 0 }; |
| 221 | |
| 222 | #if CROWN_PLATFORM_WINDOWS |
| 223 | if (ls == path + 2 && path[1] == ':') |
| 224 | return { path, 3 }; |
| 225 | #else |
| 226 | if (ls == path) |
| 227 | return { path, 1 }; |
| 228 | #endif |
| 229 | |
| 230 | return { path, u32(ls - path) }; |
| 231 | } |
| 232 | |
| 233 | bool is_valid_basename(const char *basename) |
| 234 | { |
no outgoing calls