X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinaryparser.h;fp=source%2Fbinaryparser.h;h=560703c66ddb337791a98b7e72d8dc1c81262169;hb=27630d44298cb67e075c166f4421288cc8ca117e;hp=0000000000000000000000000000000000000000;hpb=c4930d8d15a5a248ca921e0ed3f9bca8aa18b322;p=libs%2Fdatafile.git diff --git a/source/binaryparser.h b/source/binaryparser.h new file mode 100644 index 0000000..560703c --- /dev/null +++ b/source/binaryparser.h @@ -0,0 +1,43 @@ +/* $Id$ + +This file is part of libmspdatafile +Copyright © 2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ + +#ifndef MSP_DATAFILE_BINARYPARSER_H_ +#define MSP_DATAFILE_BINARYPARSER_H_ + +#include +#include "binarydict.h" +#include "parsermode.h" + +namespace Msp { +namespace DataFile { + +class BinaryParser: public ParserMode +{ +private: + typedef std::map Dictionary; + typedef std::map EnumMap; + + Dictionary dict; + EnumMap enums; + bool first; + +public: + BinaryParser(Input &i, const std::string &s); + Statement parse(); +private: + Statement parse_statement(); + long long parse_int(); + float parse_float(); + std::string parse_string(); + bool parse_bool(); + std::string parse_enum(); +}; + +} // namespace DataFile +} // namespace Msp + +#endif