diff options
author | Anton Samokhvalov <[email protected]> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/protobuf/json/json_value_output.h | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) |
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/protobuf/json/json_value_output.h')
-rw-r--r-- | library/cpp/protobuf/json/json_value_output.h | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/library/cpp/protobuf/json/json_value_output.h b/library/cpp/protobuf/json/json_value_output.h index 8d2367eac7b..3fc6ff2ab0f 100644 --- a/library/cpp/protobuf/json/json_value_output.h +++ b/library/cpp/protobuf/json/json_value_output.h @@ -7,57 +7,57 @@ #include <util/generic/stack.h> namespace NProtobufJson { - class TJsonValueOutput: public IJsonOutput { - public: - TJsonValueOutput(NJson::TJsonValue& value) - : Root(value) - { - Context.emplace(TContext::JSON_AFTER_KEY, Root); - } - - void DoWrite(const TStringBuf& s) override; - void DoWrite(const TString& s) override; - void DoWrite(int i) override; - void DoWrite(unsigned int i) override; - void DoWrite(long long i) override; - void DoWrite(unsigned long long i) override; - void DoWrite(float f) override; - void DoWrite(double f) override; - void DoWrite(bool b) override; - void DoWriteNull() override; - - void DoBeginList() override; - void DoEndList() override; - - void DoBeginObject() override; - void DoWriteKey(const TStringBuf& key) override; - void DoEndObject() override; - - void DoWriteRawJson(const TStringBuf& str) override; - - private: - template <typename T> - void WriteImpl(const T& t); - - struct TContext { - enum EType { - JSON_MAP, - JSON_ARRAY, - JSON_AFTER_KEY, - }; - - TContext(EType type, NJson::TJsonValue& value) - : Type(type) - , Value(value) - { - } - - EType Type; - NJson::TJsonValue& Value; + class TJsonValueOutput: public IJsonOutput { + public: + TJsonValueOutput(NJson::TJsonValue& value) + : Root(value) + { + Context.emplace(TContext::JSON_AFTER_KEY, Root); + } + + void DoWrite(const TStringBuf& s) override; + void DoWrite(const TString& s) override; + void DoWrite(int i) override; + void DoWrite(unsigned int i) override; + void DoWrite(long long i) override; + void DoWrite(unsigned long long i) override; + void DoWrite(float f) override; + void DoWrite(double f) override; + void DoWrite(bool b) override; + void DoWriteNull() override; + + void DoBeginList() override; + void DoEndList() override; + + void DoBeginObject() override; + void DoWriteKey(const TStringBuf& key) override; + void DoEndObject() override; + + void DoWriteRawJson(const TStringBuf& str) override; + + private: + template <typename T> + void WriteImpl(const T& t); + + struct TContext { + enum EType { + JSON_MAP, + JSON_ARRAY, + JSON_AFTER_KEY, + }; + + TContext(EType type, NJson::TJsonValue& value) + : Type(type) + , Value(value) + { + } + + EType Type; + NJson::TJsonValue& Value; }; - NJson::TJsonValue& Root; - TStack<TContext, TVector<TContext>> Context; + NJson::TJsonValue& Root; + TStack<TContext, TVector<TContext>> Context; }; -} +} |