Added relationship and scope filter test case
This commit is contained in:
@@ -250,6 +250,53 @@ template <> struct convert<scope_t> {
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// config relationship_t decoder
|
||||
//
|
||||
template <> struct convert<relationship_t> {
|
||||
static bool decode(const Node &node, relationship_t &rhs)
|
||||
{
|
||||
assert(node.Type() == NodeType::Scalar);
|
||||
|
||||
auto relationship_name = node.as<std::string>();
|
||||
if (relationship_name == "extension" ||
|
||||
relationship_name == "inheritance") {
|
||||
rhs = relationship_t::kExtension;
|
||||
}
|
||||
else if (relationship_name == "composition") {
|
||||
rhs = relationship_t::kComposition;
|
||||
}
|
||||
else if (relationship_name == "aggregation") {
|
||||
rhs = relationship_t::kAggregation;
|
||||
}
|
||||
else if (relationship_name == "containment") {
|
||||
rhs = relationship_t::kContainment;
|
||||
}
|
||||
else if (relationship_name == "ownership") {
|
||||
rhs = relationship_t::kOwnership;
|
||||
}
|
||||
else if (relationship_name == "association") {
|
||||
rhs = relationship_t::kAssociation;
|
||||
}
|
||||
else if (relationship_name == "instantiation") {
|
||||
rhs = relationship_t::kInstantiation;
|
||||
}
|
||||
else if (relationship_name == "friendship") {
|
||||
rhs = relationship_t::kFriendship;
|
||||
}
|
||||
else if (relationship_name == "dependency") {
|
||||
rhs = relationship_t::kDependency;
|
||||
}
|
||||
else if (relationship_name == "none") {
|
||||
rhs = relationship_t::kNone;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template <> struct convert<std::vector<source_location>> {
|
||||
static bool decode(const Node &node, std::vector<source_location> &rhs)
|
||||
{
|
||||
@@ -465,53 +512,6 @@ template <> struct convert<layout_hint> {
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// config relationship_t decoder
|
||||
//
|
||||
template <> struct convert<relationship_t> {
|
||||
static bool decode(const Node &node, relationship_t &rhs)
|
||||
{
|
||||
assert(node.Type() == NodeType::Scalar);
|
||||
|
||||
auto relationship_name = node.as<std::string>();
|
||||
if (relationship_name == "extension" ||
|
||||
relationship_name == "inheritance") {
|
||||
rhs = relationship_t::kExtension;
|
||||
}
|
||||
else if (relationship_name == "composition") {
|
||||
rhs = relationship_t::kComposition;
|
||||
}
|
||||
else if (relationship_name == "aggregation") {
|
||||
rhs = relationship_t::kAggregation;
|
||||
}
|
||||
else if (relationship_name == "containment") {
|
||||
rhs = relationship_t::kContainment;
|
||||
}
|
||||
else if (relationship_name == "ownership") {
|
||||
rhs = relationship_t::kOwnership;
|
||||
}
|
||||
else if (relationship_name == "association") {
|
||||
rhs = relationship_t::kAssociation;
|
||||
}
|
||||
else if (relationship_name == "instantiation") {
|
||||
rhs = relationship_t::kInstantiation;
|
||||
}
|
||||
else if (relationship_name == "friendship") {
|
||||
rhs = relationship_t::kFriendship;
|
||||
}
|
||||
else if (relationship_name == "dependency") {
|
||||
rhs = relationship_t::kDependency;
|
||||
}
|
||||
else if (relationship_name == "none") {
|
||||
rhs = relationship_t::kNone;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// config Yaml decoder
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user