X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=blobdiff_plain;f=source%2Fwriter.h;h=18fb3141b2c8c83edb526da13ef76c981b0c4c1e;hp=c8d75e32dcd643bb09e3ec281331800691c99e02;hb=HEAD;hpb=19179a622c1de88de5ed7047643eec79f285bf2a diff --git a/source/writer.h b/source/writer.h index c8d75e3..5f32786 100644 --- a/source/writer.h +++ b/source/writer.h @@ -2,24 +2,25 @@ #define MSP_DATAFILE_WRITER_H_ #include +#include #include -#include "binarydict.h" +#include "output.h" namespace Msp { namespace DataFile { -class Statement; +struct Statement; class WriterMode; /** Frontend for writing data. */ -class Writer +class Writer: private NonCopyable { private: - IO::Base &out; - WriterMode *mode; - bool binary; + Output out; + WriterMode *mode = nullptr; + bool binary = false; public: Writer(IO::Base &o); @@ -39,6 +40,10 @@ public: */ 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. */