]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/writer.h
Implement proper copy semantics
[libs/datafile.git] / source / writer.h
index c8d75e32dcd643bb09e3ec281331800691c99e02..c209947986a5d70a861a3859983aa597cee61bc3 100644 (file)
@@ -2,8 +2,9 @@
 #define MSP_DATAFILE_WRITER_H_
 
 #include <map>
+#include <msp/core/noncopyable.h>
 #include <msp/io/base.h>
-#include "binarydict.h"
+#include "output.h"
 
 namespace Msp {
 namespace DataFile {
@@ -14,10 +15,10 @@ class WriterMode;
 /**
 Frontend for writing data.
 */
-class Writer
+class Writer: private NonCopyable
 {
 private:
-       IO::Base &out;
+       Output out;
        WriterMode *mode;
        bool binary;
 
@@ -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. */