diff options
author | leasid <leasid@yandex-team.ru> | 2022-02-10 16:46:51 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:51 +0300 |
commit | fbf86a4ded9dc8c023e9ce96018c8f495f2e5212 (patch) | |
tree | 73395cdacbe691b551f6b56badcfb6ef9a1503c3 /library | |
parent | 084b81523e9afa5566bcfec6ebfc4290f204b4e7 (diff) | |
download | ydb-fbf86a4ded9dc8c023e9ce96018c8f495f2e5212.tar.gz |
Restoring authorship annotation for <leasid@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library')
-rw-r--r-- | library/cpp/codecs/codecs.h | 12 | ||||
-rw-r--r-- | library/cpp/ya.make | 2 | ||||
-rw-r--r-- | library/cpp/yson/node/node.cpp | 138 | ||||
-rw-r--r-- | library/cpp/yson/node/node.h | 10 |
4 files changed, 81 insertions, 81 deletions
diff --git a/library/cpp/codecs/codecs.h b/library/cpp/codecs/codecs.h index cc5e72b285..4901b01f02 100644 --- a/library/cpp/codecs/codecs.h +++ b/library/cpp/codecs/codecs.h @@ -59,13 +59,13 @@ namespace NCodecs { virtual TString GetName() const = 0; virtual ui8 /*free bits in last byte*/ Encode(TStringBuf, TBuffer&) const = 0; - virtual ui8 Encode(const TBuffer& input, TBuffer& output) const { - return Encode(TStringBuf(input.Data(), input.Data() + input.Size()), output); - } + virtual ui8 Encode(const TBuffer& input, TBuffer& output) const { + return Encode(TStringBuf(input.Data(), input.Data() + input.Size()), output); + } virtual void Decode(TStringBuf, TBuffer&) const = 0; - virtual void Decode(const TBuffer& input, TBuffer& output) const { - Decode(TStringBuf(input.Data(), input.Data() + input.Size()), output); - } + virtual void Decode(const TBuffer& input, TBuffer& output) const { + Decode(TStringBuf(input.Data(), input.Data() + input.Size()), output); + } virtual ~ICodec() = default; diff --git a/library/cpp/ya.make b/library/cpp/ya.make index 8c1193b007..a8fff88c75 100644 --- a/library/cpp/ya.make +++ b/library/cpp/ya.make @@ -440,7 +440,7 @@ ELSE() fuse sse/ut tf - xdelta3 + xdelta3 zookeeper ) ENDIF() diff --git a/library/cpp/yson/node/node.cpp b/library/cpp/yson/node/node.cpp index b39e070718..1e38dfa217 100644 --- a/library/cpp/yson/node/node.cpp +++ b/library/cpp/yson/node/node.cpp @@ -92,64 +92,64 @@ bool operator>=(const TNode& lhs, const TNode& rhs) //////////////////////////////////////////////////////////////////////////////// TNode::TNode() - : Value_(TUndefined{}) + : Value_(TUndefined{}) { } TNode::TNode(const char* s) - : Value_(TString(s)) + : Value_(TString(s)) { } TNode::TNode(TStringBuf s) - : Value_(TString(s)) + : Value_(TString(s)) { } TNode::TNode(std::string_view s) - : Value_(TString(s)) + : Value_(TString(s)) { } TNode::TNode(const std::string& s) - : Value_(TString(s)) + : Value_(TString(s)) { } TNode::TNode(TString s) - : Value_(std::move(s)) + : Value_(std::move(s)) { } TNode::TNode(int i) - : Value_(static_cast<i64>(i)) + : Value_(static_cast<i64>(i)) { } TNode::TNode(unsigned int ui) - : Value_(static_cast<ui64>(ui)) + : Value_(static_cast<ui64>(ui)) { } TNode::TNode(long i) - : Value_(static_cast<i64>(i)) + : Value_(static_cast<i64>(i)) { } TNode::TNode(unsigned long ui) - : Value_(static_cast<ui64>(ui)) + : Value_(static_cast<ui64>(ui)) { } TNode::TNode(long long i) - : Value_(static_cast<i64>(i)) + : Value_(static_cast<i64>(i)) { } TNode::TNode(unsigned long long ui) - : Value_(static_cast<ui64>(ui)) + : Value_(static_cast<ui64>(ui)) { } TNode::TNode(double d) - : Value_(d) + : Value_(d) { } TNode::TNode(bool b) - : Value_(b) + : Value_(b) { } TNode::TNode(TMapType map) - : Value_(std::move(map)) + : Value_(std::move(map)) { } TNode::TNode(const TNode& rhs) @@ -196,37 +196,37 @@ void TNode::Clear() bool TNode::IsString() const { - return std::holds_alternative<TString>(Value_); + return std::holds_alternative<TString>(Value_); } bool TNode::IsInt64() const { - return std::holds_alternative<i64>(Value_); + return std::holds_alternative<i64>(Value_); } bool TNode::IsUint64() const { - return std::holds_alternative<ui64>(Value_); + return std::holds_alternative<ui64>(Value_); } bool TNode::IsDouble() const { - return std::holds_alternative<double>(Value_); + return std::holds_alternative<double>(Value_); } bool TNode::IsBool() const { - return std::holds_alternative<bool>(Value_); + return std::holds_alternative<bool>(Value_); } bool TNode::IsList() const { - return std::holds_alternative<TListType>(Value_); + return std::holds_alternative<TListType>(Value_); } bool TNode::IsMap() const { - return std::holds_alternative<TMapType>(Value_); + return std::holds_alternative<TMapType>(Value_); } bool TNode::IsEntity() const @@ -236,12 +236,12 @@ bool TNode::IsEntity() const bool TNode::IsNull() const { - return std::holds_alternative<TNull>(Value_); + return std::holds_alternative<TNull>(Value_); } bool TNode::IsUndefined() const { - return std::holds_alternative<TUndefined>(Value_); + return std::holds_alternative<TUndefined>(Value_); } bool TNode::HasValue() const @@ -253,11 +253,11 @@ bool TNode::Empty() const { switch (GetType()) { case String: - return std::get<TString>(Value_).empty(); + return std::get<TString>(Value_).empty(); case List: - return std::get<TListType>(Value_).empty(); + return std::get<TListType>(Value_).empty(); case Map: - return std::get<TMapType>(Value_).empty(); + return std::get<TMapType>(Value_).empty(); default: ythrow TTypeError() << "Empty() called for type " << GetType(); } @@ -267,11 +267,11 @@ size_t TNode::Size() const { switch (GetType()) { case String: - return std::get<TString>(Value_).size(); + return std::get<TString>(Value_).size(); case List: - return std::get<TListType>(Value_).size(); + return std::get<TListType>(Value_).size(); case Map: - return std::get<TMapType>(Value_).size(); + return std::get<TMapType>(Value_).size(); default: ythrow TTypeError() << "Size() called for type " << GetType(); } @@ -295,106 +295,106 @@ TNode::EType TNode::GetType() const const TString& TNode::AsString() const { CheckType(String); - return std::get<TString>(Value_); + return std::get<TString>(Value_); } i64 TNode::AsInt64() const { CheckType(Int64); - return std::get<i64>(Value_); + return std::get<i64>(Value_); } ui64 TNode::AsUint64() const { CheckType(Uint64); - return std::get<ui64>(Value_); + return std::get<ui64>(Value_); } double TNode::AsDouble() const { CheckType(Double); - return std::get<double>(Value_); + return std::get<double>(Value_); } bool TNode::AsBool() const { CheckType(Bool); - return std::get<bool>(Value_); + return std::get<bool>(Value_); } const TNode::TListType& TNode::AsList() const { CheckType(List); - return std::get<TListType>(Value_); + return std::get<TListType>(Value_); } const TNode::TMapType& TNode::AsMap() const { CheckType(Map); - return std::get<TMapType>(Value_); + return std::get<TMapType>(Value_); } TNode::TListType& TNode::AsList() { CheckType(List); - return std::get<TListType>(Value_); + return std::get<TListType>(Value_); } TNode::TMapType& TNode::AsMap() { CheckType(Map); - return std::get<TMapType>(Value_); + return std::get<TMapType>(Value_); } const TString& TNode::UncheckedAsString() const noexcept { - return std::get<TString>(Value_); + return std::get<TString>(Value_); } i64 TNode::UncheckedAsInt64() const noexcept { - return std::get<i64>(Value_); + return std::get<i64>(Value_); } ui64 TNode::UncheckedAsUint64() const noexcept { - return std::get<ui64>(Value_); + return std::get<ui64>(Value_); } double TNode::UncheckedAsDouble() const noexcept { - return std::get<double>(Value_); + return std::get<double>(Value_); } bool TNode::UncheckedAsBool() const noexcept { - return std::get<bool>(Value_); + return std::get<bool>(Value_); } const TNode::TListType& TNode::UncheckedAsList() const noexcept { - return std::get<TListType>(Value_); + return std::get<TListType>(Value_); } const TNode::TMapType& TNode::UncheckedAsMap() const noexcept { - return std::get<TMapType>(Value_); + return std::get<TMapType>(Value_); } TNode::TListType& TNode::UncheckedAsList() noexcept { - return std::get<TListType>(Value_); + return std::get<TListType>(Value_); } TNode::TMapType& TNode::UncheckedAsMap() noexcept { - return std::get<TMapType>(Value_); + return std::get<TMapType>(Value_); } TNode TNode::CreateList() { TNode node; - node.Value_ = TListType{}; + node.Value_ = TListType{}; return node; } @@ -408,7 +408,7 @@ TNode TNode::CreateList(TListType list) TNode TNode::CreateMap() { TNode node; - node.Value_ = TMapType{}; + node.Value_ = TMapType{}; return node; } @@ -422,25 +422,25 @@ TNode TNode::CreateMap(TMapType map) TNode TNode::CreateEntity() { TNode node; - node.Value_ = TNull{}; + node.Value_ = TNull{}; return node; } const TNode& TNode::operator[](size_t index) const { CheckType(List); - return std::get<TListType>(Value_)[index]; + return std::get<TListType>(Value_)[index]; } TNode& TNode::operator[](size_t index) { CheckType(List); - return std::get<TListType>(Value_)[index]; + return std::get<TListType>(Value_)[index]; } const TNode& TNode::At(size_t index) const { CheckType(List); - const auto& list = std::get<TListType>(Value_); + const auto& list = std::get<TListType>(Value_); if (index >= list.size()) { ythrow TLookupError() << "List out-of-range: requested index=" << index << ", but size=" << list.size(); } @@ -449,7 +449,7 @@ const TNode& TNode::At(size_t index) const { TNode& TNode::At(size_t index) { CheckType(List); - auto& list = std::get<TListType>(Value_); + auto& list = std::get<TListType>(Value_); if (index >= list.size()) { ythrow TLookupError() << "List out-of-range: requested index=" << index << ", but size=" << list.size(); } @@ -459,7 +459,7 @@ TNode& TNode::At(size_t index) { TNode& TNode::Add() & { AssureList(); - return std::get<TListType>(Value_).emplace_back(); + return std::get<TListType>(Value_).emplace_back(); } TNode TNode::Add() && @@ -470,7 +470,7 @@ TNode TNode::Add() && TNode& TNode::Add(const TNode& node) & { AssureList(); - std::get<TListType>(Value_).emplace_back(node); + std::get<TListType>(Value_).emplace_back(node); return *this; } @@ -482,7 +482,7 @@ TNode TNode::Add(const TNode& node) && TNode& TNode::Add(TNode&& node) & { AssureList(); - std::get<TListType>(Value_).emplace_back(std::move(node)); + std::get<TListType>(Value_).emplace_back(std::move(node)); return *this; } @@ -494,13 +494,13 @@ TNode TNode::Add(TNode&& node) && bool TNode::HasKey(const TStringBuf key) const { CheckType(Map); - return std::get<TMapType>(Value_).contains(key); + return std::get<TMapType>(Value_).contains(key); } TNode& TNode::operator()(const TString& key, const TNode& value) & { AssureMap(); - std::get<TMapType>(Value_)[key] = value; + std::get<TMapType>(Value_)[key] = value; return *this; } @@ -512,7 +512,7 @@ TNode TNode::operator()(const TString& key, const TNode& value) && TNode& TNode::operator()(const TString& key, TNode&& value) & { AssureMap(); - std::get<TMapType>(Value_)[key] = std::move(value); + std::get<TMapType>(Value_)[key] = std::move(value); return *this; } @@ -525,7 +525,7 @@ const TNode& TNode::operator[](const TStringBuf key) const { CheckType(Map); static TNode notFound; - const auto& map = std::get<TMapType>(Value_); + const auto& map = std::get<TMapType>(Value_); TMapType::const_iterator i = map.find(key); if (i == map.end()) { return notFound; @@ -537,12 +537,12 @@ const TNode& TNode::operator[](const TStringBuf key) const TNode& TNode::operator[](const TStringBuf key) { AssureMap(); - return std::get<TMapType>(Value_)[key]; + return std::get<TMapType>(Value_)[key]; } const TNode& TNode::At(const TStringBuf key) const { CheckType(Map); - const auto& map = std::get<TMapType>(Value_); + const auto& map = std::get<TMapType>(Value_); TMapType::const_iterator i = map.find(key); if (i == map.end()) { ythrow TLookupError() << "Cannot find key " << key; @@ -553,7 +553,7 @@ const TNode& TNode::At(const TStringBuf key) const { TNode& TNode::At(const TStringBuf key) { CheckType(Map); - auto& map = std::get<TMapType>(Value_); + auto& map = std::get<TMapType>(Value_); TMapType::iterator i = map.find(key); if (i == map.end()) { ythrow TLookupError() << "Cannot find key " << key; @@ -828,7 +828,7 @@ void TNode::CheckType(EType type) const void TNode::AssureMap() { - if (std::holds_alternative<TUndefined>(Value_)) { + if (std::holds_alternative<TUndefined>(Value_)) { Value_ = TMapType(); } else { CheckType(Map); @@ -837,7 +837,7 @@ void TNode::AssureMap() void TNode::AssureList() { - if (std::holds_alternative<TUndefined>(Value_)) { + if (std::holds_alternative<TUndefined>(Value_)) { Value_ = TListType(); } else { CheckType(List); @@ -865,8 +865,8 @@ void TNode::Load(IInputStream* in) bool operator==(const TNode& lhs, const TNode& rhs) { - if (std::holds_alternative<TNode::TUndefined>(lhs.Value_) || - std::holds_alternative<TNode::TUndefined>(rhs.Value_)) + if (std::holds_alternative<TNode::TUndefined>(lhs.Value_) || + std::holds_alternative<TNode::TUndefined>(rhs.Value_)) { // TODO: should try to remove this behaviour if nobody uses it. return false; diff --git a/library/cpp/yson/node/node.h b/library/cpp/yson/node/node.h index 5f90f95df0..2fead29923 100644 --- a/library/cpp/yson/node/node.h +++ b/library/cpp/yson/node/node.h @@ -10,7 +10,7 @@ #include <util/string/cast.h> #include <cmath> -#include <variant> +#include <variant> class IInputStream; class IOutputStream; @@ -57,7 +57,7 @@ private: bool operator==(const TUndefined&) const; }; - using TValue = std::variant< + using TValue = std::variant< bool, i64, ui64, @@ -495,17 +495,17 @@ inline T& TNode::ChildAs(size_t index) { template<typename T> inline bool TNode::IsOfType() const noexcept { - return std::holds_alternative<T>(Value_); + return std::holds_alternative<T>(Value_); } template<typename T> inline T& TNode::As() { - return std::get<T>(Value_); + return std::get<T>(Value_); } template<typename T> inline const T& TNode::As() const { - return std::get<T>(Value_); + return std::get<T>(Value_); } //////////////////////////////////////////////////////////////////////////////// |