--- /dev/null
+/*
+This file is part of libmspparser
+Copyright © 2006 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+#include "input.h"
+
+namespace Msp {
+namespace Parser {
+
+Input::Input(std::istream &i):
+ in(i),
+ line(1),
+ next(-1)
+{ }
+
+int Input::get()
+{
+ int c=next;
+ next=-1;
+ if(c<0) c=in.get();
+
+ if(c=='\n')
+ ++line;
+
+ return c;
+}
+
+int Input::peek()
+{
+ if(next<0)
+ next=in.get();
+ return next;
+}
+
+} // namespace Parser
+} // namespace Msp