.. _api_MetaEnum: MetaEnum ======== Inherited: None .. _api_MetaEnum_description: Description ----------- This class is a part of Object-Introspection-Mechanism. MetaEnum provides information about one particular class enumerator. To make enumerators visible in introspection mechanism, developers must declare those under A_ENUMS() macro. .. _api_MetaEnum_public: Public Methods -------------- +----------------------------------------------------+------------------------------------------------------------------------+ | | :ref:`MetaEnum` (const MetaEnum::Table * table) | +----------------------------------------------------+------------------------------------------------------------------------+ | bool | :ref:`isValid` () const | +----------------------------------------------------+------------------------------------------------------------------------+ | const char | :ref:`key` (int index) const | +----------------------------------------------------+------------------------------------------------------------------------+ | int | :ref:`keyCount` () const | +----------------------------------------------------+------------------------------------------------------------------------+ | int | :ref:`keyToValue` (const char * key) const | +----------------------------------------------------+------------------------------------------------------------------------+ | const char | :ref:`name` () const | +----------------------------------------------------+------------------------------------------------------------------------+ | const :ref:`MetaEnum::Table` * | :ref:`table` () const | +----------------------------------------------------+------------------------------------------------------------------------+ | int | :ref:`value` (int index) const | +----------------------------------------------------+------------------------------------------------------------------------+ | const char | :ref:`valueToKey` (int value) const | +----------------------------------------------------+------------------------------------------------------------------------+ .. _api_MetaEnum_static: Static Methods -------------- None .. _api_MetaEnum_methods: Methods Description ------------------- .. _api_MetaEnum_f72516b9: **MetaEnum::MetaEnum** (:ref:`MetaEnum::Table` * *table*) Constructs MetaEnum object which will contain information provided in a table. ---- .. _api_MetaEnum_4b6fe012: bool **MetaEnum::isValid** () const Returns true if enumerator is valid; otherwise returns false. ---- .. _api_MetaEnum_24d0cab7: const char **MetaEnum::key** (int *index*) const Returns the key with the given index, or nullptr if no such key exists. ---- .. _api_MetaEnum_0f761acb: int **MetaEnum::keyCount** () const Returns the number of keys. ---- .. _api_MetaEnum_623570a1: int **MetaEnum::keyToValue** (char * *key*) const Returns the integer value of the given enumeration key, or -1 if *key* is not defined ---- .. _api_MetaEnum_a7f45691: const char **MetaEnum::name** () const Returns a name of enumerator. ---- .. _api_MetaEnum_af12068e: const :ref:`MetaEnum::Table` * **MetaEnum::table** () const Returns enumerator information table. ---- .. _api_MetaEnum_847b012a: int **MetaEnum::value** (int *index*) const Returns the value with the given index; or returns -1 if there is no such value. ---- .. _api_MetaEnum_d64e2fa1: const char **MetaEnum::valueToKey** (int *value*) const Returns the string that is used as the name of the given enumeration value, or nullptr if *value* is not defined.