#include <QoreNamespace.h>
Public Member Functions | |
DLLEXPORT | QoreNamespace (const char *n) |
creates a namespace with the given name | |
DLLEXPORT | ~QoreNamespace () |
destroys the object and frees all associated memory | |
DLLEXPORT void | addConstant (const char *name, AbstractQoreNode *value) |
adds a constant definition to the namespace | |
DLLEXPORT void | addSystemClass (QoreClass *oc) |
adds a class to a namespace | |
DLLEXPORT void | addInitialNamespace (QoreNamespace *ns) |
adds a subnamespace to the namespace | |
DLLEXPORT QoreNamespace * | copy (int po=0) const |
returns a deep copy of the namespace | |
DLLEXPORT QoreHashNode * | getClassInfo () 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 QoreHashNode * | getConstantInfo () 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 QoreHashNode * | getInfo () const |
returns a hash giving information about the definitions in the namespace | |
DLLEXPORT const char * | getName () const |
returns the name of the namespace | |
DLLEXPORT void | addNamespace (QoreNamespace *ns) |
adds a namespace to the pending namespace tree | |
DLLLOCAL void | purge () |
destroys the object and frees all associated memory (not exported) | |
Friends | |
class | RootQoreNamespace |
DLLEXPORT QoreNamespace::QoreNamespace | ( | const char * | n | ) |
creates a namespace with the given name
the name of a subnamespace must be unique in the parent namespace and must not have the same name as a class in the parent namespace either
n | the name of the namespace |
DLLEXPORT void QoreNamespace::addConstant | ( | const char * | name, | |
AbstractQoreNode * | value | |||
) |
adds a constant definition to the namespace
name | the name of the constant to add | |
value | the value of the constant |
DLLEXPORT void QoreNamespace::addInitialNamespace | ( | QoreNamespace * | ns | ) |
adds a subnamespace to the namespace
use this function when the QoreNamespace can be added directly to the tree (does not need to be merged with another namespace of the same name and does not contain user code)
ns | the subnamespace to add to the namespace |
DLLEXPORT void QoreNamespace::addNamespace | ( | QoreNamespace * | ns | ) |
adds a namespace to the pending namespace tree
namespace objects are merged if there is a namespace with the same name; duplicate objects are checked and user code is initialized
ns | the namespace to add |
DLLEXPORT void QoreNamespace::addSystemClass | ( | QoreClass * | oc | ) |
adds a class to a namespace
oc | the class to add to the namespace |
DLLEXPORT QoreNamespace* QoreNamespace::copy | ( | int | po = 0 |
) | const |
returns a deep copy of the namespace
po | parse options to use when copying the namespace |
Reimplemented in RootQoreNamespace.
DLLEXPORT QoreHashNode* QoreNamespace::getClassInfo | ( | ) | 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 QoreHashNode* QoreNamespace::getConstantInfo | ( | ) | 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 QoreHashNode* QoreNamespace::getInfo | ( | ) | const |
returns a hash giving information about the definitions in the namespace
the return value has the following keys: "constants", "classes", and "subnamespaces" having as values the result of calling QoreNamespace::getConstantInfo(), QoreNamespace::getClassInfo(), and a hash of subnamespace names having as values the result of calling this function on each, respectively.
DLLEXPORT const char* QoreNamespace::getName | ( | ) | const |
returns the name of the namespace