![]() |
Qore Programming Language 2.3.0
|
Enum declaration. More...
#include <QoreEnumDecl.h>
Public Member Methods | |
| DLLEXPORT | QoreEnumDecl (const char *name, const char *path, const QoreTypeInfo *baseType) |
| creates the enum with the given name and path | |
| DLLEXPORT | QoreEnumDecl (const QoreEnumDecl &old) |
| copy constructor | |
| DLLEXPORT void | addMember (const char *name, QoreValue val) |
| adds a member to a built-in enum | |
| DLLEXPORT bool | equal (const QoreEnumDecl *other) const |
| returns true if the enum passed as an argument is equal to this enum | |
| DLLEXPORT const QoreEnumMember * | findMember (const char *name) const |
| finds the given member by name or returns nullptr | |
| DLLEXPORT const QoreEnumMember * | findMemberByValue (const QoreValue &val) const |
| finds the given member by value or returns nullptr | |
| DLLEXPORT const QoreTypeInfo * | getBaseTypeInfo () const |
| returns the base type info for the enum (int, string, etc.) | |
| DLLEXPORT size_t | getMemberCount () const |
| returns the number of members | |
| DLLEXPORT const char * | getModuleName () const |
| Returns the module name the enum was loaded from or nullptr if it is a builtin enum. | |
| DLLEXPORT const char * | getName () const |
| returns the name of the enum | |
| DLLEXPORT const QoreNamespace * | getNamespace () const |
| Returns the namespace owning the enum declaration. | |
| DLLEXPORT std::string | getNamespacePath (bool anchored=false) const |
| returns the full namespace path of the enum | |
| DLLEXPORT const QoreExternalProgramLocation * | getSourceLocation () const |
| returns the source location of the enum definition | |
| DLLEXPORT const QoreTypeInfo * | getTypeInfo (bool or_nothing=false) const |
| returns the type info object for the enum | |
| DLLEXPORT bool | isPublic () const |
| returns true if the enum has the public (export) flag set | |
| DLLEXPORT bool | isSystem () const |
| returns true if the enum is a builtin enum | |
| DLLEXPORT bool | isValidValue (const QoreValue &val) const |
| Validates that the given value is valid for this enum. | |
Private Member Methods | |
| DLLEXPORT | ~QoreEnumDecl () |
| deletes the object and frees all memory | |
Enum declaration.
| DLLEXPORT bool QoreEnumDecl::isValidValue | ( | const QoreValue & | val | ) | const |
Validates that the given value is valid for this enum.