#include "fson/FsonWriter.hh"

The pretty-printing serializer.

MemberDescription
enum class Dialect { Fson, Json, Json5 }output dialect, default Fson — see dialects
setDialect(Dialect) / getDialect()
enum class DisabledMemberPolicy { ConvertToComment, Keep, Drop }-- members in the Json / Json5 dialects, default ConvertToComment; no effect on Fson — see DisabledMemberPolicy
setDisabledMemberPolicy(...) / getDisabledMemberPolicy()
setKeepDisabledMembers(bool) / getKeepDisabledMembers()deprecated shim: trueKeep, falseConvertToComment
setPreferBareKeys(bool) / getPreferBareKeys()Fson / Json5: write quoted keys bare wherever the name grammar allows; no effect on Json
write(document, std::ostream&)serialize to a stream; dispatches on the root value's actual type
write(document) → std::stringserialize to a string
writeFile(document, filename) → boolfalse on I/O failure
static encodeString(text) → std::stringstring escaping without the quotes; valid in all three dialects
FsonWriter w;
w.setDialect( FsonWriter::Dialect::Json5 );
w.setPreferBareKeys( true );
std::string json5 = w.write( *doc );

The default Fson dialect is what Fson::save uses.