pub fn parsePath(path: []const u8) switch (native_os) path: []const u8474
475
476
477
478
479
480
481
482pub fn parsePath(path: []const u8) switch (native_os) {
.windows => WindowsPath2(u8),
else => PosixPath,
} {
switch (native_os) {
.windows => return parsePathWindows(u8, path),
else => return parsePathPosix(path),
}
}
On Windows, this calls
parsePathWindowsand on POSIX it callsparsePathPosix.Returns a platform-specific struct with two fields:
rootandkind. Therootwill be a slice ofpath(/for POSIX absolute paths, and things likeC:\,\\server\share\, etc for Windows paths). If the path is of kind.relative, thenrootwill be zero-length.