diff options
author | diver <diver@yandex-team.ru> | 2022-02-10 16:48:07 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:07 +0300 |
commit | 7629e1f9ef7f9d2a3c345c97e6a4e5a4b32ee786 (patch) | |
tree | c3371bfa47641a52244267b63009d16e4e7054ff /library/cpp/protobuf/util | |
parent | cc573d2716c99ba22afc98753971cd97fd5283e0 (diff) | |
download | ydb-7629e1f9ef7f9d2a3c345c97e6a4e5a4b32ee786.tar.gz |
Restoring authorship annotation for <diver@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/protobuf/util')
-rw-r--r-- | library/cpp/protobuf/util/pb_io.cpp | 22 | ||||
-rw-r--r-- | library/cpp/protobuf/util/pb_io.h | 8 |
2 files changed, 15 insertions, 15 deletions
diff --git a/library/cpp/protobuf/util/pb_io.cpp b/library/cpp/protobuf/util/pb_io.cpp index 6270ee0624..6528db53e0 100644 --- a/library/cpp/protobuf/util/pb_io.cpp +++ b/library/cpp/protobuf/util/pb_io.cpp @@ -26,7 +26,7 @@ namespace NProtoBuf { ythrow yexception() << "can't parse " << m.GetTypeName() << " from base64-encoded string"; } } - + bool TryParseFromBase64String(const TStringBuf dataBase64, Message& m, bool allowUneven) { try { ParseFromBase64String(dataBase64, m, allowUneven); @@ -35,7 +35,7 @@ namespace NProtoBuf { return false; } } - + void SerializeToBase64String(const Message& m, TString& dataBase64) { TString rawData; if (!m.SerializeToString(&rawData)) { @@ -82,17 +82,17 @@ namespace NProtoBuf { } int operator&(NProtoBuf::Message& m, IBinSaver& f) { - TStringStream ss; - if (f.IsReading()) { - f.Add(0, &ss.Str()); + TStringStream ss; + if (f.IsReading()) { + f.Add(0, &ss.Str()); m.ParseFromArcadiaStream(&ss); - } else { + } else { m.SerializeToArcadiaStream(&ss); - f.Add(0, &ss.Str()); - } - return 0; -} - + f.Add(0, &ss.Str()); + } + return 0; +} + void SerializeToTextFormat(const NProtoBuf::Message& m, IOutputStream& out) { NProtoBuf::io::TCopyingOutputStreamAdaptor adaptor(&out); diff --git a/library/cpp/protobuf/util/pb_io.h b/library/cpp/protobuf/util/pb_io.h index 493c84cb5f..9c336382c7 100644 --- a/library/cpp/protobuf/util/pb_io.h +++ b/library/cpp/protobuf/util/pb_io.h @@ -4,10 +4,10 @@ #include <util/generic/flags.h> struct IBinSaver; - + namespace google { namespace protobuf { - class Message; + class Message; } } @@ -41,9 +41,9 @@ namespace NProtoBuf { bool MergePartialFromString(NProtoBuf::Message& m, const TStringBuf serializedProtoMessage); bool MergeFromString(NProtoBuf::Message& m, const TStringBuf serializedProtoMessage); } - + int operator&(NProtoBuf::Message& m, IBinSaver& f); - + // Write a textual representation of the given message to the given file. void SerializeToTextFormat(const NProtoBuf::Message& m, const TString& fileName); void SerializeToTextFormat(const NProtoBuf::Message& m, IOutputStream& out); |