X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinaryparser.h;h=6a46639cbbca7667873f5c5a68d30f8151e62dfa;hb=29fafaa2c570b0cf92f41eeb534cfb65a841a892;hp=f1d51b236edc8b192c3644574905775c7cf9b9da;hpb=505042fcda16151f5ace243c243d34af3efcf677;p=libs%2Fdatafile.git diff --git a/source/binaryparser.h b/source/binaryparser.h index f1d51b2..6a46639 100644 --- a/source/binaryparser.h +++ b/source/binaryparser.h @@ -1,16 +1,9 @@ -/* $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 { @@ -21,23 +14,25 @@ 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(); + virtual void process_control_statement(const Statement &); private: - Statement parse_statement(); - long long parse_int(); - float parse_float(); - std::string parse_string(); - bool parse_bool(); - std::string parse_enum(); + IntType::Store parse_int(); + FloatType::Store parse_float(); + StringType::Store parse_string(); + BoolType::Store parse_bool(); + SymbolType::Store parse_symbol(); }; } // namespace DataFile