Zig 0.17.0-dev (Split by item) 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.
std › fs › path › compareDiskDesignators Private Function compareDiskDesignators Doc Source Private Function std.fs.path.compareDiskDesignators
fn compareDiskDesignators (comptime T : type , kind : DiskDesignatorKind , p1 : []const T , p2 : []const T ) bool Params File fs/path.zig: 803
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824 fn compareDiskDesignators (comptime T : type , kind : DiskDesignatorKind , p1 : []const T , p2 : []const T ) bool {
const eql = switch (T ) {
u8 => eqlIgnoreCaseWtf8 ,
u16 => eqlIgnoreCaseWtf16 ,
else => @compileError ("only u8 (WTF-8) and u16 (WTF-16LE) is supported" ),
};
switch (kind ) {
.drive => {
const drive_letter1 = getDriveLetter (T , p1 );
const drive_letter2 = getDriveLetter (T , p2 );
return eql (drive_letter1 , drive_letter2 );
},
.unc => {
const unc1 = parseUNC (T , p1 );
const unc2 = parseUNC (T , p2 );
return eql (unc1 .server , unc2 .server ) and
eql (unc1 .share , unc2 .share );
},
}
}
p1andp2are both assumed to be thekindprovided.