]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/input.cpp
Move the definition of Input's operator bool to the header
[libs/datafile.git] / source / input.cpp
index a1d462a770d320f0a13c59175459fc8c131186b4..4496439fcd393d3898dba41c8d48a0fcba2c245c 100644 (file)
@@ -5,10 +5,7 @@ namespace Msp {
 namespace DataFile {
 
 Input::Input(IO::Base &i):
-       in(&i),
-       compressed(0),
-       line(1),
-       next(-1)
+       in(&i)
 { }
 
 Input::~Input()
@@ -18,7 +15,7 @@ Input::~Input()
 
 void Input::set_decompress()
 {
-       compressed = new IO::ZlibCompressed(*in);
+       compressed = new IO::ZlibCompressed(*in, IO::M_READ);
        in = compressed;
 }
 
@@ -42,10 +39,5 @@ int Input::peek()
        return next;
 }
 
-Input::operator bool() const
-{
-       return next>=0 || !in->eof();
-}
-
 } // namespace DataFile
 } // namespace Msp