File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -39,21 +39,25 @@ struct igzfstream {
3939 gzFile fileobj;
4040};
4141
42+ igzfstream&
43+ getline (igzfstream &in, std::string &line);
44+
45+ igzfstream&
46+ operator >>(igzfstream &in, std::string &line);
47+
48+
4249struct ogzfstream {
4350 ogzfstream (const std::string filename) :
4451 fileobj (gzopen(filename.c_str(), " w" )) {}
4552 ~ogzfstream () {gzclose_w (fileobj);}
46- /* eof is not a good error indicator for write */
47- // operator bool() const {return !gzeof(fileobj);}
53+
54+ /* Below: eof is not a good error indicator for output streams and
55+ * we often use this only when checking after opening a file. This
56+ * function needs improving */
57+ operator bool () const {return fileobj != NULL ;}
4858 gzFile fileobj;
4959};
5060
51- igzfstream&
52- getline (igzfstream &in, std::string &line);
53-
54- igzfstream&
55- operator >>(igzfstream &in, std::string &line);
56-
5761ogzfstream&
5862operator <<(ogzfstream &out, const std::string &line);
5963
You can’t perform that action at this time.
0 commit comments