]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/input.cpp
Fix EOF handling
[libs/datafile.git] / source / input.cpp
index c421f01b977c36797d95c41d60f3787f4bdf3ac4..f3f8f23f3343fa9352a618c82f8c151f2811573e 100644 (file)
@@ -9,7 +9,7 @@ Distributed under the LGPL
 namespace Msp {
 namespace DataFile {
 
-Input::Input(std::istream &i):
+Input::Input(IO::Base &i):
        in(i),
        line(1),
        next(-1)
@@ -34,5 +34,10 @@ int Input::peek()
        return next;
 }
 
+Input::operator bool() const
+{
+       return next>=0 || !in.eof();
+}
+
 } // namespace DataFile
 } // namespace Msp