Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

Enumerate names of Enum


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Jason Goepel   Members   -  Reputation: 442

Like
0Likes
Like

Posted 24 October 2013 - 01:56 PM

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 ??
}


Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3444

Like
0Likes
Like

Posted 24 October 2013 - 03:20 PM

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


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 Jason Goepel   Members   -  Reputation: 442

Like
0Likes
Like

Posted 25 October 2013 - 07:15 AM

Silly me.  For some reason I was completely ignoring the return value.  Thanks for answering my silly question.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS