Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

parsePath

On Windows, this calls parsePathWindows and on POSIX it calls parsePathPosix.

Returns a platform-specific struct with two fields: root and kind. The root will be a slice of path (/ for POSIX absolute paths, and things like C:\, \\server\share\, etc for Windows paths). If the path is of kind .relative, then root will be zero-length.

path.parsePath
pub fn parsePath(path: []const u8) switch (native_os)

File

lib/std/fs/path.zig:474

Code

pub 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),
    }
}