DoxigAlpha

join

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 join(p: Path, arena: Allocator, sub_path: []const u8) Allocator.Error!Path {
    if (sub_path.len == 0) return p;
    const parts: []const []const u8 =
        if (p.sub_path.len == 0) &.{sub_path} else &.{ p.sub_path, sub_path };
    return .{
        .root_dir = p.root_dir,
        .sub_path = try fs.path.join(arena, parts),
    };
}