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 › Build › Step › WriteFile › addCopyDirectory Public Function addCopyDirectory Doc Source 126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159 pub fn addCopyDirectory (
wf : *WriteFile ,
src_path : std .Build .LazyPath ,
sub_path : []const u8 ,
options : CopyDirectoryOptions ,
) std .Build .LazyPath {
const graph = wf .step .owner .graph ;
const wc = &graph .wip_configuration ;
const arena = graph .arena ;
wf .directories .append (arena , .{
.sub_path = wc .addString (sub_path ) catch @panic ("OOM" ),
.src_path = src_path .dupe (graph ),
.exclude_extensions = if (options .exclude_extensions .len != 0 )
.init (wc .addStringList (options .exclude_extensions ) catch @panic ("OOM" ))
else
.none ,
.include_extensions = if (options .include_extensions ) |list |
.init (wc .addStringList (list ) catch @panic ("OOM" ))
else
.none ,
}) catch @panic ("OOM" );
wf .maybeUpdateName ();
src_path .addStepDependencies (&wf .step );
return .{
.generated = .{
.index = wf .generated_directory ,
.sub_path = graph .dupePath (sub_path ),
},
};
}
Copy files matching the specified exclude/include patterns to the specified subdirectory relative to this step's generated directory.
The returned value is a lazy path to the generated subdirectory.