Function addOpenedFile [src]

Same as addFilePath except the file has already been opened.

Prototype

pub fn addOpenedFile(m: *Manifest, path: Path, handle: ?fs.File, max_file_size: ?usize) !usize

Parameters

m: *Manifestpath: Pathhandle: ?fs.Filemax_file_size: ?usize

Source

pub fn addOpenedFile(m: *Manifest, path: Path, handle: ?fs.File, max_file_size: ?usize) !usize { const gpa = m.cache.gpa; try m.files.ensureUnusedCapacity(gpa, 1); const resolved_path = try fs.path.resolve(gpa, &.{ path.root_dir.path orelse ".", path.subPathOrDot(), }); errdefer gpa.free(resolved_path); const prefixed_path = try m.cache.findPrefixResolved(resolved_path); return addFileInner(m, prefixed_path, handle, max_file_size); }