Finished an initial version of extraction

It works, but is very slow.
This commit is contained in:
Caleb Gardner
2026-05-21 05:07:02 -05:00
parent 69ce562b6c
commit d1d453ac29
7 changed files with 276 additions and 64 deletions
+2 -7
View File
@@ -14,16 +14,11 @@ pub fn init(fil: File, init_offset: u64) OffsetFile {
return .{ .fil = fil, .offset = init_offset };
}
pub fn readerAt(self: OffsetFile, io: Io, offset: u64, buffer: []u8) !Reader {
pub fn readerAt(self: OffsetFile, io: Io, offset: u64, buffer: []u8) Reader.SeekError!Reader {
var rdr = self.fil.reader(io, buffer);
try rdr.seekTo(self.offset + offset);
return rdr;
}
pub fn readAt(self: OffsetFile, io: Io, offset: u64, buf: []u8) !void {
pub fn readAt(self: OffsetFile, io: Io, offset: u64, buf: []u8) File.ReadPositionalError!void {
_ = try self.fil.readPositionalAll(io, buf, self.offset + offset);
}
pub fn readValueAt(self: OffsetFile, comptime T: anytype, io: Io, offset: u64) !void {
//TODO: check for endianess and decode accordingly.
var new: T = undefined;
_ = try self.fil.readPositionalAll(io, @ptrCast(&new), self.offset + offset);
}