-/* $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_
namespace Msp {
namespace DataFile {
+/**
+Parses data in binary format.
+*/
class BinaryParser: public ParserMode
{
private:
typedef std::map<unsigned, DictEntry> Dictionary;
- typedef std::map<unsigned, std::string> EnumMap;
+ typedef std::map<unsigned, std::string> StringMap;
Dictionary dict;
- EnumMap enums;
+ StringMap strings;
bool first;
public:
BinaryParser(Input &i, const std::string &s);
- Statement parse();
+
+ virtual Statement parse();
private:
Statement parse_statement();
long long parse_int();
std::string parse_string();
bool parse_bool();
std::string parse_enum();
+ const std::string &lookup_string(unsigned) const;
};
} // namespace DataFile