Add `YAMLDocReader::hasVal`

This commit is contained in:
Phillip Stephens 2018-01-15 04:32:10 -08:00
parent ec49377fcd
commit de55c9acdf
1 changed files with 13 additions and 0 deletions

View File

@ -283,6 +283,19 @@ public:
return countOut; return countOut;
} }
bool hasVal(const char* name) const
{
if (m_subStack.size())
{
const YAMLNode* mnode = m_subStack.back();
if (mnode->m_type == YAML_MAPPING_NODE && name)
for (const auto& item : mnode->m_mapChildren)
if (!item.first.compare(name))
return true;
}
return false;
}
template <typename RETURNTYPE> template <typename RETURNTYPE>
RETURNTYPE readVal(const char* name); RETURNTYPE readVal(const char* name);
bool readBool(const char* name); bool readBool(const char* name);