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 | 9166d66c30c23c9e85a7c88185a068987148d23f (patch) | |
tree | 421bdcec5755d9e441c485560aab5ab8d74c7475 /library/cpp/json/writer/README | |
parent | 8d3a5ed3a188a34167eaee54f1691ce5c9edf2f3 (diff) | |
download | ydb-9166d66c30c23c9e85a7c88185a068987148d23f.tar.gz |
Restoring authorship annotation for <myltsev@yandex-team.ru>. Commit 1 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 a20489f32e..6e6f754658 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} |