Qore Programming Language - C/C++ Library 2.2.1
Loading...
Searching...
No Matches
RootQoreNamespace Class Reference

the root namespace of a QoreProgram object More...

#include <QoreNamespace.h>

Inheritance diagram for RootQoreNamespace:
[legend]
Collaboration diagram for RootQoreNamespace:
[legend]

Public Member Functions

virtual DLLLOCAL ~RootQoreNamespace ()
 destructor is not exported in the library's public API
DLLEXPORT QoreProgramgetProgram () const
 Returns the owning QoreProgram object (if not the static system namespace).
DLLEXPORT QoreNamespacerootGetQoreNamespace () const
 returns a pointer to the QoreNamespace for the "Qore" namespace
Public Member Functions inherited from QoreNamespace
DLLEXPORT QoreNamespace (const char *n)
 creates a namespace with the given name
DLLEXPORT QoreNamespace (const QoreNamespace &old, int64 po)
 copies the namespace and assigns new parse options to the new namespace
virtual DLLEXPORT ~QoreNamespace ()
 destroys the object and frees memory
DLLEXPORT void addBuiltinVariant (const char *name, q_func_n_t f, int64 code_flags=QCF_NO_FLAGS, int64 functional_domain=QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo=0, unsigned num_params=0,...)
 adds a function variant
DLLEXPORT void addBuiltinVariant (void *ptr, const char *name, q_external_func_t f, int64 code_flags=QCF_NO_FLAGS, int64 functional_domain=QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo=nullptr, unsigned num_params=0,...)
 adds a function variant
DLLEXPORT void addConstant (const char *name, QoreValue value)
 adds a constant definition to the namespace
DLLEXPORT void addConstant (const char *name, QoreValue value, const QoreTypeInfo *typeInfo)
 adds a constant definition to the namespace with type information
DLLEXPORT void addInitialNamespace (QoreNamespace *ns)
 adds a subnamespace to the namespace
DLLEXPORT void addNamespace (QoreNamespace *ns)
 adds a namespace to the namespace tree
DLLEXPORT void addSystemClass (QoreClass *oc)
 adds a class to a namespace
DLLEXPORT void addSystemHashDecl (TypedHashDecl *hashdecl)
 adds a hashdecl to a namespace
DLLEXPORT void clear (ExceptionSink *xsink)
 clears the contents of the namespace before deleting
DLLEXPORT QoreNamespacecopy (int64 po=PO_DEFAULT) const
 returns a deep copy of the namespace
DLLEXPORT void deleteData (ExceptionSink *xsink)
 this function must be called before the QoreNamespace object is deleted or a crash could result due if constants and/or class static vars contain objects
DLLEXPORT QoreNamespacefindCreateNamespacePath (const char *nspath)
 finds a Namespace based on the argument; creates it (or the whole path) if necessary
DLLEXPORT QoreNamespacefindCreateNamespacePathAll (const char *nspath)
 finds a Namespace based on the argument; creates it (or the whole path) if necessary
DLLEXPORT QoreClassfindLoadLocalClass (const char *cname)
 finds a class in this namespace, does not search child namespaces
DLLEXPORT QoreClassfindLocalClass (const char *cname) const
 finds a class in this namespace, does not search child namespaces
DLLEXPORT const QoreExternalConstantfindLocalConstant (const char *name) const
 find a constant in the current namespace; returns nullptr if not found
DLLEXPORT const QoreExternalFunction * findLocalFunction (const char *name) const
 find a function in the current namespace; returns nullptr if not found
DLLEXPORT const QoreExternalGlobalVar * findLocalGlobalVar (const char *name) const
 find a global variable in the current namespace; returns nullptr if not found
DLLEXPORT QoreNamespacefindLocalNamespace (const char *nsname) const
 finds a subnamespace in this namespace, does not search child namespaces
DLLEXPORT const TypedHashDeclfindLocalTypedHash (const char *name) const
 find a typed hash (hashdecl) in the current namespace; returns nullptr if not found
DLLEXPORT QoreHashNodegetClassInfo () const
 gets a hash of all classes in the namespace, the hash keys are the class names and the values are lists of strings giving the method names
DLLEXPORT QoreHashNodegetConstantInfo () const
 a hash of all constants in the namespace, the hash keys are the constant names and the values are the values of the constants
DLLEXPORT QoreHashNodegetInfo () const
 returns a hash giving information about the definitions in the namespace
DLLEXPORT const char * getModuleName () const
 Returns the module name the namespace was loaded from or nullptr if it is a builtin namespace.
DLLEXPORT const char * getName () const
 returns the name of the namespace
DLLEXPORT const QoreNamespacegetParent () const
 returns a pointer to the parent namespace or nullptr if there is no parent
DLLEXPORT std::string getPath (bool anchored=false) const
 returns the path for the namespace
DLLEXPORT QoreProgramgetProgram () const
 Returns the owning QoreProgram object (if not the static system namespace).
DLLEXPORT QoreValue getReferencedKeyValue (const char *key) const
 Returns a referenced key value from the namespace's key-value store.
DLLEXPORT QoreValue getReferencedKeyValue (const std::string &key) const
 Returns a referenced key value from the namespace's key-value store.
DLLEXPORT bool isBuiltin () const
 returns true if the namespace is builtin
DLLEXPORT bool isImported () const
 returns true if the namespace was imported from another program object
DLLEXPORT bool isModulePublic () const
 returns true if the namespace has its module public flag set
DLLEXPORT bool isRoot () const
 returns true if the namespace is the root namespace
DLLEXPORT void setClassHandler (q_ns_class_handler_t class_handler)
 sets the namespace class handler
DLLEXPORT QoreValue setKeyValue (const std::string &key, QoreValue val)
 Sets a key value in the namespace's key-value store unconditionally.
DLLEXPORT bool setKeyValueIfNotSet (const std::string &key, const char *str)
 Sets a key value in the namespace's key-value store only if no value exists for the given key.
DLLEXPORT QoreValue setKeyValueIfNotSet (const std::string &key, QoreValue val)
 Sets a key value in the namespace's key-value store only if no value exists for the given key.

Detailed Description

the root namespace of a QoreProgram object

is a specialization of QoreNamespace that provides functionality specific to the root namespace this class' constructor and destructors are private, so the class may change without affecting the library's ABI

See also
QoreNamespace

Member Function Documentation

◆ getProgram()

DLLEXPORT QoreProgram * RootQoreNamespace::getProgram ( ) const

Returns the owning QoreProgram object (if not the static system namespace).

Since
Qore 0.9.5

◆ rootGetQoreNamespace()

DLLEXPORT QoreNamespace * RootQoreNamespace::rootGetQoreNamespace ( ) const

returns a pointer to the QoreNamespace for the "Qore" namespace

Returns
a pointer to the QoreNamespace for the "Qore" namespace; do not delete the object returned

References QoreNamespace::QoreNamespace().


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