diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/protobuf/json/proto2json.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 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 89a1781a40..55ee4e0846 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; + } } |