fn getLocalDevicePathType(comptime T: type, path: []const T) LocalDevicePathType T: typepath: []const T6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874fn getLocalDevicePathType(comptime T: type, path: []const T) LocalDevicePathType {
if (std.debug.runtime_safety) {
assert(Dir.path.getWin32PathType(T, path) == .local_device);
}
const backslash = std.mem.nativeToLittle(T, '\\');
const all_backslash = path[0] == backslash and
path[1] == backslash and
path[3] == backslash;
return switch (path[2]) {
std.mem.nativeToLittle(T, '?') => if (all_backslash) .verbatim else .fake_verbatim,
std.mem.nativeToLittle(T, '.') => .local_device,
else => unreachable,
};
}
Only relevant for Win32 -> NT path conversion. Asserts
pathis of typeDir.path.Win32PathType.local_device.