Gzipped file input stream class. More...
#include "gzfstream.h"
Public Member Functions | |
| gzifstream () | |
| gzifstream (const char *name, std::ios_base::openmode mode=std::ios_base::in) | |
| Construct stream on gzipped file to be opened. | |
| gzifstream (int fd, std::ios_base::openmode mode=std::ios_base::in) | |
| Construct stream on already open gzipped file. | |
| void | attach (int fd, std::ios_base::openmode mode=std::ios_base::in) |
| Attach to already open gzipped file. | |
| void | close () |
| Close gzipped file. | |
| bool | is_open () |
| Check if file is open. | |
| void | open (const char *name, std::ios_base::openmode mode=std::ios_base::in) |
| Open gzipped file. | |
| gzfilebuf * | rdbuf () const |
| Obtain underlying stream buffer. | |
Gzipped file input stream class.
This class implements ifstream for gzipped files. Seeking and putback is not supported yet.
Definition at line 277 of file gzfstream.h.
| gzifstream::gzifstream | ( | ) |
Definition at line 524 of file gzfstream.cc.
|
explicit |
Construct stream on gzipped file to be opened.
| name | Filename. |
| mode | Open mode flags (forced to contain ios::in). |
Definition at line 529 of file gzfstream.cc.
References open().
|
explicit |
Construct stream on already open gzipped file.
| fd | File descriptor. |
| mode | Open mode flags (forced to contain ios::in). |
Definition at line 537 of file gzfstream.cc.
References attach().
| void gzifstream::attach | ( | int | fd, |
| std::ios_base::openmode | mode = std::ios_base::in |
||
| ) |
Attach to already open gzipped file.
| fd | File descriptor. |
| mode | Open mode flags (forced to contain ios::in). |
Stream will be in state good() if attach succeeded; otherwise in state fail().
Definition at line 556 of file gzfstream.cc.
References gzfilebuf::attach().
Referenced by gzifstream().
| void gzifstream::close | ( | ) |
Close gzipped file.
Stream will be in state fail() if close failed.
Definition at line 566 of file gzfstream.cc.
References gzfilebuf::close().
Referenced by load_save_system::get_file_format(), and load_save_system::load().
|
inline |
Check if file is open.
Definition at line 313 of file gzfstream.h.
References gzfilebuf::is_open().
| void gzifstream::open | ( | const char * | name, |
| std::ios_base::openmode | mode = std::ios_base::in |
||
| ) |
Open gzipped file.
| name | Filename. |
| mode | Open mode flags (forced to contain ios::in). |
Stream will be in state good() if file opens successfully; otherwise in state fail(). This differs from the behavior of ifstream, which never sets the state to good() and therefore won't allow you to reuse the stream for a second file unless you manually clear() the state. The choice is a matter of convenience.
Definition at line 546 of file gzfstream.cc.
References gzfilebuf::open().
Referenced by gzifstream().
|
inline |
Obtain underlying stream buffer.
Definition at line 305 of file gzfstream.h.