X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput.cpp;h=f3f8f23f3343fa9352a618c82f8c151f2811573e;hb=e26f7e98e5d8a5666192a43348b3ca7a35f6b860;hp=5b2d63b7ba8becdc20232a8933b815b3c5d5f288;hpb=5453824394771ca21de32088a2842486b63e6f6d;p=libs%2Fdatafile.git diff --git a/source/input.cpp b/source/input.cpp index 5b2d63b..f3f8f23 100644 --- a/source/input.cpp +++ b/source/input.cpp @@ -1,14 +1,15 @@ -/* -This file is part of libmspparser -Copyright © 2006 Mikko Rasa, Mikkosoft Productions +/* $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