mirror of
https://github.com/libAthena/athena.git
synced 2025-05-13 19:01:23 +00:00
Added YAML child node finder
This commit is contained in:
parent
2e240520e1
commit
f49a6a6e82
@ -45,6 +45,13 @@ struct YAMLNode
|
|||||||
std::vector<std::unique_ptr<YAMLNode>> m_seqChildren;
|
std::vector<std::unique_ptr<YAMLNode>> m_seqChildren;
|
||||||
std::vector<std::pair<std::string, std::unique_ptr<YAMLNode>>> m_mapChildren;
|
std::vector<std::pair<std::string, std::unique_ptr<YAMLNode>>> m_mapChildren;
|
||||||
YAMLNode(yaml_node_type_t type) : m_type(type) {}
|
YAMLNode(yaml_node_type_t type) : m_type(type) {}
|
||||||
|
inline const YAMLNode* findMapChild(const char* key) const
|
||||||
|
{
|
||||||
|
for (const auto& item : m_mapChildren)
|
||||||
|
if (!item.first.compare(key))
|
||||||
|
return item.second.get();
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename RETURNTYPE>
|
template <typename RETURNTYPE>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user