diff options
author | akhropov <akhropov@yandex-team.ru> | 2022-02-10 16:46:32 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:32 +0300 |
commit | 00afc96e9c0298054b7386fa7fb9e3cc3d67b974 (patch) | |
tree | cb7a9f4a92c0d4cc5a86eeed49ad71e810953c1f /library/cpp/protobuf/util/pb_io.cpp | |
parent | 83a8efcf3af051e3dd59c00d1d5dafc96412ec1e (diff) | |
download | ydb-00afc96e9c0298054b7386fa7fb9e3cc3d67b974.tar.gz |
Restoring authorship annotation for <akhropov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/protobuf/util/pb_io.cpp')
-rw-r--r-- | library/cpp/protobuf/util/pb_io.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/protobuf/util/pb_io.cpp b/library/cpp/protobuf/util/pb_io.cpp index 6270ee0624..d57effb114 100644 --- a/library/cpp/protobuf/util/pb_io.cpp +++ b/library/cpp/protobuf/util/pb_io.cpp @@ -2,16 +2,16 @@ #include <library/cpp/binsaver/bin_saver.h> #include <library/cpp/string_utils/base64/base64.h> - + #include <google/protobuf/message.h> #include <google/protobuf/messagext.h> #include <google/protobuf/text_format.h> - + #include <util/generic/string.h> #include <util/stream/file.h> #include <util/stream/str.h> #include <util/string/cast.h> - + namespace NProtoBuf { class TEnumIdValuePrinter : public google::protobuf::TextFormat::FastFieldValuePrinter { @@ -97,10 +97,10 @@ void SerializeToTextFormat(const NProtoBuf::Message& m, IOutputStream& out) { NProtoBuf::io::TCopyingOutputStreamAdaptor adaptor(&out); if (!NProtoBuf::TextFormat::Print(m, &adaptor)) { - ythrow yexception() << "SerializeToTextFormat failed on Print"; + ythrow yexception() << "SerializeToTextFormat failed on Print"; } -} - +} + void SerializeToTextFormat(const NProtoBuf::Message& m, const TString& fileName) { /* TUnbufferedFileOutput is unbuffered, but TCopyingOutputStreamAdaptor adds * a buffer on top of it. */ @@ -167,8 +167,8 @@ bool TryParseFromTextFormat(const TString& fileName, NProtoBuf::Message& m, } return true; -} - +} + bool TryParseFromTextFormat(IInputStream& in, NProtoBuf::Message& m, const EParseFromTextFormatOptions options) { try { |