aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/util/pb_io.cpp
diff options
context:
space:
mode:
authorromanenko-ii <romanenko-ii@yandex-team.ru>2022-02-10 16:50:37 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:37 +0300
commit5ca39c6275c4cb3911098b94ffa1516f68b7d5e8 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/protobuf/util/pb_io.cpp
parent4ee92606ffd02329182167a0db41aae105a62c6c (diff)
downloadydb-5ca39c6275c4cb3911098b94ffa1516f68b7d5e8.tar.gz
Restoring authorship annotation for <romanenko-ii@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/protobuf/util/pb_io.cpp')
-rw-r--r--library/cpp/protobuf/util/pb_io.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/protobuf/util/pb_io.cpp b/library/cpp/protobuf/util/pb_io.cpp
index 650d76cbab..6270ee0624 100644
--- a/library/cpp/protobuf/util/pb_io.cpp
+++ b/library/cpp/protobuf/util/pb_io.cpp
@@ -10,17 +10,17 @@
#include <util/generic/string.h>
#include <util/stream/file.h>
#include <util/stream/str.h>
-#include <util/string/cast.h>
+#include <util/string/cast.h>
namespace NProtoBuf {
-
- class TEnumIdValuePrinter : public google::protobuf::TextFormat::FastFieldValuePrinter {
- public:
- void PrintEnum(int32 val, const TString& /*name*/, google::protobuf::TextFormat::BaseTextGenerator* generator) const override {
- generator->PrintString(ToString(val));
- }
- };
-
+
+ class TEnumIdValuePrinter : public google::protobuf::TextFormat::FastFieldValuePrinter {
+ public:
+ void PrintEnum(int32 val, const TString& /*name*/, google::protobuf::TextFormat::BaseTextGenerator* generator) const override {
+ generator->PrintString(ToString(val));
+ }
+ };
+
void ParseFromBase64String(const TStringBuf dataBase64, Message& m, bool allowUneven) {
if (!m.ParseFromString(allowUneven ? Base64DecodeUneven(dataBase64) : Base64StrictDecode(dataBase64))) {
ythrow yexception() << "can't parse " << m.GetTypeName() << " from base64-encoded string";
@@ -108,16 +108,16 @@ void SerializeToTextFormat(const NProtoBuf::Message& m, const TString& fileName)
SerializeToTextFormat(m, stream);
}
-void SerializeToTextFormatWithEnumId(const NProtoBuf::Message& m, IOutputStream& out) {
- google::protobuf::TextFormat::Printer printer;
- printer.SetDefaultFieldValuePrinter(new NProtoBuf::TEnumIdValuePrinter());
- NProtoBuf::io::TCopyingOutputStreamAdaptor adaptor(&out);
-
- if (!printer.Print(m, &adaptor)) {
- ythrow yexception() << "SerializeToTextFormatWithEnumId failed on Print";
- }
-}
-
+void SerializeToTextFormatWithEnumId(const NProtoBuf::Message& m, IOutputStream& out) {
+ google::protobuf::TextFormat::Printer printer;
+ printer.SetDefaultFieldValuePrinter(new NProtoBuf::TEnumIdValuePrinter());
+ NProtoBuf::io::TCopyingOutputStreamAdaptor adaptor(&out);
+
+ if (!printer.Print(m, &adaptor)) {
+ ythrow yexception() << "SerializeToTextFormatWithEnumId failed on Print";
+ }
+}
+
void SerializeToTextFormatPretty(const NProtoBuf::Message& m, IOutputStream& out) {
google::protobuf::TextFormat::Printer printer;
printer.SetUseUtf8StringEscaping(true);