Finished an initial version of extraction
It works, but is very slow.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user