X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fwriter.h;h=c8d75e32dcd643bb09e3ec281331800691c99e02;hb=9867e5fdf99d7d6c9d83846c11a1cee6a9919be1;hp=698bade8f650cf45198ee92ac147f18a10540b02;hpb=505042fcda16151f5ace243c243d34af3efcf677;p=libs%2Fdatafile.git diff --git a/source/writer.h b/source/writer.h index 698bade..c8d75e3 100644 --- a/source/writer.h +++ b/source/writer.h @@ -1,15 +1,8 @@ -/* $Id$ - -This file is part of libmspdatafile -Copyright © 2006 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_DATAFILE_WRITER_H_ #define MSP_DATAFILE_WRITER_H_ #include -#include +#include #include "binarydict.h" namespace Msp { @@ -24,12 +17,13 @@ Frontend for writing data. class Writer { private: - std::ostream &out; + IO::Base &out; WriterMode *mode; bool binary; public: - Writer(std::ostream &o); + Writer(IO::Base &o); + ~Writer(); /** Writes a statement to the output. This function always writes a complete @@ -44,6 +38,11 @@ public: @param b true for binary mode, false for text */ void set_binary(bool b); + + /** Sets the precision of floating point numbers in bits. Depending on the + mode not all values may be valid, but any value between 16 and 64 that is + divisible by 8 is guaranteed to work. */ + void set_float_precision(unsigned); }; } // namespace DataFile