robot-ya-builder 96458ea3c7 External build system generator release 65 11 months ago
..
ut bf0f13dd39 add ymake export to ydb 1 year ago
CMakeLists.darwin-arm64.txt ffff7a34e4 add darwin-arm64 CMakeLists 1 year ago
CMakeLists.darwin-x86_64.txt c76aaf823d Fix input variable missprint 1 year ago
CMakeLists.linux-aarch64.txt c76aaf823d Fix input variable missprint 1 year ago
CMakeLists.linux-x86_64.txt c76aaf823d Fix input variable missprint 1 year ago
CMakeLists.txt 96458ea3c7 External build system generator release 65 11 months ago
CMakeLists.windows-x86_64.txt c76aaf823d Fix input variable missprint 1 year ago
README.md b56bb904dc intermediate changes 2 years ago
json.cpp dfd20cd437 const char* -> TStringBuf 2 years ago
json.h 054d233fbe Restoring authorship annotation for <mpoleg@yandex-team.ru>. Commit 2 of 2. 2 years ago
json_ut.cpp 53354011ef health checker tests 2 years ago
json_value.cpp e601ca03f8 Y_VERIFY->Y_ABORT_UNLESS at ^l 1 year ago
json_value.h 13004290f7 1 year ago
json_value_ut.cpp 13004290f7 1 year ago
ya.make bf0f13dd39 add ymake export to ydb 1 year ago

README.md

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}