X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinarywriter.h;h=f028f39d96f811775a30a9d9a0fa2b730a3fe9e2;hb=5c98c1f499413c41fd46ddf71a46b481338d7d6b;hp=691ed701d3bcaa4be9c5641aeebddfb0391fabb9;hpb=505042fcda16151f5ace243c243d34af3efcf677;p=libs%2Fdatafile.git diff --git a/source/binarywriter.h b/source/binarywriter.h index 691ed70..f028f39 100644 --- a/source/binarywriter.h +++ b/source/binarywriter.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspdatafile -Copyright © 2006 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_DATAFILE_BINARYWRITER_H_ #define MSP_DATAFILE_BINARYWRITER_H_ @@ -22,19 +15,19 @@ class BinaryWriter: public WriterMode { private: typedef std::map Dictionary; - typedef std::map EnumMap; + typedef std::map StringMap; Dictionary dict; - unsigned next_st_id; - EnumMap enums; - unsigned next_enum_id; + unsigned next_kwd_id; + StringMap strings; + unsigned next_str_id; public: - BinaryWriter(std::ostream &o); - void write(const Statement &st); + BinaryWriter(IO::Base &o); + + virtual void write(const Statement &st); private: void write_(const Statement &st); - DictEntry create_entry(const Statement &st); void collect_keywords(const Statement &st); void write_int(long long n); void write_string(const std::string &s);