readData
Parameters
- self:*const File
- *const File
- allocator:std.mem.Allocator
- std.mem.Allocator
Source
Implementation
pub fn readData(self: *const File, allocator: std.mem.Allocator) std.mem.Allocator.Error![]u8 {
std.debug.assert(dvui.backend.kind == .web); // WasmFile shouldn't be used outside wasm builds
const data = try allocator.alloc(u8, self.size);
dvui.backend.readFileData(self.id, self.index, data.ptr);
return data;
}