QoreNamespace Class Reference

contains constants, classes, and subnamespaces in QoreProgram objects More...

#include <QoreNamespace.h>

Inheritance diagram for QoreNamespace:

RootQoreNamespace

List of all members.

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 QoreNamespacecopy (int po=0) const
 returns a deep copy of the namespace
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 * 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


Detailed Description

contains constants, classes, and subnamespaces in QoreProgram objects

Constructor & Destructor Documentation

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

Parameters:
n the name of the namespace


Member Function Documentation

DLLEXPORT void QoreNamespace::addConstant ( const char *  name,
AbstractQoreNode value 
)

adds a constant definition to the namespace

Parameters:
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)

Parameters:
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

Parameters:
ns the namespace to add

DLLEXPORT void QoreNamespace::addSystemClass ( QoreClass oc  ) 

adds a class to a namespace

Parameters:
oc the class to add to the namespace

DLLEXPORT QoreNamespace* QoreNamespace::copy ( int  po = 0  )  const

returns a deep copy of the namespace

Parameters:
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

See also:
QoreHashNode

QoreListNode

Returns:
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

See also:
QoreHashNode

QoreListNode

Returns:
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.

Returns:
a hash giving information about the definitions in the namespace

DLLEXPORT const char* QoreNamespace::getName (  )  const

returns the name of the namespace

Returns:
the name of the namespace


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

doxygen