Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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. Public Function

addFilePath

Public Function
std.Build.Cache.Manifest.addFilePath
pub fn addFilePath(m: *Manifest, file_path: Path, max_file_size: ?usize) !usize

Add a file as a dependency of process being cached. When hit is called, the file's contents will be checked to ensure that it matches the contents from previous times.

Max file size will be used to determine the amount of space the file contents are allowed to take up in memory. If max_file_size is null, then the contents will not be loaded into memory.

Returns the index of the entry in the files array list. You can use it to access the contents of the file after calling hit() like so:

var file_contents = cache_hash.files.keys()[file_index].contents.?;

Params

File

Build/Cache.zig:403
403
404
405
    pub fn addFilePath(m: *Manifest, file_path: Path, max_file_size: ?usize) !usize {
        return addOpenedFile(m, file_path, null, max_file_size);
    }