Readd openNewStream function for gzdopen() via SMUSH
This commit is contained in:
parent
135bea3ba8
commit
ea93407848
2 changed files with 18 additions and 7 deletions
10
lab.cpp
10
lab.cpp
|
@ -90,6 +90,16 @@ Block *Lab::getFileBlock(const char *filename) const {
|
|||
return new Block(data, i->second.len);
|
||||
}
|
||||
|
||||
std::FILE *Lab::openNewStream(const char *filename) const {
|
||||
file_map_type::const_iterator i = find_filename(filename);
|
||||
if (i == file_map_.end())
|
||||
return NULL;
|
||||
|
||||
std::fseek(f_, i->second.offset, SEEK_SET);
|
||||
|
||||
return f_;
|
||||
}
|
||||
|
||||
int Lab::fileLength(const char *filename) const {
|
||||
file_map_type::const_iterator i = find_filename(filename);
|
||||
if (i == file_map_.end())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue