Sign in to follow this  
Jason Goepel

Enumerate names of Enum

Recommended Posts

How does one enumerate the names of all globally registered Enums?

for (asUINT i = 0, n = p_engine->GetEnumCount(); i < n; ++i)
{
    int enumTypeId;
    p_engine->GetEnumByIndex(i, &enumTypeId);
    // Get Name ??
}

Share this post


Link to post
Share on other sites

The name of the enum type is returned by GetEnumByIndex. Alternatively it can be obtained with GetTypeDeclaration. The name/value of each enum in the enum type is obtained with GetEnumValueByIndex.

 

I've documented this here: Manual: Reflection

 

Regards,

Andreas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this