summaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf
diff options
context:
space:
mode:
authorelshiko <[email protected]>2022-02-10 16:49:20 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:49:20 +0300
commitdbb5d0d21c8cfc3d59e0f6d3b6f4ab06b58561f1 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/protobuf
parent455ab915435b70e433ed91eee2ca84f03122d6cb (diff)
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/protobuf')
-rw-r--r--library/cpp/protobuf/util/pb_io.cpp6
-rw-r--r--library/cpp/protobuf/util/pb_io.h8
-rw-r--r--library/cpp/protobuf/util/pb_io_ut.cpp20
3 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/protobuf/util/pb_io.cpp b/library/cpp/protobuf/util/pb_io.cpp
index d0d9b65d895..6270ee06243 100644
--- a/library/cpp/protobuf/util/pb_io.cpp
+++ b/library/cpp/protobuf/util/pb_io.cpp
@@ -21,15 +21,15 @@ namespace NProtoBuf {
}
};
- void ParseFromBase64String(const TStringBuf dataBase64, Message& m, bool allowUneven) {
+ 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";
}
}
- bool TryParseFromBase64String(const TStringBuf dataBase64, Message& m, bool allowUneven) {
+ bool TryParseFromBase64String(const TStringBuf dataBase64, Message& m, bool allowUneven) {
try {
- ParseFromBase64String(dataBase64, m, allowUneven);
+ ParseFromBase64String(dataBase64, m, allowUneven);
return true;
} catch (const std::exception&) {
return false;
diff --git a/library/cpp/protobuf/util/pb_io.h b/library/cpp/protobuf/util/pb_io.h
index 4ca101b28a4..493c84cb5f3 100644
--- a/library/cpp/protobuf/util/pb_io.h
+++ b/library/cpp/protobuf/util/pb_io.h
@@ -21,12 +21,12 @@ class IOutputStream;
namespace NProtoBuf {
/* Parse base64 URL encoded serialized message from string.
*/
- void ParseFromBase64String(const TStringBuf dataBase64, Message& m, bool allowUneven = false);
- bool TryParseFromBase64String(const TStringBuf dataBase64, Message& m, bool allowUneven = false);
+ void ParseFromBase64String(const TStringBuf dataBase64, Message& m, bool allowUneven = false);
+ bool TryParseFromBase64String(const TStringBuf dataBase64, Message& m, bool allowUneven = false);
template <typename T>
- static T ParseFromBase64String(const TStringBuf& dataBase64, bool allowUneven = false) {
+ static T ParseFromBase64String(const TStringBuf& dataBase64, bool allowUneven = false) {
T m;
- ParseFromBase64String(dataBase64, m, allowUneven);
+ ParseFromBase64String(dataBase64, m, allowUneven);
return m;
}
diff --git a/library/cpp/protobuf/util/pb_io_ut.cpp b/library/cpp/protobuf/util/pb_io_ut.cpp
index cb08001997e..875d6dc6026 100644
--- a/library/cpp/protobuf/util/pb_io_ut.cpp
+++ b/library/cpp/protobuf/util/pb_io_ut.cpp
@@ -45,8 +45,8 @@ static const TString INCORRECT_ENUM_ID_MESSAGE =
static const TString CORRECT_BASE64_MESSAGE = "CCo,";
-static const TString CORRECT_UNEVEN_BASE64_MESSAGE = "CCo";
-
+static const TString CORRECT_UNEVEN_BASE64_MESSAGE = "CCo";
+
static const TString INCORRECT_BASE64_MESSAGE = "CC";
Y_UNIT_TEST_SUITE(TTestProtoBufIO) {
@@ -60,14 +60,14 @@ Y_UNIT_TEST_SUITE(TTestProtoBufIO) {
UNIT_ASSERT(!NProtoBuf::TryParseFromBase64String(INCORRECT_BASE64_MESSAGE, message));
}
{
- NProtobufUtilUt::TTextTest message;
- UNIT_ASSERT(NProtoBuf::TryParseFromBase64String(CORRECT_UNEVEN_BASE64_MESSAGE , message, true));
- }
- {
- NProtobufUtilUt::TTextTest message;
- UNIT_ASSERT(!NProtoBuf::TryParseFromBase64String(CORRECT_UNEVEN_BASE64_MESSAGE , message, false));
- }
- {
+ NProtobufUtilUt::TTextTest message;
+ UNIT_ASSERT(NProtoBuf::TryParseFromBase64String(CORRECT_UNEVEN_BASE64_MESSAGE , message, true));
+ }
+ {
+ NProtobufUtilUt::TTextTest message;
+ UNIT_ASSERT(!NProtoBuf::TryParseFromBase64String(CORRECT_UNEVEN_BASE64_MESSAGE , message, false));
+ }
+ {
UNIT_ASSERT_VALUES_EQUAL(CORRECT_BASE64_MESSAGE, NProtoBuf::SerializeToBase64String(GetCorrectMessage()));
}
{