aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson/node
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:23 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:23 +0300
commit706b83ed7de5a473436620367af31fc0ceecde07 (patch)
tree103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/yson/node
parent918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff)
downloadydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson/node')
-rw-r--r--library/cpp/yson/node/node.cpp28
-rw-r--r--library/cpp/yson/node/node.h30
-rw-r--r--library/cpp/yson/node/node_builder.cpp2
-rw-r--r--library/cpp/yson/node/node_builder.h2
-rw-r--r--library/cpp/yson/node/node_visitor.cpp4
-rw-r--r--library/cpp/yson/node/node_visitor.h4
6 files changed, 35 insertions, 35 deletions
diff --git a/library/cpp/yson/node/node.cpp b/library/cpp/yson/node/node.cpp
index b39e070718..d2deeeb764 100644
--- a/library/cpp/yson/node/node.cpp
+++ b/library/cpp/yson/node/node.cpp
@@ -111,7 +111,7 @@ TNode::TNode(const std::string& s)
: Value_(TString(s))
{ }
-TNode::TNode(TString s)
+TNode::TNode(TString s)
: Value_(std::move(s))
{ }
@@ -292,7 +292,7 @@ TNode::EType TNode::GetType() const
}, Value_);
}
-const TString& TNode::AsString() const
+const TString& TNode::AsString() const
{
CheckType(String);
return std::get<TString>(Value_);
@@ -322,25 +322,25 @@ bool TNode::AsBool() const
return std::get<bool>(Value_);
}
-const TNode::TListType& TNode::AsList() const
+const TNode::TListType& TNode::AsList() const
{
CheckType(List);
return std::get<TListType>(Value_);
}
-const TNode::TMapType& TNode::AsMap() const
+const TNode::TMapType& TNode::AsMap() const
{
CheckType(Map);
return std::get<TMapType>(Value_);
}
-TNode::TListType& TNode::AsList()
+TNode::TListType& TNode::AsList()
{
CheckType(List);
return std::get<TListType>(Value_);
}
-TNode::TMapType& TNode::AsMap()
+TNode::TMapType& TNode::AsMap()
{
CheckType(Map);
return std::get<TMapType>(Value_);
@@ -371,22 +371,22 @@ bool TNode::UncheckedAsBool() const noexcept
return std::get<bool>(Value_);
}
-const TNode::TListType& TNode::UncheckedAsList() const noexcept
+const TNode::TListType& TNode::UncheckedAsList() const noexcept
{
return std::get<TListType>(Value_);
}
-const TNode::TMapType& TNode::UncheckedAsMap() const noexcept
+const TNode::TMapType& TNode::UncheckedAsMap() const noexcept
{
return std::get<TMapType>(Value_);
}
-TNode::TListType& TNode::UncheckedAsList() noexcept
+TNode::TListType& TNode::UncheckedAsList() noexcept
{
return std::get<TListType>(Value_);
}
-TNode::TMapType& TNode::UncheckedAsMap() noexcept
+TNode::TMapType& TNode::UncheckedAsMap() noexcept
{
return std::get<TMapType>(Value_);
}
@@ -526,7 +526,7 @@ const TNode& TNode::operator[](const TStringBuf key) const
CheckType(Map);
static TNode notFound;
const auto& map = std::get<TMapType>(Value_);
- TMapType::const_iterator i = map.find(key);
+ TMapType::const_iterator i = map.find(key);
if (i == map.end()) {
return notFound;
} else {
@@ -829,7 +829,7 @@ void TNode::CheckType(EType type) const
void TNode::AssureMap()
{
if (std::holds_alternative<TUndefined>(Value_)) {
- Value_ = TMapType();
+ Value_ = TMapType();
} else {
CheckType(Map);
}
@@ -838,7 +838,7 @@ void TNode::AssureMap()
void TNode::AssureList()
{
if (std::holds_alternative<TUndefined>(Value_)) {
- Value_ = TListType();
+ Value_ = TListType();
} else {
CheckType(List);
}
@@ -847,7 +847,7 @@ void TNode::AssureList()
void TNode::CreateAttributes()
{
Attributes_ = MakeHolder<TNode>();
- Attributes_->Value_ = TMapType();
+ Attributes_->Value_ = TMapType();
}
void TNode::Save(IOutputStream* out) const
diff --git a/library/cpp/yson/node/node.h b/library/cpp/yson/node/node.h
index 5f90f95df0..c82e846adf 100644
--- a/library/cpp/yson/node/node.h
+++ b/library/cpp/yson/node/node.h
@@ -45,8 +45,8 @@ public:
Null = 8 /*"null"*/,
};
- using TListType = TVector<TNode>;
- using TMapType = THashMap<TString, TNode>;
+ using TListType = TVector<TNode>;
+ using TMapType = THashMap<TString, TNode>;
private:
struct TNull {
@@ -62,9 +62,9 @@ private:
i64,
ui64,
double,
- TString,
- TListType,
- TMapType,
+ TString,
+ TListType,
+ TMapType,
TNull,
TUndefined
>;
@@ -76,7 +76,7 @@ public:
TNode(TStringBuf s);
explicit TNode(std::string_view s);
explicit TNode(const std::string& s);
- TNode(TString s);
+ TNode(TString s);
TNode(int i);
//this case made speccially for prevent mess cast of EType into TNode through TNode(int) constructor
@@ -139,25 +139,25 @@ public:
EType GetType() const;
- const TString& AsString() const;
+ const TString& AsString() const;
i64 AsInt64() const;
ui64 AsUint64() const;
double AsDouble() const;
bool AsBool() const;
- const TListType& AsList() const;
- const TMapType& AsMap() const;
- TListType& AsList();
- TMapType& AsMap();
+ const TListType& AsList() const;
+ const TMapType& AsMap() const;
+ TListType& AsList();
+ TMapType& AsMap();
const TString& UncheckedAsString() const noexcept;
i64 UncheckedAsInt64() const noexcept;
ui64 UncheckedAsUint64() const noexcept;
double UncheckedAsDouble() const noexcept;
bool UncheckedAsBool() const noexcept;
- const TListType& UncheckedAsList() const noexcept;
- const TMapType& UncheckedAsMap() const noexcept;
- TListType& UncheckedAsList() noexcept;
- TMapType& UncheckedAsMap() noexcept;
+ const TListType& UncheckedAsList() const noexcept;
+ const TMapType& UncheckedAsMap() const noexcept;
+ TListType& UncheckedAsList() noexcept;
+ TMapType& UncheckedAsMap() noexcept;
// integer types cast
// makes overflow checks
diff --git a/library/cpp/yson/node/node_builder.cpp b/library/cpp/yson/node/node_builder.cpp
index b4431bc77a..25fcb0f1f8 100644
--- a/library/cpp/yson/node/node_builder.cpp
+++ b/library/cpp/yson/node/node_builder.cpp
@@ -61,7 +61,7 @@ void TNodeBuilder::OnBeginMap()
void TNodeBuilder::OnKeyedItem(TStringBuf key)
{
- Stack_.push(&(*Stack_.top())[TString(key)]);
+ Stack_.push(&(*Stack_.top())[TString(key)]);
}
void TNodeBuilder::OnEndMap()
diff --git a/library/cpp/yson/node/node_builder.h b/library/cpp/yson/node/node_builder.h
index 69800016e0..0190870f91 100644
--- a/library/cpp/yson/node/node_builder.h
+++ b/library/cpp/yson/node/node_builder.h
@@ -35,7 +35,7 @@ public:
void OnNode(TNode node);
private:
- TStack<TNode*> Stack_;
+ TStack<TNode*> Stack_;
private:
inline void AddNode(TNode node, bool pop);
diff --git a/library/cpp/yson/node/node_visitor.cpp b/library/cpp/yson/node/node_visitor.cpp
index 899fbfa02a..69a66cc4ed 100644
--- a/library/cpp/yson/node/node_visitor.cpp
+++ b/library/cpp/yson/node/node_visitor.cpp
@@ -112,7 +112,7 @@ void TNodeVisitor::VisitBool(const TNode& node)
Consumer_->OnBooleanScalar(node.AsBool());
}
-void TNodeVisitor::VisitList(const TNode::TListType& nodeList)
+void TNodeVisitor::VisitList(const TNode::TListType& nodeList)
{
Consumer_->OnBeginList();
size_t index = 0;
@@ -128,7 +128,7 @@ void TNodeVisitor::VisitList(const TNode::TListType& nodeList)
Consumer_->OnEndList();
}
-void TNodeVisitor::VisitMap(const TNode::TMapType& nodeMap)
+void TNodeVisitor::VisitMap(const TNode::TMapType& nodeMap)
{
Consumer_->OnBeginMap();
Iterate(nodeMap, SortMapKeys_, [&](const std::pair<TString, TNode>& item) {
diff --git a/library/cpp/yson/node/node_visitor.h b/library/cpp/yson/node/node_visitor.h
index db25832309..927df5d9e7 100644
--- a/library/cpp/yson/node/node_visitor.h
+++ b/library/cpp/yson/node/node_visitor.h
@@ -14,8 +14,8 @@ public:
TNodeVisitor(NYson::IYsonConsumer* consumer, bool sortMapKeys = false);
void Visit(const TNode& node);
- void VisitMap(const TNode::TMapType& nodeMap);
- void VisitList(const TNode::TListType& nodeMap);
+ void VisitMap(const TNode::TMapType& nodeMap);
+ void VisitList(const TNode::TListType& nodeMap);
private:
NYson::IYsonConsumer* Consumer_;