X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinarywriter.h;h=b10c5abdce2adc887f0c70bb5080eacc92efc518;hb=4edbe0eb078c4e480682862ccb68ebc8cb284045;hp=6ad290451b4502c3566a68668a476a40c7595b82;hpb=6f94aaece716a31e75166e261cc47579288892b4;p=libs%2Fdatafile.git diff --git a/source/binarywriter.h b/source/binarywriter.h index 6ad2904..b10c5ab 100644 --- a/source/binarywriter.h +++ b/source/binarywriter.h @@ -2,7 +2,7 @@ #define MSP_DATAFILE_BINARYWRITER_H_ #include -#include "binarydict.h" +#include "statement.h" #include "type.h" #include "writermode.h" @@ -15,25 +15,27 @@ Writes data in binary format. class BinaryWriter: public WriterMode { private: - typedef std::map Dictionary; + typedef std::map Dictionary; typedef std::map StringMap; Dictionary dict; unsigned next_kwd_id; StringMap strings; unsigned next_str_id; + unsigned float_precision; public: - BinaryWriter(IO::Base &o); + BinaryWriter(Output &o); + virtual void set_float_precision(unsigned); virtual void write(const Statement &st); private: void write_(const Statement &st); void collect_keywords(const Statement &st); - void write_int(long long n); - void write_string(const std::string &s); - void write_float(float f); - void write_symbol(const Symbol &s); + void write_int(IntType::Store n); + void write_string(const StringType::Store &s); + void write_float(FloatType::Store f); + void write_symbol(const SymbolType::Store &s); }; } // namespace DataFile