implement strange setting from FastWriter

This commit is contained in:
Christopher Dunn
2015-01-25 18:15:54 -06:00
parent c6e0688e5a
commit d78caa3851
2 changed files with 88 additions and 12 deletions

View File

@@ -74,6 +74,24 @@ public:
Default: "\t"
*/
void setIndentation(std::string indentation);
/** \brief Drop the "null" string from the writer's output for nullValues.
* Strictly speaking, this is not valid JSON. But when the output is being
* fed to a browser's Javascript, it makes for smaller output and the
* browser can handle the output just fine.
*/
void setDropNullPlaceholders(bool v);
/** \brief Do not add \n at end of document.
* Normally, we add an extra newline, just because.
*/
void setOmitEndingLineFeed(bool v);
/** \brief Add a space after ':'.
* If indentation is non-empty, we surround colon with whitespace,
* e.g. " : "
* This will add back the trailing space when there is no indentation.
* This seems dubious when the entire document is on a single line,
* but we leave this here to repduce the behavior of the old `FastWriter`.
*/
void setEnableYAMLCompatibility(bool v);
/// Do not take ownership of sout, but maintain a reference.
StreamWriter* newStreamWriter(std::ostream* sout) const;