diff options
author | myltsev <myltsev@yandex-team.ru> | 2022-02-10 16:46:03 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:03 +0300 |
commit | fc361854fd6ee8d747229b090f0b8018e260d1fb (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/json/writer/README | |
parent | 9166d66c30c23c9e85a7c88185a068987148d23f (diff) | |
download | ydb-fc361854fd6ee8d747229b090f0b8018e260d1fb.tar.gz |
Restoring authorship annotation for <myltsev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/json/writer/README')
-rw-r--r-- | library/cpp/json/writer/README | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/library/cpp/json/writer/README b/library/cpp/json/writer/README index 6e6f754658..a20489f32e 100644 --- a/library/cpp/json/writer/README +++ b/library/cpp/json/writer/README @@ -1,23 +1,23 @@ -JSON writer with no external dependencies, producing output -where HTML special characters are always escaped. - -Use it like this: - +JSON writer with no external dependencies, producing output +where HTML special characters are always escaped. + +Use it like this: + #include <library/cpp/json/writer/json.h> - ... - - NJsonWriter::TBuf json; - json.BeginList() - .WriteString("<script>") - .EndList(); - Cout << json.Str(); // output: ["\u003Cscript\u003E"] - -For compatibility with legacy formats where object keys -are not quoted, use CompatWriteKeyWithoutQuotes: - - NJsonWriter::TBuf json; - json.BeginObject() - .CompatWriteKeyWithoutQuotes("r").WriteInt(1) - .CompatWriteKeyWithoutQuotes("n").WriteInt(0) - .EndObject(); - Cout << json.Str(); // output: {r:1,n:0} + ... + + NJsonWriter::TBuf json; + json.BeginList() + .WriteString("<script>") + .EndList(); + Cout << json.Str(); // output: ["\u003Cscript\u003E"] + +For compatibility with legacy formats where object keys +are not quoted, use CompatWriteKeyWithoutQuotes: + + NJsonWriter::TBuf json; + json.BeginObject() + .CompatWriteKeyWithoutQuotes("r").WriteInt(1) + .CompatWriteKeyWithoutQuotes("n").WriteInt(0) + .EndObject(); + Cout << json.Str(); // output: {r:1,n:0} |