Qore Programming Language 2.3.0
Loading...
Searching...
No Matches
QoreEnumDecl Class Reference

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 QoreEnumMemberfindMember (const char *name) const
 finds the given member by name or returns nullptr
 
DLLEXPORT const QoreEnumMemberfindMemberByValue (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 QoreNamespacegetNamespace () 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 QoreExternalProgramLocationgetSourceLocation () 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
 

Detailed Description

Enum declaration.

Since
Qore 2.1

Member Function Documentation

◆ isValidValue()

DLLEXPORT bool QoreEnumDecl::isValidValue ( const QoreValue val) const

Validates that the given value is valid for this enum.

Returns
true if valid, false otherwise

The documentation for this class was generated from the following file: