Gzipped file output stream class. More...
#include "gzfstream.h"
Public Member Functions | |
gzofstream () | |
gzofstream (const char *name, std::ios_base::openmode mode=std::ios_base::out) | |
Construct stream on gzipped file to be opened. More... | |
gzofstream (int fd, std::ios_base::openmode mode=std::ios_base::out) | |
Construct stream on already open gzipped file. More... | |
void | attach (int fd, std::ios_base::openmode mode=std::ios_base::out) |
Attach to already open gzipped file. More... | |
void | close () |
Close gzipped file. More... | |
bool | is_open () |
Check if file is open. More... | |
void | open (const char *name, std::ios_base::openmode mode=std::ios_base::out) |
Open gzipped file. More... | |
gzfilebuf * | rdbuf () const |
Obtain underlying stream buffer. More... | |
Gzipped file output stream class.
This class implements ofstream for gzipped files. Seeking and putback is not supported yet.
Definition at line 364 of file gzfstream.h.
gzofstream::gzofstream | ( | ) |
Definition at line 573 of file gzfstream.cc.
|
explicit |
Construct stream on gzipped file to be opened.
name | Filename. |
mode | Open mode flags (forced to contain ios::out). |
Definition at line 578 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::out). |
Definition at line 586 of file gzfstream.cc.
References attach().
void gzofstream::attach | ( | int | fd, |
std::ios_base::openmode | mode = std::ios_base::out |
||
) |
Attach to already open gzipped file.
fd | File descriptor. |
mode | Open mode flags (forced to contain ios::out). |
Stream will be in state good() if attach succeeded; otherwise in state fail().
Definition at line 605 of file gzfstream.cc.
References gzfilebuf::attach().
Referenced by gzofstream().
void gzofstream::close | ( | ) |
Close gzipped file.
Stream will be in state fail() if close failed.
Definition at line 615 of file gzfstream.cc.
References gzfilebuf::close().
Referenced by load_save_system::dump_octave_core().
|
inline |
Check if file is open.
Definition at line 400 of file gzfstream.h.
References gzfilebuf::is_open().
void gzofstream::open | ( | const char * | name, |
std::ios_base::openmode | mode = std::ios_base::out |
||
) |
Open gzipped file.
name | Filename. |
mode | Open mode flags (forced to contain ios::out). |
Stream will be in state good() if file opens successfully; otherwise in state fail(). This differs from the behavior of ofstream, 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 595 of file gzfstream.cc.
References gzfilebuf::open().
Referenced by gzofstream().
|
inline |
Obtain underlying stream buffer.
Definition at line 392 of file gzfstream.h.
Referenced by setcompression().