aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/json/json_writer_output.h
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2023-12-22 20:30:08 +0100
committerGitHub <noreply@github.com>2023-12-22 20:30:08 +0100
commit6b4f46a6883f21c16eef367106167ea59932515e (patch)
tree5833709b16bba3948f15e88b9038229c5065605b /library/cpp/protobuf/json/json_writer_output.h
parenta8b737f2a6df02f6e45ed703246c75f0f4cf7a34 (diff)
downloadydb-6b4f46a6883f21c16eef367106167ea59932515e.tar.gz
Import libs 3 (#679)
Diffstat (limited to 'library/cpp/protobuf/json/json_writer_output.h')
-rw-r--r--library/cpp/protobuf/json/json_writer_output.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/library/cpp/protobuf/json/json_writer_output.h b/library/cpp/protobuf/json/json_writer_output.h
index 3d8a2daa56..975245a264 100644
--- a/library/cpp/protobuf/json/json_writer_output.h
+++ b/library/cpp/protobuf/json/json_writer_output.h
@@ -86,7 +86,7 @@ namespace NProtobufJson {
{
}
- private:
+ protected:
static NJson::TJsonWriterConfig CreateJsonWriterConfig(const TProto2JsonConfig& cfg);
};
@@ -95,7 +95,8 @@ namespace NProtobufJson {
template <typename TConfig>
TJsonStringWriterOutput(TString* str, const TConfig& cfg)
: TEmbedPolicy<TStringOutput>(*str)
- , TJsonWriterOutput(TEmbedPolicy<TStringOutput>::Ptr(), cfg)
+ // If Unbuffered = false, TJsonWriter uses its own string and then flushes it into TStringOutput.
+ , TJsonWriterOutput(TEmbedPolicy<TStringOutput>::Ptr(), CreateJsonWriterConfig(cfg).SetUnbuffered(true))
{
}
};