Make TarStream::read_contents take any pointer as output
This commit is contained in:
parent
34e6c05cef
commit
c39e54b7c6
@ -32,7 +32,7 @@ class TarStream
|
|||||||
|
|
||||||
void rewind();
|
void rewind();
|
||||||
|
|
||||||
usize read_contents(const Entry& entry, char* buf, usize offset, usize length);
|
usize read_contents(const Entry& entry, void* buf, usize offset, usize length);
|
||||||
|
|
||||||
Result<OwnedStringView> read_contents_as_string(const Entry& entry, usize offset, usize max);
|
Result<OwnedStringView> read_contents_as_string(const Entry& entry, usize offset, usize max);
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ Result<TarStream::Entry> TarStream::read_next_entry()
|
|||||||
return parse_header(&header);
|
return parse_header(&header);
|
||||||
}
|
}
|
||||||
|
|
||||||
usize TarStream::read_contents(const Entry& entry, char* buf, usize offset, usize length)
|
usize TarStream::read_contents(const Entry& entry, void* buf, usize offset, usize length)
|
||||||
{
|
{
|
||||||
if (offset >= entry.size) return 0;
|
if (offset >= entry.size) return 0;
|
||||||
if ((length + offset) > entry.size) length = entry.size - offset;
|
if ((length + offset) > entry.size) length = entry.size - offset;
|
||||||
|
Loading…
Reference in New Issue
Block a user