improve docs

including `writeString()`
This commit is contained in:
Christopher Dunn
2015-01-25 19:20:43 -06:00
parent 54b8e6939a
commit 9da9f84903
2 changed files with 13 additions and 8 deletions

View File

@@ -27,7 +27,7 @@ class StreamWriterBuilder;
/**
Usage:
\code
using namespace Json;
Value value;
StreamWriter::Builder builder;
@@ -36,16 +36,18 @@ Usage:
builder.newStreamWriter(&std::cout));
writer->write(value);
std::cout.flush();
\endcode
*/
class JSON_API StreamWriter {
protected:
std::ostream& sout_; // not owned; will not delete
public:
/// `All`: Keep all comments.
/// `None`: Drop all comments.
/// Use `Most` to recover the odd behavior of previous versions.
/// Only `All` is currently implemented.
enum class CommentStyle {None, Most, All};
/// Decide whether to write comments.
enum class CommentStyle {
None, ///< Drop all comments.
Most, ///< Recover odd behavior of previous versions (not implemented yet).
All ///< Keep all comments.
};
/// Keep a reference, but do not take ownership of `sout`.
StreamWriter(std::ostream* sout);