class Statement;
class WriterMode;
+/**
+Frontend for writing data.
+*/
class Writer
{
private:
bool binary;
public:
- Writer(std::ostream &);
- void write(const Statement &);
- void set_binary(bool);
+ Writer(std::ostream &o);
+
+ /**
+ Writes a statement to the output. This function always writes a complete
+ statement, so it's not possible to add substatements later.
+ */
+ void write(const Statement &st);
+
+ /**
+ Sets binary or text mode. While it is possible to enter and exit binary
+ mode multiple times, doing so produces sub-optimal output.
+
+ @param b true for binary mode, false for text
+ */
+ void set_binary(bool b);
};
} // namespace DataFile