Integrating github/staging through commit 5f214be

This commit is contained in:
alexpete
2021-04-13 17:18:57 -07:00
parent 2a9dfb7a1d
commit 8469c9ca0a
904 changed files with 9289 additions and 7157 deletions
+1 -23
View File
@@ -193,34 +193,12 @@ bool IsOptionalReadXML(const SParseParams& parseParams, XmlNodeRef& definition)
return optional;
}
bool CheckEnum([[maybe_unused]] const SParseParams& parseParams, const char* name, XmlNodeRef& definition, XmlNodeRef& data)
bool CheckEnum([[maybe_unused]] const SParseParams& parseParams, [[maybe_unused]] const char* name, XmlNodeRef& definition, [[maybe_unused]] XmlNodeRef& data)
{
if (XmlNodeRef enumNode = definition->findChild("Enum"))
{
// If strict mode is off, then no need to check the enum value
return true;
// if restrictive attribute set to false, check always succeeds
if (enumNode->haveAttr("restrictive"))
{
bool res = true;
enumNode->getAttr("restrictive", res);
if (!res)
{
return true;
}
}
// else check enum values
const char* val = data->getAttr(name);
for (int i = 0; i < enumNode->getChildCount(); ++i)
{
if (0 == strcmp(enumNode->getChild(i)->getContent(), val))
{
return true;
}
}
return false;
}
return true;
}