diff options
author | filmih <filmih@yandex-team.ru> | 2022-02-10 16:49:59 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:59 +0300 |
commit | 693ca74a6530df8930b0d445102e2ea77b8c4e00 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/protobuf/util | |
parent | 883c643baf3a1698f0f0a31a8973b61411cd311f (diff) | |
download | ydb-693ca74a6530df8930b0d445102e2ea77b8c4e00.tar.gz |
Restoring authorship annotation for <filmih@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/protobuf/util')
-rw-r--r-- | library/cpp/protobuf/util/pb_io.cpp | 24 | ||||
-rw-r--r-- | library/cpp/protobuf/util/pb_io.h | 8 |
2 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/protobuf/util/pb_io.cpp b/library/cpp/protobuf/util/pb_io.cpp index bbedfa16fa..6270ee0624 100644 --- a/library/cpp/protobuf/util/pb_io.cpp +++ b/library/cpp/protobuf/util/pb_io.cpp @@ -118,18 +118,18 @@ void SerializeToTextFormatWithEnumId(const NProtoBuf::Message& m, IOutputStream& } } -void SerializeToTextFormatPretty(const NProtoBuf::Message& m, IOutputStream& out) { - google::protobuf::TextFormat::Printer printer; - printer.SetUseUtf8StringEscaping(true); - printer.SetUseShortRepeatedPrimitives(true); - - NProtoBuf::io::TCopyingOutputStreamAdaptor adaptor(&out); - - if (!printer.Print(m, &adaptor)) { - ythrow yexception() << "SerializeToTextFormatPretty failed on Print"; - } -} - +void SerializeToTextFormatPretty(const NProtoBuf::Message& m, IOutputStream& out) { + google::protobuf::TextFormat::Printer printer; + printer.SetUseUtf8StringEscaping(true); + printer.SetUseShortRepeatedPrimitives(true); + + NProtoBuf::io::TCopyingOutputStreamAdaptor adaptor(&out); + + if (!printer.Print(m, &adaptor)) { + ythrow yexception() << "SerializeToTextFormatPretty failed on Print"; + } +} + static void ConfigureParser(const EParseFromTextFormatOptions options, NProtoBuf::TextFormat::Parser& p) { if (options & EParseFromTextFormatOption::AllowUnknownField) { diff --git a/library/cpp/protobuf/util/pb_io.h b/library/cpp/protobuf/util/pb_io.h index 089191c19e..493c84cb5f 100644 --- a/library/cpp/protobuf/util/pb_io.h +++ b/library/cpp/protobuf/util/pb_io.h @@ -48,10 +48,10 @@ int operator&(NProtoBuf::Message& m, IBinSaver& f); void SerializeToTextFormat(const NProtoBuf::Message& m, const TString& fileName); void SerializeToTextFormat(const NProtoBuf::Message& m, IOutputStream& out); -// Write a textual representation of the given message to the given output stream -// with flags UseShortRepeatedPrimitives and UseUtf8StringEscaping set to true. -void SerializeToTextFormatPretty(const NProtoBuf::Message& m, IOutputStream& out); - +// Write a textual representation of the given message to the given output stream +// with flags UseShortRepeatedPrimitives and UseUtf8StringEscaping set to true. +void SerializeToTextFormatPretty(const NProtoBuf::Message& m, IOutputStream& out); + // Write a textual representation of the given message to the given output stream // use enum id instead of enum name for all enum fields. void SerializeToTextFormatWithEnumId(const NProtoBuf::Message& m, IOutputStream& out); |