summaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/json/json_value_output.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <[email protected]>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/protobuf/json/json_value_output.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/protobuf/json/json_value_output.h')
-rw-r--r--library/cpp/protobuf/json/json_value_output.h100
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 3fc6ff2ab0f..8d2367eac7b 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;
};
-}
+}