aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson/json/json_writer.h
diff options
context:
space:
mode:
authormonster <monster@yandex-team.ru>2022-02-10 16:47:19 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:19 +0300
commitdd76ae1f6213d065375ab296699f764faafbe5bd (patch)
tree075a4553d0011d8f92752c0891794febb15912cf /library/cpp/yson/json/json_writer.h
parentf02a874a7290593efbe4b3aeae69a04b46c1cc86 (diff)
downloadydb-dd76ae1f6213d065375ab296699f764faafbe5bd.tar.gz
Restoring authorship annotation for <monster@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson/json/json_writer.h')
-rw-r--r--library/cpp/yson/json/json_writer.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/library/cpp/yson/json/json_writer.h b/library/cpp/yson/json/json_writer.h
index d84ac0de53..43e5293b0d 100644
--- a/library/cpp/yson/json/json_writer.h
+++ b/library/cpp/yson/json/json_writer.h
@@ -1,31 +1,31 @@
-#pragma once
-
+#pragma once
+
#include <library/cpp/yson/public.h>
#include <library/cpp/yson/consumer.h>
-
+
#include <library/cpp/json/json_writer.h>
-
-#include <util/generic/vector.h>
-
-namespace NYT {
+
+#include <util/generic/vector.h>
+
+namespace NYT {
////////////////////////////////////////////////////////////////////////////////
-
+
enum EJsonFormat {
JF_TEXT,
JF_PRETTY
};
-
+
enum EJsonAttributesMode {
JAM_NEVER,
JAM_ON_DEMAND,
JAM_ALWAYS
};
-
+
enum ESerializedBoolFormat {
SBF_BOOLEAN,
SBF_STRING
};
-
+
class TJsonWriter
: public ::NYson::TYsonConsumerBase {
public:
@@ -44,26 +44,26 @@ namespace NYT {
ESerializedBoolFormat booleanFormat = SBF_STRING);
void Flush();
-
+
void OnStringScalar(TStringBuf value) override;
void OnInt64Scalar(i64 value) override;
void OnUint64Scalar(ui64 value) override;
void OnDoubleScalar(double value) override;
void OnBooleanScalar(bool value) override;
-
+
void OnEntity() override;
-
+
void OnBeginList() override;
void OnListItem() override;
void OnEndList() override;
-
+
void OnBeginMap() override;
void OnKeyedItem(TStringBuf key) override;
void OnEndMap() override;
-
+
void OnBeginAttributes() override;
void OnEndAttributes() override;
-
+
private:
THolder<NJson::TJsonWriter> UnderlyingJsonWriter;
NJson::TJsonWriter* JsonWriter;
@@ -71,19 +71,19 @@ namespace NYT {
::NYson::EYsonType Type;
EJsonAttributesMode AttributesMode;
ESerializedBoolFormat BooleanFormat;
-
+
void WriteStringScalar(const TStringBuf& value);
-
+
void EnterNode();
void LeaveNode();
bool IsWriteAllowed();
-
+
TVector<bool> HasUnfoldedStructureStack;
int InAttributesBalance;
bool HasAttributes;
int Depth;
};
-
+
////////////////////////////////////////////////////////////////////////////////
-
+
}