diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/protobuf/json/proto2json.h | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/protobuf/json/proto2json.h')
-rw-r--r-- | library/cpp/protobuf/json/proto2json.h | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/library/cpp/protobuf/json/proto2json.h b/library/cpp/protobuf/json/proto2json.h index 55ee4e0846..89a1781a40 100644 --- a/library/cpp/protobuf/json/proto2json.h +++ b/library/cpp/protobuf/json/proto2json.h @@ -15,64 +15,64 @@ #include <functional> namespace NJson { - class TJsonValue; - class TJsonWriter; -} + class TJsonValue; + class TJsonWriter; +} class IOutputStream; class TStringStream; namespace NProtobufJson { - void Proto2Json(const NProtoBuf::Message& proto, IJsonOutput& jsonOutput, - const TProto2JsonConfig& config = TProto2JsonConfig(), bool closeMap = true); + void Proto2Json(const NProtoBuf::Message& proto, IJsonOutput& jsonOutput, + const TProto2JsonConfig& config = TProto2JsonConfig(), bool closeMap = true); - void Proto2Json(const NProtoBuf::Message& proto, NJson::TJsonWriter& writer, - const TProto2JsonConfig& config = TProto2JsonConfig()); + void Proto2Json(const NProtoBuf::Message& proto, NJson::TJsonWriter& writer, + const TProto2JsonConfig& config = TProto2JsonConfig()); - /// @throw yexception - void Proto2Json(const NProtoBuf::Message& proto, NJson::TJsonValue& json, - const TProto2JsonConfig& config = TProto2JsonConfig()); + /// @throw yexception + void Proto2Json(const NProtoBuf::Message& proto, NJson::TJsonValue& json, + const TProto2JsonConfig& config = TProto2JsonConfig()); - /// @throw yexception - void Proto2Json(const NProtoBuf::Message& proto, IOutputStream& out, - const TProto2JsonConfig& config); - // Generated code shortcut - template <class T> - inline void Proto2Json(const T& proto, IOutputStream& out) { - out << proto.AsJSON(); - } + /// @throw yexception + void Proto2Json(const NProtoBuf::Message& proto, IOutputStream& out, + const TProto2JsonConfig& config); + // Generated code shortcut + template <class T> + inline void Proto2Json(const T& proto, IOutputStream& out) { + out << proto.AsJSON(); + } - // TStringStream deserves a special overload as its operator TString() would cause ambiguity - /// @throw yexception - void Proto2Json(const NProtoBuf::Message& proto, TStringStream& out, - const TProto2JsonConfig& config); - // Generated code shortcut - template <class T> - inline void Proto2Json(const T& proto, TStringStream& out) { - out << proto.AsJSON(); - } + // TStringStream deserves a special overload as its operator TString() would cause ambiguity + /// @throw yexception + void Proto2Json(const NProtoBuf::Message& proto, TStringStream& out, + const TProto2JsonConfig& config); + // Generated code shortcut + template <class T> + inline void Proto2Json(const T& proto, TStringStream& out) { + out << proto.AsJSON(); + } - /// @throw yexception - void Proto2Json(const NProtoBuf::Message& proto, TString& str, - const TProto2JsonConfig& config); - // Generated code shortcut - template <class T> - inline void Proto2Json(const T& proto, TString& str) { - str.clear(); - TStringOutput out(str); - out << proto.AsJSON(); - } + /// @throw yexception + void Proto2Json(const NProtoBuf::Message& proto, TString& str, + const TProto2JsonConfig& config); + // Generated code shortcut + template <class T> + inline void Proto2Json(const T& proto, TString& str) { + str.clear(); + TStringOutput out(str); + out << proto.AsJSON(); + } - /// @throw yexception - TString Proto2Json(const NProtoBuf::Message& proto, - const TProto2JsonConfig& config); + /// @throw yexception + TString Proto2Json(const NProtoBuf::Message& proto, + const TProto2JsonConfig& config); // Returns incorrect result if proto contains another NProtoBuf::Message - // Generated code shortcut - template <class T> - inline TString Proto2Json(const T& proto) { - TString result; - Proto2Json(proto, result); - return result; - } + // Generated code shortcut + template <class T> + inline TString Proto2Json(const T& proto) { + TString result; + Proto2Json(proto, result); + return result; + } } |