GammaRay API Documentation
2.10.0
|
Target-independent representation of an enum or flag definition. More...
#include <enumdefinition.h>
Public Member Functions | |
EnumDefinition (EnumId id, const QByteArray &name) | |
Create a new definition for an enum named name and internal id id . More... | |
QVector< EnumDefinitionElement > | elements () const |
Returns the individual elements of this enum. More... | |
EnumId | id () const |
A unique identifer for this enum definition. More... | |
bool | isFlag () const |
Returns true if this enum is used as a flag. More... | |
bool | isValid () const |
Returns whether this is a valid enum definition. More... | |
QByteArray | name () const |
The name of the enum. More... | |
QByteArray | valueToString (const EnumValue &value) const |
Converts the given enum value into a string representation. More... | |
Friends | |
QDataStream & | operator<< (QDataStream &out, const EnumDefinition &def) |
QDataStream & | operator>> (QDataStream &in, EnumDefinition &def) |
Target-independent representation of an enum or flag definition.
|
explicit |
Create a new definition for an enum named name
and internal id id
.
QVector<EnumDefinitionElement> GammaRay::EnumDefinition::elements | ( | ) | const |
Returns the individual elements of this enum.
That is, the key/value pairs of its definition.
EnumId GammaRay::EnumDefinition::id | ( | ) | const |
A unique identifer for this enum definition.
This is used to identify enums between the GammaRay client and server.
bool GammaRay::EnumDefinition::isFlag | ( | ) | const |
Returns true
if this enum is used as a flag.
bool GammaRay::EnumDefinition::isValid | ( | ) | const |
Returns whether this is a valid enum definition.
This means it's a enum definition registered with the EnumRepository and there is at least one enum definition element present.
QByteArray GammaRay::EnumDefinition::name | ( | ) | const |
The name of the enum.
QByteArray GammaRay::EnumDefinition::valueToString | ( | const EnumValue & | value | ) | const |
Converts the given enum value into a string representation.