X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput.cpp;h=cc82227281563a195fa3a88c5d6e78ef4c44ffc1;hb=7df5e45c7f414f6a07681dc4ec2abb63b091a309;hp=e03a92126944703234a8d6fa330c4eba66cacb5e;hpb=6dd94a7fe90c6467024685fbac769067ddb74688;p=libs%2Fdatafile.git diff --git a/source/input.cpp b/source/input.cpp index e03a921..cc82227 100644 --- a/source/input.cpp +++ b/source/input.cpp @@ -1,9 +1,3 @@ -/* $Id$ - -This file is part of libmspdatafile -Copyright © 2006 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ #include "input.h" namespace Msp { @@ -17,9 +11,9 @@ Input::Input(IO::Base &i): int Input::get() { - int c=next; - next=-1; - if(c<0) c=in.get(); + int c = next; + next = -1; + if(c<0) c = in.get(); if(c=='\n') ++line; @@ -30,9 +24,14 @@ int Input::get() int Input::peek() { if(next<0) - next=in.get(); + next = in.get(); return next; } +Input::operator bool() const +{ + return next>=0 || !in.eof(); +} + } // namespace DataFile } // namespace Msp