3 This file is part of libmspdatafile
4 Copyright © 2006 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_DATAFILE_BINARYWRITER_H_
9 #define MSP_DATAFILE_BINARYWRITER_H_
12 #include "binarydict.h"
13 #include "writermode.h"
18 class BinaryWriter: public WriterMode
21 typedef std::map<DictEntry, unsigned> Dictionary;
22 typedef std::map<std::string, unsigned> EnumMap;
27 unsigned next_enum_id;
30 BinaryWriter(std::ostream &o);
31 void write(const Statement &st);
33 void write_(const Statement &st);
34 DictEntry create_entry(const Statement &st);
35 void collect_keywords(const Statement &st);
36 void write_int(long long n);
37 void write_string(const std::string &s);
38 void write_float(float f);
39 void write_enum(const std::string &e);
42 } // namespace DataFile