Base::Type extension to get Type by key

This commit is contained in:
Abdullah Tahiri
2017-05-06 00:48:23 +02:00
committed by wmayer
parent 305c63290f
commit f54d00ce60
2 changed files with 9 additions and 0 deletions

View File

@@ -184,6 +184,14 @@ Type Type::fromName(const char *name)
return Type::badType();
}
Type Type::fromKey(unsigned int key)
{
if(key < typedata.size())
return typedata[key]->type;
else
return Type::badType();
}
const char *Type::getName(void) const
{
return typedata[index]->name.c_str();