DoxigAlpha

resolvePosix

Function parameters

Parameters

#
sub_path:[]const u8

Useful to make `Path` a key in `std.ArrayHashMap`.

Types

#
TableAdapter
Useful to make `Path` a key in `std.ArrayHashMap`.

Functions in this namespace

Functions

#
fmtEscapeChar
Deprecated, use double quoted escape to print paths.
formatEscapeChar
Deprecated, use double quoted escape to print paths.

Source

Implementation

#
pub fn resolvePosix(p: Path, arena: Allocator, sub_path: []const u8) Allocator.Error!Path {
    if (sub_path.len == 0) return p;
    const new_sub_path = try fs.path.resolvePosix(arena, &.{ p.sub_path, sub_path });
    return .{
        .root_dir = p.root_dir,
        // Use "" instead of "." to represent `root_dir` itself.
        .sub_path = if (std.mem.eql(u8, new_sub_path, ".")) "" else new_sub_path,
    };
}