Skip to content

Commit

Permalink
removing open function in zstr which does not work with older compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Nov 6, 2022
1 parent 664dd6e commit 1c229f0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/foreign/zstr/zstr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,10 @@ class ifstream
void close() {
_fs.close();
}
void open(const std::string filename, std::ios_base::openmode mode = std::ios_base::in) {
_fs.open(filename, mode);
std::istream::operator=(std::istream(new istreambuf(_fs.rdbuf())));
}
// void open(const std::string filename, std::ios_base::openmode mode = std::ios_base::in) {
// _fs.open(filename, mode);
// std::istream::operator=(std::istream(new istreambuf(_fs.rdbuf())));
// }
bool is_open() const {
return _fs.is_open();
}
Expand Down Expand Up @@ -460,11 +460,11 @@ class ofstream
std::ostream::flush();
_fs.close();
}
void open(const std::string filename, std::ios_base::openmode mode = std::ios_base::out, int level = Z_DEFAULT_COMPRESSION) {
flush();
_fs.open(filename, mode | std::ios_base::binary);
std::ostream::operator=(std::ostream(new ostreambuf(_fs.rdbuf(), default_buff_size, level)));
}
// void open(const std::string filename, std::ios_base::openmode mode = std::ios_base::out, int level = Z_DEFAULT_COMPRESSION) {
// flush();
// _fs.open(filename, mode | std::ios_base::binary);
// std::ostream::operator=(std::ostream(new ostreambuf(_fs.rdbuf(), default_buff_size, level)));
// }
bool is_open() const {
return _fs.is_open();
}
Expand Down

0 comments on commit 1c229f0

Please sign in to comment.