summaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/json/json_value_output.h
diff options
context:
space:
mode:
authorVasily Gerasimov <[email protected]>2022-02-10 16:49:10 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:49:10 +0300
commit1eb755fbca92172a6aec2f57371b2b3a19dfab43 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/protobuf/json/json_value_output.h
parent6cdc8f140213c595e4ad38bc3d97fcef1146b8c3 (diff)
Restoring authorship annotation for Vasily Gerasimov <[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.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/protobuf/json/json_value_output.h b/library/cpp/protobuf/json/json_value_output.h
index 8d71d36af47..3fc6ff2ab0f 100644
--- a/library/cpp/protobuf/json/json_value_output.h
+++ b/library/cpp/protobuf/json/json_value_output.h
@@ -1,12 +1,12 @@
-#pragma once
-
+#pragma once
+
#include "json_output.h"
#include <library/cpp/json/writer/json_value.h>
-
+
#include <util/generic/stack.h>
-namespace NProtobufJson {
+namespace NProtobufJson {
class TJsonValueOutput: public IJsonOutput {
public:
TJsonValueOutput(NJson::TJsonValue& value)
@@ -14,7 +14,7 @@ namespace NProtobufJson {
{
Context.emplace(TContext::JSON_AFTER_KEY, Root);
}
-
+
void DoWrite(const TStringBuf& s) override;
void DoWrite(const TString& s) override;
void DoWrite(int i) override;
@@ -25,27 +25,27 @@ namespace NProtobufJson {
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)
@@ -55,9 +55,9 @@ namespace NProtobufJson {
EType Type;
NJson::TJsonValue& Value;
};
-
+
NJson::TJsonValue& Root;
TStack<TContext, TVector<TContext>> Context;
};
-
+
}