aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson
diff options
context:
space:
mode:
authorqkrorlqr <qkrorlqr@yandex-team.ru>2022-02-10 16:47:20 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:20 +0300
commit9b89266638b10d40309e31dcb7caa2fc52b2aefd (patch)
treeaaf0d6ece270940a4f208e4202e4a37a15ce05b7 /library/cpp/yson
parent47af3b5bf148ddab250833ec454d30d7c4930c31 (diff)
downloadydb-9b89266638b10d40309e31dcb7caa2fc52b2aefd.tar.gz
Restoring authorship annotation for <qkrorlqr@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson')
-rw-r--r--library/cpp/yson/json/yson2json_adapter.cpp36
-rw-r--r--library/cpp/yson/json/yson2json_adapter.h40
-rw-r--r--library/cpp/yson/writer.cpp4
-rw-r--r--library/cpp/yson/writer.h6
4 files changed, 43 insertions, 43 deletions
diff --git a/library/cpp/yson/json/yson2json_adapter.cpp b/library/cpp/yson/json/yson2json_adapter.cpp
index b5e7c49d4d..6e561cf51d 100644
--- a/library/cpp/yson/json/yson2json_adapter.cpp
+++ b/library/cpp/yson/json/yson2json_adapter.cpp
@@ -3,80 +3,80 @@
namespace NYT {
TYson2JsonCallbacksAdapter::TYson2JsonCallbacksAdapter(::NYson::TYsonConsumerBase* impl, bool throwException)
: NJson::TJsonCallbacks(throwException)
- , Impl_(impl)
+ , Impl_(impl)
{
}
bool TYson2JsonCallbacksAdapter::OnNull() {
WrapIfListItem();
- Impl_->OnEntity();
+ Impl_->OnEntity();
return true;
}
bool TYson2JsonCallbacksAdapter::OnBoolean(bool val) {
WrapIfListItem();
- Impl_->OnBooleanScalar(val);
+ Impl_->OnBooleanScalar(val);
return true;
}
bool TYson2JsonCallbacksAdapter::OnInteger(long long val) {
WrapIfListItem();
- Impl_->OnInt64Scalar(val);
+ Impl_->OnInt64Scalar(val);
return true;
}
bool TYson2JsonCallbacksAdapter::OnUInteger(unsigned long long val) {
WrapIfListItem();
- Impl_->OnUint64Scalar(val);
+ Impl_->OnUint64Scalar(val);
return true;
}
bool TYson2JsonCallbacksAdapter::OnString(const TStringBuf& val) {
WrapIfListItem();
- Impl_->OnStringScalar(val);
+ Impl_->OnStringScalar(val);
return true;
}
bool TYson2JsonCallbacksAdapter::OnDouble(double val) {
WrapIfListItem();
- Impl_->OnDoubleScalar(val);
+ Impl_->OnDoubleScalar(val);
return true;
}
bool TYson2JsonCallbacksAdapter::OnOpenArray() {
WrapIfListItem();
- State_.ContextStack.push(true);
- Impl_->OnBeginList();
+ State_.ContextStack.push(true);
+ Impl_->OnBeginList();
return true;
}
bool TYson2JsonCallbacksAdapter::OnCloseArray() {
- State_.ContextStack.pop();
- Impl_->OnEndList();
+ State_.ContextStack.pop();
+ Impl_->OnEndList();
return true;
}
bool TYson2JsonCallbacksAdapter::OnOpenMap() {
WrapIfListItem();
- State_.ContextStack.push(false);
- Impl_->OnBeginMap();
+ State_.ContextStack.push(false);
+ Impl_->OnBeginMap();
return true;
}
bool TYson2JsonCallbacksAdapter::OnCloseMap() {
- State_.ContextStack.pop();
- Impl_->OnEndMap();
+ State_.ContextStack.pop();
+ Impl_->OnEndMap();
return true;
}
bool TYson2JsonCallbacksAdapter::OnMapKey(const TStringBuf& val) {
- Impl_->OnKeyedItem(val);
+ Impl_->OnKeyedItem(val);
return true;
}
void TYson2JsonCallbacksAdapter::WrapIfListItem() {
- if (!State_.ContextStack.empty() && State_.ContextStack.top()) {
- Impl_->OnListItem();
+ if (!State_.ContextStack.empty() && State_.ContextStack.top()) {
+ Impl_->OnListItem();
}
}
}
diff --git a/library/cpp/yson/json/yson2json_adapter.h b/library/cpp/yson/json/yson2json_adapter.h
index da1bf5ba70..e95212254b 100644
--- a/library/cpp/yson/json/yson2json_adapter.h
+++ b/library/cpp/yson/json/yson2json_adapter.h
@@ -10,17 +10,17 @@ namespace NYT {
class TYson2JsonCallbacksAdapter
: public NJson::TJsonCallbacks {
public:
- class TState {
- private:
- // Stores current context stack
- // If true - we are in a list
- // If false - we are in a map
- TStack<bool> ContextStack;
-
- friend class TYson2JsonCallbacksAdapter;
- };
-
- public:
+ class TState {
+ private:
+ // Stores current context stack
+ // If true - we are in a list
+ // If false - we are in a map
+ TStack<bool> ContextStack;
+
+ friend class TYson2JsonCallbacksAdapter;
+ };
+
+ public:
TYson2JsonCallbacksAdapter(::NYson::TYsonConsumerBase* impl, bool throwException = false);
bool OnNull() override;
@@ -35,19 +35,19 @@ namespace NYT {
bool OnCloseMap() override;
bool OnMapKey(const TStringBuf& val) override;
- TState State() const {
- return State_;
- }
-
- void Reset(const TState& state) {
- State_ = state;
- }
-
+ TState State() const {
+ return State_;
+ }
+
+ void Reset(const TState& state) {
+ State_ = state;
+ }
+
private:
void WrapIfListItem();
private:
::NYson::TYsonConsumerBase* Impl_;
- TState State_;
+ TState State_;
};
}
diff --git a/library/cpp/yson/writer.cpp b/library/cpp/yson/writer.cpp
index 054459f9f5..f0637f8d2b 100644
--- a/library/cpp/yson/writer.cpp
+++ b/library/cpp/yson/writer.cpp
@@ -339,7 +339,7 @@ namespace NYson {
}
////////////////////////////////////////////////////////////////////////////////
-
+
void ReformatYsonStream(
IInputStream* input,
IOutputStream* output,
@@ -349,7 +349,7 @@ namespace NYson {
TYsonParser parser(&writer, input, type);
parser.Parse();
}
-
+
////////////////////////////////////////////////////////////////////////////////
} // namespace NYson
diff --git a/library/cpp/yson/writer.h b/library/cpp/yson/writer.h
index 40f5d7d501..79e19d0df5 100644
--- a/library/cpp/yson/writer.h
+++ b/library/cpp/yson/writer.h
@@ -23,14 +23,14 @@ namespace NYson {
friend class TYsonWriter;
};
-
+
public:
TYsonWriter(
IOutputStream* stream,
EYsonFormat format = EYsonFormat::Binary,
EYsonType type = ::NYson::EYsonType::Node,
bool enableRaw = false);
-
+
void OnStringScalar(TStringBuf value) override;
void OnInt64Scalar(i64 value) override;
void OnUint64Scalar(ui64 value) override;
@@ -59,7 +59,7 @@ namespace NYson {
EYsonFormat Format;
EYsonType Type;
bool EnableRaw;
-
+
int Depth;
bool BeforeFirstItem;