1 #ifndef MSP_DATAFILE_WRITER_H_
2 #define MSP_DATAFILE_WRITER_H_
5 #include <msp/core/noncopyable.h>
6 #include <msp/io/base.h>
16 Frontend for writing data.
18 class Writer: private NonCopyable
30 Writes a statement to the output. This function always writes a complete
31 statement, so it's not possible to add substatements later.
33 void write(const Statement &st);
36 Sets binary or text mode. While it is possible to enter and exit binary
37 mode multiple times, doing so produces sub-optimal output.
39 @param b true for binary mode, false for text
41 void set_binary(bool b);
43 /** Enables output compression. Once enabled, it won't be possible to
44 disable compression. */
45 void set_compressed();
47 /** Sets the precision of floating point numbers in bits. Depending on the
48 mode not all values may be valid, but any value between 16 and 64 that is
49 divisible by 8 is guaranteed to work. */
50 void set_float_precision(unsigned);
53 } // namespace DataFile