Add Archive::GetFD
This commit is contained in:
parent
f8e1dfbbc6
commit
d8d7e5b9bb
5 changed files with 34 additions and 5 deletions
|
@ -36,16 +36,16 @@ bool ScopedTemporaryFile::Init() {
|
|||
return base::CreateTemporaryFile(&path_);
|
||||
}
|
||||
|
||||
bool ScopedTemporaryFile::InitFromFile(base::File& src,
|
||||
bool ScopedTemporaryFile::InitFromFile(base::File* src,
|
||||
uint64 offset, uint64 size) {
|
||||
if (!src.IsValid())
|
||||
if (!src->IsValid())
|
||||
return false;
|
||||
|
||||
if (!Init())
|
||||
return false;
|
||||
|
||||
std::vector<char> buf(size);
|
||||
int len = src.Read(offset, buf.data(), buf.size());
|
||||
int len = src->Read(offset, buf.data(), buf.size());
|
||||
if (len != static_cast<int>(size))
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue