diff options
author | pmatsula <pmatsula@yandex-team.ru> | 2022-02-10 16:49:20 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:20 +0300 |
commit | 1278240bfbb8240f3c2d7a88085543f6bfaba73e (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp | |
parent | b4c80a816aa1aafd8484de35b31cee234033ad59 (diff) | |
download | ydb-1278240bfbb8240f3c2d7a88085543f6bfaba73e.tar.gz |
Restoring authorship annotation for <pmatsula@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/json/domscheme_traits.h | 56 | ||||
-rw-r--r-- | library/cpp/scheme/domscheme_traits.h | 52 | ||||
-rw-r--r-- | library/cpp/yson/node/node_builder.cpp | 10 | ||||
-rw-r--r-- | library/cpp/yson/node/node_builder.h | 2 |
4 files changed, 60 insertions, 60 deletions
diff --git a/library/cpp/json/domscheme_traits.h b/library/cpp/json/domscheme_traits.h index d2deba1104..a5a99cd8cf 100644 --- a/library/cpp/json/domscheme_traits.h +++ b/library/cpp/json/domscheme_traits.h @@ -6,32 +6,32 @@ #include <util/generic/algorithm.h> struct TJsonTraits { - using TValue = NJson::TJsonValue; - using TValueRef = TValue*; - using TConstValueRef = const TValue*; + using TValue = NJson::TJsonValue; + using TValueRef = TValue*; + using TConstValueRef = const TValue*; using TStringType = TStringBuf; - // anyvalue defaults - template <class T> - static inline TValue Value(T&& t) { - return TValue(std::forward<T>(t)); - } - - template <class T> - static inline TValue Value(std::initializer_list<T> t) { - TValue result(NJson::JSON_ARRAY); - result.GetArraySafe() = NJson::TJsonValue::TArray(t.begin(), t.end()); - return result; - } - - static inline TValueRef Ref(TValue& v) { - return &v; - } - - static inline TConstValueRef Ref(const TValue& v) { - return &v; - } - + // anyvalue defaults + template <class T> + static inline TValue Value(T&& t) { + return TValue(std::forward<T>(t)); + } + + template <class T> + static inline TValue Value(std::initializer_list<T> t) { + TValue result(NJson::JSON_ARRAY); + result.GetArraySafe() = NJson::TJsonValue::TArray(t.begin(), t.end()); + return result; + } + + static inline TValueRef Ref(TValue& v) { + return &v; + } + + static inline TConstValueRef Ref(const TValue& v) { + return &v; + } + // common ops static inline bool IsNull(TConstValueRef v) { return v->GetType() == NJson::JSON_UNDEFINED || v->IsNull(); @@ -60,13 +60,13 @@ struct TJsonTraits { v->SetType(NJson::JSON_ARRAY); } - using TArrayIterator = size_t; - - static inline TValueRef ArrayElement(TValueRef v, TArrayIterator n) { + using TArrayIterator = size_t; + + static inline TValueRef ArrayElement(TValueRef v, TArrayIterator n) { return &(*v)[n]; } - static inline TConstValueRef ArrayElement(TConstValueRef v, TArrayIterator n) { + static inline TConstValueRef ArrayElement(TConstValueRef v, TArrayIterator n) { return &(*v)[n]; } diff --git a/library/cpp/scheme/domscheme_traits.h b/library/cpp/scheme/domscheme_traits.h index 776a3c588e..a11c4dd444 100644 --- a/library/cpp/scheme/domscheme_traits.h +++ b/library/cpp/scheme/domscheme_traits.h @@ -4,30 +4,30 @@ #include <util/string/cast.h> struct TSchemeTraits { - using TValue = NSc::TValue; - using TValueRef = TValue*; - using TConstValueRef = const TValue*; + using TValue = NSc::TValue; + using TValueRef = TValue*; + using TConstValueRef = const TValue*; using TStringType = TStringBuf; - // anyvalue defaults - template <class T> - static inline TValue Value(T&& t) { - return TValue(std::forward<T>(t)); - } - - template <class T> - static inline TValue Value(std::initializer_list<T> t) { - return TValue().SetArray().AppendAll(t); - } - - static inline TValueRef Ref(TValue& v) { - return &v; - } - - static inline TConstValueRef Ref(const TValue& v) { - return &v; - } - + // anyvalue defaults + template <class T> + static inline TValue Value(T&& t) { + return TValue(std::forward<T>(t)); + } + + template <class T> + static inline TValue Value(std::initializer_list<T> t) { + return TValue().SetArray().AppendAll(t); + } + + static inline TValueRef Ref(TValue& v) { + return &v; + } + + static inline TConstValueRef Ref(const TValue& v) { + return &v; + } + // common ops static inline bool IsNull(TConstValueRef v) { return v->IsNull(); @@ -56,13 +56,13 @@ struct TSchemeTraits { v->ClearArray(); } - using TArrayIterator = size_t; - - static inline TValueRef ArrayElement(TValueRef v, TArrayIterator n) { + using TArrayIterator = size_t; + + static inline TValueRef ArrayElement(TValueRef v, TArrayIterator n) { return &(*v)[n]; } - static inline TConstValueRef ArrayElement(TConstValueRef v, TArrayIterator n) { + static inline TConstValueRef ArrayElement(TConstValueRef v, TArrayIterator n) { return &(*v)[n]; } diff --git a/library/cpp/yson/node/node_builder.cpp b/library/cpp/yson/node/node_builder.cpp index 065e4086aa..b4431bc77a 100644 --- a/library/cpp/yson/node/node_builder.cpp +++ b/library/cpp/yson/node/node_builder.cpp @@ -79,11 +79,11 @@ void TNodeBuilder::OnEndAttributes() Stack_.pop(); } -void TNodeBuilder::OnNode(TNode node) -{ - AddNode(std::move(node), true); -} - +void TNodeBuilder::OnNode(TNode node) +{ + AddNode(std::move(node), true); +} + void TNodeBuilder::AddNode(TNode value, bool pop) { Stack_.top()->MoveWithoutAttributes(std::move(value)); diff --git a/library/cpp/yson/node/node_builder.h b/library/cpp/yson/node/node_builder.h index 6b00018e77..69800016e0 100644 --- a/library/cpp/yson/node/node_builder.h +++ b/library/cpp/yson/node/node_builder.h @@ -32,7 +32,7 @@ public: void OnEndMap() override; void OnBeginAttributes() override; void OnEndAttributes() override; - void OnNode(TNode node); + void OnNode(TNode node); private: TStack<TNode*> Stack_; |