X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fwriter.h;h=c209947986a5d70a861a3859983aa597cee61bc3;hb=e1b8089be727f651fc2022d6e7ff775047730e85;hp=698bade8f650cf45198ee92ac147f18a10540b02;hpb=505042fcda16151f5ace243c243d34af3efcf677;p=libs%2Fdatafile.git diff --git a/source/writer.h b/source/writer.h index 698bade..c209947 100644 --- a/source/writer.h +++ b/source/writer.h @@ -1,16 +1,10 @@ -/* $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 "binarydict.h" +#include +#include +#include "output.h" namespace Msp { namespace DataFile { @@ -21,15 +15,16 @@ class WriterMode; /** Frontend for writing data. */ -class Writer +class Writer: private NonCopyable { private: - std::ostream &out; + Output 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 +39,15 @@ public: @param b true for binary mode, false for text */ void set_binary(bool b); + + /** Enables output compression. Once enabled, it won't be possible to + disable compression. */ + void set_compressed(); + + /** 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