]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/input.cpp
Fix EOF handling
[libs/datafile.git] / source / input.cpp
index 0f23bb29b9797bff09fc738dc52be6e7aeddf8e7..f3f8f23f3343fa9352a618c82f8c151f2811573e 100644 (file)
@@ -1,14 +1,15 @@
-/*
-This file is part of libmspparser
+/* $Id$
+
+This file is part of libmspdatafile
 Copyright © 2006  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 #include "input.h"
 
 namespace Msp {
-namespace Parser {
+namespace DataFile {
 
-Input::Input(std::istream &i):
+Input::Input(IO::Base &i):
        in(i),
        line(1),
        next(-1)
@@ -33,5 +34,10 @@ int Input::peek()
        return next;
 }
 
-} // namespace Parser
+Input::operator bool() const
+{
+       return next>=0 || !in.eof();
+}
+
+} // namespace DataFile
 } // namespace Msp