Qore Programming Language Reference Manual 1.18.0
|
The ProgramControl class provides safe information about a Qore program. More...
#include <QC_ProgramControl.dox.h>
Public Member Methods | |
nothing | assignBreakpoint (Breakpoint bkpt) |
Assign Breakpoint instance to Program. If breakpoint has been assigned to an program then is unassigned in the first step. | |
constructor () | |
Throws an exception to prevent objects of this class being created from script. More... | |
copy () | |
Throws an exception to prevent objects of this class from being copied. More... | |
nothing | deleteAllBreakpoints () |
delete all breakpoints from instance | |
destructor () | |
Dereferences the internal Program object and deletes the Qore object. | |
bool | existsFunction (string name) |
Checks if a user function exists in the program object. More... | |
int | findFunctionStatementId (string function, *list params) |
Find the first statement for function entry point. More... | |
list< hash< auto > > | findFunctionVariants (string function) |
finds all variants of a function or class method and returns a list of the results More... | |
int | findStatementId (string file, int line) |
Find statement related to position in file. More... | |
*hash< auto > | getAllDefines () |
Retrieves all parse defines in the current Program. More... | |
list< Breakpoint > | getBreakpoints () |
get list of breakpoint assigned to program. | |
auto | getDefine (string def) |
Retrieves the value of the given parse define in the current Program. More... | |
auto | getGlobalVariable (string varname, *reference< bool > rexists) |
Returns a the value of the global variable identified by the first string argument. More... | |
hash< auto > | getGlobalVars () |
returns a hash of global variables More... | |
int | getParseOptions () |
Returns the current binary-or'ed parse option mask for the Program object. More... | |
int | getProgramId () |
Get program id. More... | |
*string | getScriptDir () |
Returns the current script directory as a string or NOTHING if not set. More... | |
*string | getScriptName () |
Returns the current script name as a string or NOTHING if not set. More... | |
*string | getScriptPath () |
Returns the current script directory and filename if known, otherwise returns NOTHING. More... | |
hash< string, hash< string, int > > | getSourceFileNames () |
Returns a list of file names registered to a statement when parsing source code. More... | |
hash< string, hash< string, int > > | getSourceLabels () |
Get list of label names which has been registered to a statement when parsing source code. More... | |
hash< StatementInfo > | getStatementIdInfo (int statementId, bool listBreakpoints=False) |
get information related to statement id More... | |
list< int > | getThreadList () |
returns a list of thread IDs active in this Program More... | |
TimeZone | getTimeZone () |
Returns the default local time zone for the object. More... | |
bool | isDefined (string def) |
Returns True if the given parse define is defined in the current Program (does not have to have a value defined to return True), False if not. More... | |
nothing | setGlobalVarValue (string name, auto value) |
set the value of a global variable More... | |
Static Public Member Methods | |
static list< ProgramControl > | getAllPrograms () |
Get instance of all programs. More... | |
static ProgramControl | getProgram () |
Get control for instance of current program. More... | |
static ProgramControl | resolveProgramId (int programId) |
Get instance of program id. More... | |
The ProgramControl class provides safe information about a Qore program.
The object is never instantiated in script but returned by a API function. The class provides only safe data non breaking security model.
Qore::ProgramControl::constructor | ( | ) |
Throws an exception to prevent objects of this class being created from script.
PROGRAM-CREATE-ERROR | copying ProgramControl objects is currently unsupported |
Qore::ProgramControl::copy | ( | ) |
Throws an exception to prevent objects of this class from being copied.
PROGRAM-COPY-ERROR | copying Program objects is currently unsupported |
bool Qore::ProgramControl::existsFunction | ( | string | name | ) |
Checks if a user function exists in the program object.
see Qore::Program::existsFunction "Program::existsFunction()"
Find the first statement for function entry point.
function | name |
params | param types to resolve particular variant |
finds all variants of a function or class method and returns a list of the results
function | the function or class method name; may also be namespace-justified |
desc:
a string description of the call which includes the name and the full text call signatureparams:
a list object that gives the params in a format that can be used by findFunctionStatementId Find statement related to position in file.
file | name where is looking for. Searching is done in three steps, in the first one is looking for full name match, in the second is looking for label full match (if exists) and in the third for end suffix match. File can by empty if program contains only one file. Beware of label formating, see Qore::Program::parse |
line | to find statement. In case of multiple statements of line the first one is found |
*hash< auto > Qore::ProgramControl::getAllDefines | ( | ) |
Retrieves all parse defines in the current Program.
see Qore::Program::getAllDefines "Program::getAllDefines()"
|
static |
Get instance of all programs.
Use ProgramControl::resolveProgramId() to get instance
auto Qore::ProgramControl::getDefine | ( | string | def | ) |
Retrieves the value of the given parse define in the current Program.
see Qore::Program::getDefine "Program::getDefine()"
auto Qore::ProgramControl::getGlobalVariable | ( | string | varname, |
*reference< bool > | rexists | ||
) |
Returns a the value of the global variable identified by the first string argument.
see Qore::Program::getGlobalVariable "Program::getGlobalVariable()"
hash< auto > Qore::ProgramControl::getGlobalVars | ( | ) |
returns a hash of global variables
see Qore::Program::getGlobalVars "Program::getGlobalVars()"
int Qore::ProgramControl::getParseOptions | ( | ) |
Returns the current binary-or'ed parse option mask for the Program object.
see Qore::Program::getParseOptions "Program::getParseOptions()"
|
static |
Get control for instance of current program.
int Qore::ProgramControl::getProgramId | ( | ) |
*string Qore::ProgramControl::getScriptDir | ( | ) |
Returns the current script directory as a string or NOTHING if not set.
see Qore::Program::getScriptDir "Program::getScriptDir()"
*string Qore::ProgramControl::getScriptName | ( | ) |
Returns the current script name as a string or NOTHING if not set.
see Qore::Program::getScriptPath "Program::getScriptPath()"
*string Qore::ProgramControl::getScriptPath | ( | ) |
Returns the current script directory and filename if known, otherwise returns NOTHING.
see Qore::Program::getScriptPath "Program::getScriptPath()"
Returns a list of file names registered to a statement when parsing source code.
Get list of label names which has been registered to a statement when parsing source code.
hash< StatementInfo > Qore::ProgramControl::getStatementIdInfo | ( | int | statementId, |
bool | listBreakpoints = False |
||
) |
get information related to statement id
statementId | |
listBreakpoints | list also breakpoints assigned to statement, no effect if %no-debugging (since 0.9) |
returns a list of thread IDs active in this Program
see Qore::Program::getThreadList "Program::getThreadList()"
TimeZone Qore::ProgramControl::getTimeZone | ( | ) |
Returns the default local time zone for the object.
see Qore::Program::getTimeZone "Program::getTimeZone()"
bool Qore::ProgramControl::isDefined | ( | string | def | ) |
Returns True if the given parse define is defined in the current Program (does not have to have a value defined to return True), False if not.
see Qore::Program::isDefined "Program::isDefined()"
|
static |
Get instance of program id.
PROGRAM-ERROR | if the programId cannot identify ProgramControl instance |
nothing Qore::ProgramControl::setGlobalVarValue | ( | string | name, |
auto | value | ||
) |
set the value of a global variable
see Qore::Program::setGlobalVars "Program::setGlobalVars()"