aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf
diff options
context:
space:
mode:
authordiver <diver@yandex-team.ru>2022-02-10 16:48:07 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:07 +0300
commite20e2b362f0232ed5a389db887e6e27e7763af18 (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /library/cpp/protobuf
parent7629e1f9ef7f9d2a3c345c97e6a4e5a4b32ee786 (diff)
downloadydb-e20e2b362f0232ed5a389db887e6e27e7763af18.tar.gz
Restoring authorship annotation for <diver@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/protobuf')
-rw-r--r--library/cpp/protobuf/util/pb_io.cpp22
-rw-r--r--library/cpp/protobuf/util/pb_io.h8
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 6528db53e0..6270ee0624 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 9c336382c7..493c84cb5f 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);