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 library itself.
Zig › std/ › Progress.zig › appendTreeSymbol
appendTreeSymbol
Progress.appendTreeSymbol
fn appendTreeSymbol (symbol : TreeSymbol , buf : []u8 , start_i : usize ) usize
File
Code
fn appendTreeSymbol (symbol : TreeSymbol , buf : []u8 , start_i : usize ) usize {
switch (global_progress .terminal_mode ) {
.off => unreachable ,
.ansi_escape_codes => {
const bytes = symbol .escapeSeq ();
buf [start_i ..][0 ..bytes .len ].* = bytes .*;
return start_i + bytes .len ;
},
.windows_api => |windows_api | {
const bytes = switch (windows_api .code_page ) {
437 => symbol .bytes (.code_page_437 ),
65001 => symbol .bytes (.utf8 ),
else => symbol .bytes (.ascii ),
};
@memcpy (buf [start_i ..][0 ..bytes .len ], bytes );
return start_i + bytes .len ;
},
}
}