diff --git a/src/Base/Type.cpp b/src/Base/Type.cpp index 7c9848712a..789cb1481d 100644 --- a/src/Base/Type.cpp +++ b/src/Base/Type.cpp @@ -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(); diff --git a/src/Base/Type.h b/src/Base/Type.h index 50bc86cf68..38ecf12281 100644 --- a/src/Base/Type.h +++ b/src/Base/Type.h @@ -92,6 +92,7 @@ public: typedef void * (*instantiationMethod)(void); static Type fromName(const char *name); + static Type fromKey(unsigned int key); const char *getName(void) const; const Type getParent(void) const; bool isDerivedFrom(const Type type) const;