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/json_writer_output.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/json_writer_output.h')
-rw-r--r-- | library/cpp/protobuf/json/json_writer_output.h | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/library/cpp/protobuf/json/json_writer_output.h b/library/cpp/protobuf/json/json_writer_output.h index 3d8a2daa56..bec4233018 100644 --- a/library/cpp/protobuf/json/json_writer_output.h +++ b/library/cpp/protobuf/json/json_writer_output.h @@ -9,95 +9,95 @@ #include <util/generic/store_policy.h> namespace NProtobufJson { - class TBaseJsonWriterOutput: public IJsonOutput { - public: - TBaseJsonWriterOutput(NJson::TJsonWriter& writer) - : Writer(writer) - { - } + class TBaseJsonWriterOutput: public IJsonOutput { + public: + TBaseJsonWriterOutput(NJson::TJsonWriter& writer) + : Writer(writer) + { + } - private: - void DoWrite(int i) override { - Writer.Write(i); - } - void DoWrite(unsigned int i) override { - Writer.Write(i); - } - void DoWrite(long long i) override { - Writer.Write(i); - } - void DoWrite(unsigned long long i) override { - Writer.Write(i); - } - void DoWrite(float f) override { - Writer.Write(f); - } - void DoWrite(double f) override { - Writer.Write(f); - } - void DoWrite(bool b) override { - Writer.Write(b); - } - void DoWriteNull() override { - Writer.WriteNull(); - } - void DoWrite(const TStringBuf& s) override { - Writer.Write(s); - } - void DoWrite(const TString& s) override { - Writer.Write(s); - } + private: + void DoWrite(int i) override { + Writer.Write(i); + } + void DoWrite(unsigned int i) override { + Writer.Write(i); + } + void DoWrite(long long i) override { + Writer.Write(i); + } + void DoWrite(unsigned long long i) override { + Writer.Write(i); + } + void DoWrite(float f) override { + Writer.Write(f); + } + void DoWrite(double f) override { + Writer.Write(f); + } + void DoWrite(bool b) override { + Writer.Write(b); + } + void DoWriteNull() override { + Writer.WriteNull(); + } + void DoWrite(const TStringBuf& s) override { + Writer.Write(s); + } + void DoWrite(const TString& s) override { + Writer.Write(s); + } - void DoBeginList() override { - Writer.OpenArray(); - } - void DoEndList() override { - Writer.CloseArray(); - } + void DoBeginList() override { + Writer.OpenArray(); + } + void DoEndList() override { + Writer.CloseArray(); + } - void DoBeginObject() override { - Writer.OpenMap(); - } - void DoWriteKey(const TStringBuf& key) override { - Writer.Write(key); - } - void DoEndObject() override { - Writer.CloseMap(); - } + void DoBeginObject() override { + Writer.OpenMap(); + } + void DoWriteKey(const TStringBuf& key) override { + Writer.Write(key); + } + void DoEndObject() override { + Writer.CloseMap(); + } - void DoWriteRawJson(const TStringBuf& str) override { - Writer.UnsafeWrite(str); - } + void DoWriteRawJson(const TStringBuf& str) override { + Writer.UnsafeWrite(str); + } - NJson::TJsonWriter& Writer; - }; + NJson::TJsonWriter& Writer; + }; - class TJsonWriterOutput: public TEmbedPolicy<NJson::TJsonWriter>, public TBaseJsonWriterOutput { - public: - TJsonWriterOutput(IOutputStream* outputStream, const NJson::TJsonWriterConfig& cfg) - : TEmbedPolicy<NJson::TJsonWriter>(outputStream, cfg) - , TBaseJsonWriterOutput(*Ptr()) - { - } + class TJsonWriterOutput: public TEmbedPolicy<NJson::TJsonWriter>, public TBaseJsonWriterOutput { + public: + TJsonWriterOutput(IOutputStream* outputStream, const NJson::TJsonWriterConfig& cfg) + : TEmbedPolicy<NJson::TJsonWriter>(outputStream, cfg) + , TBaseJsonWriterOutput(*Ptr()) + { + } - TJsonWriterOutput(IOutputStream* outputStream, const TProto2JsonConfig& cfg) - : TEmbedPolicy<NJson::TJsonWriter>(outputStream, CreateJsonWriterConfig(cfg)) - , TBaseJsonWriterOutput(*Ptr()) - { - } + TJsonWriterOutput(IOutputStream* outputStream, const TProto2JsonConfig& cfg) + : TEmbedPolicy<NJson::TJsonWriter>(outputStream, CreateJsonWriterConfig(cfg)) + , TBaseJsonWriterOutput(*Ptr()) + { + } - private: - static NJson::TJsonWriterConfig CreateJsonWriterConfig(const TProto2JsonConfig& cfg); - }; + private: + static NJson::TJsonWriterConfig CreateJsonWriterConfig(const TProto2JsonConfig& cfg); + }; - class TJsonStringWriterOutput: public TEmbedPolicy<TStringOutput>, public TJsonWriterOutput { - public: - template <typename TConfig> - TJsonStringWriterOutput(TString* str, const TConfig& cfg) - : TEmbedPolicy<TStringOutput>(*str) - , TJsonWriterOutput(TEmbedPolicy<TStringOutput>::Ptr(), cfg) - { - } - }; + class TJsonStringWriterOutput: public TEmbedPolicy<TStringOutput>, public TJsonWriterOutput { + public: + template <typename TConfig> + TJsonStringWriterOutput(TString* str, const TConfig& cfg) + : TEmbedPolicy<TStringOutput>(*str) + , TJsonWriterOutput(TEmbedPolicy<TStringOutput>::Ptr(), cfg) + { + } + }; -} +} |