enumstd.fs.path.PathType[src]

Fields

windows
uefi
posix

Functions

FunctionisSep[src]

pub inline fn isSep(comptime path_type: PathType, comptime T: type, c: T) bool

Returns true if c is a valid path separator for the path_type.

Parameters

path_type: PathType
T: type
c: T

Source Code

Source code
pub inline fn isSep(comptime path_type: PathType, comptime T: type, c: T) bool {
    return switch (path_type) {
        .windows => c == '/' or c == '\\',
        .posix => c == '/',
        .uefi => c == '\\',
    };
}

Source Code

Source code
pub const PathType = enum {
    windows,
    uefi,
    posix,

    /// Returns true if `c` is a valid path separator for the `path_type`.
    pub inline fn isSep(comptime path_type: PathType, comptime T: type, c: T) bool {
        return switch (path_type) {
            .windows => c == '/' or c == '\\',
            .posix => c == '/',
            .uefi => c == '\\',
        };
    }
}