Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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 standard library. Public Function

parsePath

Public Function
std.fs.path.parsePath
pub fn parsePath(path: []const u8) switch (native_os)

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.

Params

  • path: []const u8

File

fs/path.zig:474
474
475
476
477
478
479
480
481
482
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),
    }
}