X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput.h;h=a9c96f48abce9cdf9e533e640f3913c8849e0d7f;hb=HEAD;hp=f5cd3ed24c605797aa0223f5d922cc1ea87f2d01;hpb=9094bc6a657e5587e7e17827c35e3fd388fb91ec;p=libs%2Fdatafile.git diff --git a/source/input.h b/source/input.h index f5cd3ed..6cc53e7 100644 --- a/source/input.h +++ b/source/input.h @@ -1,31 +1,32 @@ -/* -This file is part of libmspparser -Copyright © 2006 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ -#ifndef MSP_PARSER_INPUT_H_ -#define MSP_PARSER_INPUT_H_ +#ifndef MSP_DATAFILE_INPUT_H_ +#define MSP_DATAFILE_INPUT_H_ -#include +#include +#include namespace Msp { -namespace Parser { +namespace DataFile { -class Input +class Input: private NonCopyable { +private: + IO::Base *in = nullptr; + IO::Base *compressed = nullptr; + unsigned line = 1; + int next = -1; + public: - Input(std::istream &); + Input(IO::Base &); + ~Input(); + + void set_decompress(); int get(); int peek(); unsigned get_line_number() const { return line; } - operator bool() const { return in; } -private: - std::istream ∈ - unsigned line; - int next; + explicit operator bool() const; }; -} // namespace Parser +} // namespace DataFile } // namespace Msp #endif