diff options
| author | elshiko <[email protected]> | 2022-02-10 16:49:20 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:20 +0300 |
| commit | 455ab915435b70e433ed91eee2ca84f03122d6cb (patch) | |
| tree | 4570335e510c5cb009cca313349e2a29b4c62310 /library/cpp/yson/json/yson2json_adapter.cpp | |
| parent | 85ad20a00eb9c7d4dcae0debe5172d5f9bc6792f (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson/json/yson2json_adapter.cpp')
| -rw-r--r-- | library/cpp/yson/json/yson2json_adapter.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/library/cpp/yson/json/yson2json_adapter.cpp b/library/cpp/yson/json/yson2json_adapter.cpp index b5e7c49d4d8..58d9bf7fdb3 100644 --- a/library/cpp/yson/json/yson2json_adapter.cpp +++ b/library/cpp/yson/json/yson2json_adapter.cpp @@ -1,82 +1,82 @@ -#include "yson2json_adapter.h" - -namespace NYT { +#include "yson2json_adapter.h" + +namespace NYT { TYson2JsonCallbacksAdapter::TYson2JsonCallbacksAdapter(::NYson::TYsonConsumerBase* impl, bool throwException) - : NJson::TJsonCallbacks(throwException) + : NJson::TJsonCallbacks(throwException) , Impl_(impl) - { - } - - bool TYson2JsonCallbacksAdapter::OnNull() { - WrapIfListItem(); + { + } + + bool TYson2JsonCallbacksAdapter::OnNull() { + WrapIfListItem(); Impl_->OnEntity(); - return true; - } - - bool TYson2JsonCallbacksAdapter::OnBoolean(bool val) { - WrapIfListItem(); + return true; + } + + bool TYson2JsonCallbacksAdapter::OnBoolean(bool val) { + WrapIfListItem(); Impl_->OnBooleanScalar(val); - return true; - } - - bool TYson2JsonCallbacksAdapter::OnInteger(long long val) { - WrapIfListItem(); + return true; + } + + bool TYson2JsonCallbacksAdapter::OnInteger(long long val) { + WrapIfListItem(); Impl_->OnInt64Scalar(val); - return true; - } - - bool TYson2JsonCallbacksAdapter::OnUInteger(unsigned long long val) { - WrapIfListItem(); + return true; + } + + bool TYson2JsonCallbacksAdapter::OnUInteger(unsigned long long val) { + WrapIfListItem(); Impl_->OnUint64Scalar(val); - return true; - } - - bool TYson2JsonCallbacksAdapter::OnString(const TStringBuf& val) { - WrapIfListItem(); + return true; + } + + bool TYson2JsonCallbacksAdapter::OnString(const TStringBuf& val) { + WrapIfListItem(); Impl_->OnStringScalar(val); - return true; - } - - bool TYson2JsonCallbacksAdapter::OnDouble(double val) { - WrapIfListItem(); + return true; + } + + bool TYson2JsonCallbacksAdapter::OnDouble(double val) { + WrapIfListItem(); Impl_->OnDoubleScalar(val); - return true; - } - - bool TYson2JsonCallbacksAdapter::OnOpenArray() { - WrapIfListItem(); + return true; + } + + bool TYson2JsonCallbacksAdapter::OnOpenArray() { + WrapIfListItem(); State_.ContextStack.push(true); Impl_->OnBeginList(); - return true; - } - - bool TYson2JsonCallbacksAdapter::OnCloseArray() { + return true; + } + + bool TYson2JsonCallbacksAdapter::OnCloseArray() { State_.ContextStack.pop(); Impl_->OnEndList(); - return true; - } - - bool TYson2JsonCallbacksAdapter::OnOpenMap() { - WrapIfListItem(); + return true; + } + + bool TYson2JsonCallbacksAdapter::OnOpenMap() { + WrapIfListItem(); State_.ContextStack.push(false); Impl_->OnBeginMap(); - return true; - } - - bool TYson2JsonCallbacksAdapter::OnCloseMap() { + return true; + } + + bool TYson2JsonCallbacksAdapter::OnCloseMap() { State_.ContextStack.pop(); Impl_->OnEndMap(); - return true; - } - - bool TYson2JsonCallbacksAdapter::OnMapKey(const TStringBuf& val) { + return true; + } + + bool TYson2JsonCallbacksAdapter::OnMapKey(const TStringBuf& val) { Impl_->OnKeyedItem(val); - return true; - } - - void TYson2JsonCallbacksAdapter::WrapIfListItem() { + return true; + } + + void TYson2JsonCallbacksAdapter::WrapIfListItem() { if (!State_.ContextStack.empty() && State_.ContextStack.top()) { Impl_->OnListItem(); - } - } -} + } + } +} |
