116 nothing
define(
string def, any val);
418 *
hash parse(
string code,
string label, *softint warning_mask, *
string source, *softint offset, softbool format_label =
True);
502 *
hash parsePending(
string code,
string label, *softint warning_mask, *
string source, *softint offset, softbool format_label =
True);
const PO_NEW_STYLE
Set a more C++ or Java type programming style; prohibits usage of the "$" character and also assumes ...
Definition: QC_Program.dox.h:681
nothing importGlobalVariable(string varname, bool readonly=False)
Imports a global variable into the program object's space.
const PO_NO_USER_CLASSES
Prohibits user classes from being imported into the new Program object.
Definition: QC_Program.dox.h:820
const WARN_UNREACHABLE_CODE
Indicates that code cannot be reached (for example; code in the same local block after an uncondition...
Definition: QC_Program.dox.h:944
*string getScriptPath()
Returns the current script directory and filename if known, otherwise returns NOTHING.
const PO_LOCK_WARNINGS
Disallows changes to the warning mask.
Definition: QC_Program.dox.h:675
const WARN_DUPLICATE_BLOCK_VARS
Enables a warning when a program declares a local variable more than once in the same block; note tha...
Definition: QC_Program.dox.h:889
TimeZone getTimeZone()
Returns the default local time zone for the object.
const PO_NO_THREAD_CLASSES
Disallows access to any thread classes.
Definition: QC_Program.dox.h:803
const PO_NO_SUBROUTINE_DEFS
Disallows subroutine (function) definitions.
Definition: QC_Program.dox.h:783
const PO_FREE_OPTIONS
mask of options that have no effect on code access or code safety but just affect programming style ...
Definition: QC_Program.dox.h:660
nothing setParseOptions(softint opt=PO_DEFAULT)
Sets parse options in the parse option mask for the Program object.
const PO_NO_EXTERNAL_ACCESS
Prohibits any external access.
Definition: QC_Program.dox.h:709
any getGlobalVariable(string varname, *reference rexists)
Returns a the value of the global variable identified by the first string argument.
Program objects allow Qore programs to support subprograms with the option to restrict capabilities...
Definition: QC_Program.dox.h:29
const WARN_NONEXISTENT_METHOD_CALL
Indicates that the embedded code is calling an unknown method in a class.
Definition: QC_Program.dox.h:928
list getUserFunctionList()
Returns a list of strings of all user functions defined in the program object.
const PO_NO_NEW
Disallows use of the new operator.
Definition: QC_Program.dox.h:773
const PO_REQUIRE_PROTOTYPES
Requires all function and method parameters and return types to have type declarations.
Definition: QC_Program.dox.h:837
nothing replaceParseOptions(softint opt)
Replaces the parse options for the Program object.
const PO_ASSUME_LOCAL
Assume local variable scope when variables are first referenced if no my or our is present...
Definition: QC_Program.dox.h:654
const WARN_RETURN_VALUE_IGNORED
Enables a warning when a function or method call is made with no side effects and the return value is...
Definition: QC_Program.dox.h:932
any callFunctionArgs(string name, *softlist vargs)
Calls a function in the program object giving the arguments to the function as a list and returns the...
const True
logical True
Definition: qc_qore.dox.h:94
const PO_NO_GUI
Disallows access to functionality that draws graphics to the display.
Definition: QC_Program.dox.h:734
nothing setTimeZone(TimeZone zone)
Sets the default local time zone for the object.
const PO_NO_DATABASE
Disallows access to database functionality.
Definition: QC_Program.dox.h:701
nothing setTimeZoneUTCOffset(softint seconds_east)
Sets the default time zone for the Program object based on the number of seconds east of UTC; for zon...
const PO_NO_CHILD_PO_RESTRICTIONS
Allows child program objects to have fewer parse restrictions (i.e. more capabilies) than the parent ...
Definition: QC_Program.dox.h:686
copy()
Throws an exception to prevent objects of this class from being copied.
const False
logical False
Definition: qc_qore.dox.h:92
const WARN_INVALID_OPERATION
Indicates that the embedded code performs some operation that is guaranteed to produce no result (for...
Definition: QC_Program.dox.h:909
const WARN_CALL_WITH_TYPE_ERRORS
Enables warnings when the parser determines that the argument types of a function or method call are ...
Definition: QC_Program.dox.h:868
const PO_REQUIRE_OUR
Requires global variables to be declared with our before use.
Definition: QC_Program.dox.h:829
list list(...)
Returns a list of the arguments passed at the top level.
const WARN_ALL
Enables all warnings.
Definition: QC_Program.dox.h:864
const WARN_DEPRECATED
Enables a warning when deprecated code is used.
Definition: QC_Program.dox.h:885
const PO_NO_INHERIT_GLOBAL_VARS
Precludes global variables from being inherited into the new Program object.
Definition: QC_Program.dox.h:736
bool existsFunction(string name)
Checks if a user function exists in the program object.
any callFunction(string name,...)
Calls a function in the program object and returns the return value.
const PO_NO_CLASS_DEFS
Disallows class definitions.
Definition: QC_Program.dox.h:691
const PO_POSITIVE_OPTIONS
mask of all parse options allowing for more freedom (instead of less)
Definition: QC_Program.dox.h:824
nothing disableParseOptions(softint opt)
Removes the given parse options to the current parse option mask.
const PO_REQUIRE_TYPES
Requires all function and method parameters, return types, variables, and object members to have type...
Definition: QC_Program.dox.h:844
nothing lockOptions()
Locks parse options so that they cannot be changed.
const WARN_DUPLICATE_HASH_KEY
Enables a warning when an immediate hash is declared and at least one of the keys is repeated...
Definition: QC_Program.dox.h:897
nothing importFunction(string func)
Imports a function into the program object's space; any calls to the imported function will run with ...
The TimeZone class provides access to time zone functionality.
Definition: QC_TimeZone.dox.h:6
const PO_ALLOW_BARE_REFS
Prohibits the use of the '$' character in variable names, method calls, and object member references...
Definition: QC_Program.dox.h:648
const PO_NO_GLOBAL_VARS
Disallows the use of global variables.
Definition: QC_Program.dox.h:729
const PO_NO_THREADS
Prohibits access to all threading information.
Definition: QC_Program.dox.h:798
*string getScriptName()
Returns the current script name as a string or NOTHING if not set.
bool isDefined(string def)
Returns True if the given parse define is defined in the current Program (does not have to have a val...
const PO_NO_LOCALE_CONTROL
Disallows access to functionality that can change locale parameters.
Definition: QC_Program.dox.h:749
const PO_NO_FILESYSTEM
Disallows access to the filesystem.
Definition: QC_Program.dox.h:724
const WARN_NONE
Represents no warning.
Definition: QC_Program.dox.h:922
*hash parsePending(string code, string label, *softint warning_mask, *string source, *softint offset, softbool format_label=True)
Parses the text passed to pending lists in the Program object; does not resolve all references or com...
const WARN_DUPLICATE_LOCAL_VARS
Enables a warning when a local variable with the same name is declared in a subblock (ie another loca...
Definition: QC_Program.dox.h:901
const PO_NO_NAMESPACE_DEFS
Disallows new namespace definitions.
Definition: QC_Program.dox.h:759
const PO_NO_INHERIT_USER_FUNC_VARIANTS
Precludes public user function variants from being inherited into the new Program object...
Definition: QC_Program.dox.h:738
nothing setScriptPath(*string path)
Sets (or clears) the script path (directory and filename) for the object.
const PO_STRICT_BOOLEAN_EVAL
Sets strict mathematical boolean evaluation runtime mode (the qore default prior to v0...
Definition: QC_Program.dox.h:856
const PO_NO_SYSTEM_FUNC_VARIANTS
Prohibits builtin/system function variants from being imported into the new Program object...
Definition: QC_Program.dox.h:787
const PO_DEFAULT
This option is the empty option, meaning no options are set.
Definition: QC_Program.dox.h:656
any run()
Runs the program and optionally returns a value if the top-level code exits with a return statement...
const PO_NO_PROCESS_CONTROL
Disallows access to functions that would affect the current process (exit(), exec(), fork(), etc)
Definition: QC_Program.dox.h:778
nothing setTimeZoneRegion(string region)
Sets the default local time zone for the object from a path to a zoneinfo time zone region file...
const PO_NO_IO
Prohibits all terminal and file I/O and GUI operations.
Definition: QC_Program.dox.h:744
const PO_NO_CONSTANT_DEFS
Disallows constant definitions.
Definition: QC_Program.dox.h:696
nothing parseCommit()
Commits and pending code processed with Program::parsePending() to the Program object after resolving...
const PO_NO_SYSTEM_CLASSES
Prohibits system classes from being imported into the new Program object.
Definition: QC_Program.dox.h:785
const PO_STRICT_ARGS
Prohibits access to builtin functions and methods flagged with RT_NOOP and also causes errors to be r...
Definition: QC_Program.dox.h:850
const WARN_UNDECLARED_VAR
Indicates that the embedded code referenced an undeclared variable that will be assumed to be a globa...
Definition: QC_Program.dox.h:936
nothing parseRollback()
Rolls back any pending code processed with Program::parsePending() that has not yet been committed to...
const WARN_UNKNOWN_WARNING
Indicates that the embedded code tried to enable or disable an unknown warning.
Definition: QC_Program.dox.h:940
nothing undefine(string def)
Unsets a parse define for the current Program.
const PO_LOCKDOWN
Sets very restrictive access; this restriction is designed to allow code to only execute logic...
Definition: QC_Program.dox.h:670
nothing importClass(string cls)
Imports a class into the program object's space; any calls to the imported class's code will run with...
int getParseOptions()
Returns the current binary-or'ed parse option mask for the Program object.
const WARN_UNREFERENCED_VARIABLE
This warning is raised when a variable is declared in a block but never referenced.
Definition: QC_Program.dox.h:948
destructor()
Waits for all threads to finish executing, then deletes all global variables, dereferences the intern...
const PO_NO_EXTERNAL_PROCESS
Disallows any access to external processes (with system(), backquote(), exec(), etc) ...
Definition: QC_Program.dox.h:719
*string getScriptDir()
Returns the current script directory as a string or NOTHING if not set.
const PO_NO_NETWORK
Disallows access to network functionality.
Definition: QC_Program.dox.h:764
const PO_NO_TOP_LEVEL_STATEMENTS
Disallows top level code.
Definition: QC_Program.dox.h:818
const PO_NO_MODULES
Disallows loading modules with the %requires directive or at runtime with load_module() ...
Definition: QC_Program.dox.h:754
hash hash(object obj)
Returns a hash of an object's members.
const WARN_EXCESS_ARGS
Enables a warning when a function or method call is made with more arguments than are used by the fun...
Definition: QC_Program.dox.h:905
const PO_IN_MODULE
Only set by the system when in a user module Program.
Definition: QC_Program.dox.h:664
const WARN_MODULES
The default warning mask for user modules.
Definition: QC_Program.dox.h:920
const PO_NO_TERMINAL_IO
Disallows access to reading from and/or writing to the terminal.
Definition: QC_Program.dox.h:792
const WARN_WARNING_MASK_UNCHANGED
This warning means that the embedded code tried to change the warning mask, but it was locked...
Definition: QC_Program.dox.h:952
const PO_NO_EMBEDDED_LOGIC
Prohibits embedded logic from being used.
Definition: QC_Program.dox.h:703
const WARN_DEFAULT
The default warning mask.
Definition: QC_Program.dox.h:881
const PO_NO_EXTERNAL_INFO
Disallows access to functionality that provides information about the computing environment.
Definition: QC_Program.dox.h:714
constructor(softint po=PO_DEFAULT)
Creates the program object and optionally sets program capabilities (parse options) ...
nothing define(string def, any val)
Sets a parse define for the current Program.
*hash parse(string code, string label, *softint warning_mask, *string source, *softint offset, softbool format_label=True)
Parses the string argument and adds the code to the Program object.
const PO_NO_THREAD_CONTROL
Disallows access to any thread-control functions and thread-relevant statements and operators (for ex...
Definition: QC_Program.dox.h:808
any getDefine(string def)
Retrieves the value of the given parse define in the current Program.
const WARN_DUPLICATE_GLOBAL_VARS
Indicates that the embedded code has declared the same global variable more than once.
Definition: QC_Program.dox.h:893
const PO_NO_THREAD_INFO
Disallows access to functionality that provides information about threading.
Definition: QC_Program.dox.h:813
loadModule(string name)
Loads a Qore module into the Program object at run-time.