X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinaryparser.h;h=d275290cbece483a6b1ec1b2b6e109da9f5806db;hb=2d289d20a9a4aeac7774976e4213a7c72f1dc75b;hp=560703c66ddb337791a98b7e72d8dc1c81262169;hpb=27630d44298cb67e075c166f4421288cc8ca117e;p=libs%2Fdatafile.git diff --git a/source/binaryparser.h b/source/binaryparser.h index 560703c..d275290 100644 --- a/source/binaryparser.h +++ b/source/binaryparser.h @@ -1,40 +1,38 @@ -/* $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" +#include "type.h" namespace Msp { namespace DataFile { +/** +Parses data in binary format. +*/ class BinaryParser: public ParserMode { private: - typedef std::map Dictionary; - typedef std::map EnumMap; + typedef std::map Dictionary; + typedef std::map StringMap; Dictionary dict; - EnumMap enums; + StringMap strings; bool first; + unsigned float_precision; public: BinaryParser(Input &i, const std::string &s); - Statement parse(); + + virtual Statement parse(bool); private: - Statement parse_statement(); - long long parse_int(); - float parse_float(); - std::string parse_string(); - bool parse_bool(); - std::string parse_enum(); + Statement parse_statement(bool); + IntType::Store parse_int(); + FloatType::Store parse_float(); + StringType::Store parse_string(); + BoolType::Store parse_bool(); + SymbolType::Store parse_symbol(); }; } // namespace DataFile