]> git.tdb.fi Git - libs/datafile.git/blob - source/input.h
12d3eff08dff23156fe3f43a59037157e21aface
[libs/datafile.git] / source / input.h
1 /*
2 This file is part of libmspparser
3 Copyright © 2006 Mikko Rasa, Mikkosoft Productions
4 Distributed under the LGPL
5 */
6 #ifndef MSP_PARSER_INPUT_H_
7 #define MSP_PARSER_INPUT_H_
8
9 #include <istream>
10
11 namespace Msp {
12 namespace Parser {
13
14 class Input
15 {   
16 public:
17         Input(std::istream &); 
18         int get();
19         int peek();
20         unsigned get_line_number() const { return line; }
21         operator bool() const { return (bool)in; }
22 private:
23         std::istream &in;
24         unsigned line;
25         int next;
26 };  
27
28 } // namespace Parser
29 } // namespace Msp
30
31 #endif