]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/writer.h
Add Readme.txt and some other documentation
[libs/datafile.git] / source / writer.h
index 756e19a22c41668cea43fb5387944b90b84a4721..698bade8f650cf45198ee92ac147f18a10540b02 100644 (file)
@@ -18,6 +18,9 @@ namespace DataFile {
 class Statement;
 class WriterMode;
 
+/**
+Frontend for writing data.
+*/
 class Writer
 {
 private:
@@ -26,9 +29,21 @@ 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