Qore Programming Language Reference Manual  0.9.4.5
QC_Program.dox.h
1 
3 namespace Qore {
5 
10  bool builtin;
12  int endline;
14  *string file;
16  int line;
18  int offset;
20  *string source;
21 };
22 }
23 
25 namespace Qore {
27 
56 class Program {
57 
58 public:
60 
78 auto callFunction(string name, ...);
79 
80 public:
82 
100 auto callFunctionArgs(string name, *softlist<auto> vargs);
101 
102 public:
104 
129  constructor(softint po = PO_DEFAULT);
130 
131 public:
133 
135  copy();
136 
137 public:
139 
147 nothing define(string def, auto val);
148 
149 public:
151 /***/
153 
154 public:
156 
171 nothing disableParseOptions(softint opt);
172 
173 public:
175 
190 bool existsFunction(string name);
191 
192 public:
194 
206 list<hash<auto>> findFunctionVariants(string function);
207 
208 public:
210 
224 *hash<auto> getAllDefines();
225 
226 public:
228 
254 code getCallReference(string identifier);
255 
256 public:
258 
272 auto getDefine(string def);
273 
274 public:
276 
281 Expression getExpression(string source, string label);
282 
283 public:
285 
296 auto getGlobalVariable(string varname, *reference<bool> rexists);
297 
298 public:
300 
314 hash<auto> getGlobalVars();
315 
316 public:
318 
331 
332 public:
334 
345 
346 public:
348 
356 
357 public:
359 
368 
369 public:
371 
383 *string getScriptDir();
384 
385 public:
387 
399 *string getScriptName();
400 
401 public:
403 
415 *string getScriptPath();
416 
417 public:
419 
431 list<int> getThreadList();
432 
433 public:
435 
446 
447 public:
449 
461 softlist<string> getUserFunctionList();
462 
463 public:
465 
492 nothing importClass(string cls, *string new_name, *softbool inject, int module_visibility = CSP_UNCHANGED);
493 
494 public:
496 
511 nothing importFunction(string func);
512 
513 public:
515 
542 nothing importFunction(string func, string new_name, *softbool inject);
543 
544 public:
546 
559 nothing importGlobalVariable(string varname, bool readonly = False);
560 
561 public:
563 
578 nothing importHashDecl(string name, *string new_name);
579 
580 public:
582 
594 
595 public:
597 
609 
610 public:
612 
624 
625 public:
627 
639 
640 public:
642 
654 
655 public:
657 
671 bool isDefined(string def);
672 
673 public:
675 
690 nothing issueModuleCmd(string module, string cmd);
691 
692 public:
694 
721  loadApplyToPrivateUserModule(string name, int warning_mask = WARN_MODULES);
722 
723 public:
725 
754 *hash<ExceptionInfo> loadApplyToPrivateUserModuleWarn(string name, int warning_mask = WARN_MODULES);
755 
756 public:
758 
789  loadApplyToUserModule(string name, *softbool reinject, int warning_mask = WARN_MODULES, bool reexport = False);
790 
791 public:
793 
826 *hash<ExceptionInfo> loadApplyToUserModuleWarn(string name, *softbool reinject, int warning_mask = WARN_MODULES, bool reexport = False);
827 
828 public:
830 
862  loadModule(string name, int warning_mask = WARN_MODULES);
863 
864 public:
866 
898 *hash<ExceptionInfo> loadModuleWarn(string name, int warning_mask = WARN_MODULES);
899 
900 public:
902 
936  loadUserModuleWithProgram(string name, Qore::Program pgm, int warning_mask = WARN_MODULES);
937 
938 public:
940 
974 *hash<ExceptionInfo> loadUserModuleWithProgramWarn(string name, Qore::Program pgm, int warning_mask = WARN_MODULES);
975 
976 public:
978 
983 nothing lockOptions();
984 
985 public:
987 
1031 *hash<ExceptionInfo> parse(string code, string label, *softint warning_mask, *string source, *softint offset, softbool format_label = True);
1032 
1033 public:
1035 
1058 nothing parseCommit();
1059 
1060 public:
1062 
1089 *hash<ExceptionInfo> parseCommit(int warning_mask);
1090 
1091 public:
1093 
1140 *hash<ExceptionInfo> parsePending(string code, string label, *softint warning_mask, *string source, *softint offset, softbool format_label = True);
1141 
1142 public:
1144 
1157 nothing parseRollback();
1158 
1159 public:
1161 
1175 nothing replaceParseOptions(softint opt);
1176 
1177 public:
1179 
1186 auto run();
1187 
1188 public:
1190 
1206 nothing setGlobalVarValue(string name, auto value);
1207 
1208 public:
1210 
1225 nothing setParseOptions(softint opt = PO_DEFAULT);
1226 
1227 public:
1229 
1236 nothing setScriptPath(*string path);
1237 
1238 public:
1240 
1260 bool setThreadInit(*code init);
1261 
1262 public:
1264 
1272 nothing setTimeZone(TimeZone zone);
1273 
1274 public:
1276 
1287 nothing setTimeZoneRegion(string region);
1288 
1289 public:
1291 
1309 nothing setTimeZoneUTCOffset(softint seconds_east);
1310 
1311 public:
1313 
1320 nothing undefine(string def);
1321 };
1329  const CSP_SETPRIV = CSP_SETPRIV;
1343 
1348  const DOM_DATABASE = QDOM_DATABASE;
1350 
1352  const DOM_DEBUGGER = QDOM_DEBUGGER;
1354 
1356  const DOM_EMBEDDED_LOGIC = QDOM_EMBEDDED_LOGIC;
1358 
1362  const DOM_EXTERNAL_INFO = QDOM_EXTERNAL_INFO;
1364 
1368  const DOM_EXTERNAL_PROCESS = QDOM_EXTERNAL_PROCESS;
1370 
1374  const DOM_FILESYSTEM = QDOM_FILESYSTEM;
1376 
1380  const DOM_GUI = QDOM_GUI;
1382 
1384  const DOM_INJECTION = QDOM_INJECTION;
1386 
1390  const DOM_LOCALE_CONTROL = QDOM_LOCALE_CONTROL;
1392 
1396  const DOM_MODULE = QDOM_MODULES;
1398 
1402  const DOM_NETWORK = QDOM_NETWORK;
1404 
1408  const DOM_PROCESS_CONTROL = QDOM_PROCESS;
1410 
1412  const DOM_REFLECTION = QDOM_REFLECTION;
1414 
1418  const DOM_TERMINAL_IO = QDOM_TERMINAL_IO;
1420 
1424  const DOM_THREAD_CLASS = QDOM_THREAD_CLASS;
1426 
1430  const DOM_THREAD_CONTROL = QDOM_THREAD_CONTROL;
1432 
1436  const DOM_THREAD_INFO = QDOM_THREAD_INFO;
1438 
1442  const DOM_UNCONTROLLED_API = QDOM_UNCONTROLLED_API;
1449 
1454  const DomainCodeMap = qore(pomaps.getDomainToStringMap());
1456 
1460  const DomainStringMap = qore(pomaps.getStringToDomainMap());
1462 
1468 
1473 
1481 
1487 
1492 
1498 
1504 
1510 
1516 
1522 
1528 
1534 
1540 
1546 
1554 
1558 
1562 
1568 
1573 
1579 
1594 
1599 
1604 
1609 
1614 
1622 
1628 
1633 
1638 
1643 
1648 
1655 
1661 
1667 
1673 
1677 
1683 
1691 
1695 
1701 
1706 
1711 
1716 
1721 
1730 
1735 
1740 
1745 
1755 
1760 
1765 
1770 
1776 
1781 
1786 
1791 
1796 
1801 
1807 
1817 
1822 
1828 
1833 
1841 
1848 
1854 
1860 
1866 
1872 
1876  const ParseOptionCmdCodeMap = qore(ParseOptionMap::getCodeToStringMap());
1878 
1882  const ParseOptionCmdStringMap = qore(ParseOptionMap::getStringToCodeMap());
1884 
1888  const ParseOptionCodeMap = qore(pomaps.getCodeToStringMap());
1890 
1894  const ParseOptionStringMap = qore(pomaps.getStringToCodeMap());
1901  const WARN_ALL = QP_WARN_ALL;
1904 
1908  const WARN_BROKEN_LOGIC_PRECEDENCE = QP_WARN_BROKEN_LOGIC_PRECEDENCE;
1910 
1912  const WARN_CALL_WITH_TYPE_ERRORS = QP_WARN_CALL_WITH_TYPE_ERRORS;
1914 
1926  const WARN_DEFAULT = QP_WARN_DEFAULT;
1928 
1930  const WARN_DEPRECATED = QP_WARN_DEPRECATED;
1932 
1934  const WARN_DUPLICATE_BLOCK_VARS = QP_WARN_DUPLICATE_BLOCK_VARS;
1936 
1938  const WARN_DUPLICATE_GLOBAL_VARS = QP_WARN_DUPLICATE_GLOBAL_VARS;
1940 
1942  const WARN_DUPLICATE_HASH_KEY = QP_WARN_DUPLICATE_HASH_KEY;
1944 
1946  const WARN_DUPLICATE_LOCAL_VARS = QP_WARN_DUPLICATE_LOCAL_VARS;
1948 
1950  const WARN_EXCESS_ARGS = QP_WARN_EXCESS_ARGS;
1952 
1954  const WARN_INVALID_OPERATION = QP_WARN_INVALID_OPERATION;
1956 
1966  const WARN_MODULES = QP_WARN_MODULES;
1968  const WARN_NONE = QP_WARN_NONE;
1970 
1974  const WARN_NONEXISTENT_METHOD_CALL = QP_WARN_NONEXISTENT_METHOD_CALL;
1976 
1978  const WARN_RETURN_VALUE_IGNORED = QP_WARN_RETURN_VALUE_IGNORED;
1980 
1982  const WARN_UNDECLARED_VAR = QP_WARN_UNDECLARED_VAR;
1984 
1986  const WARN_UNKNOWN_WARNING = QP_WARN_UNKNOWN_WARNING;
1988 
1990  const WARN_UNREACHABLE_CODE = QP_WARN_UNREACHABLE_CODE;
1992 
1994  const WARN_UNREFERENCED_VARIABLE = QP_WARN_UNREFERENCED_VARIABLE;
1996 
1998  const WARN_WARNING_MASK_UNCHANGED = QP_WARN_WARNING_MASK_UNCHANGED;
2000 }
Qore::PO_NO_INHERIT_SYSTEM_FUNC_VARIANTS
const PO_NO_INHERIT_SYSTEM_FUNC_VARIANTS
Prohibits builtin/system function variants from being imported into the new Program object.
Definition: QC_Program.dox.h:1671
Qore::PO_NO_SUBROUTINE_DEFS
const PO_NO_SUBROUTINE_DEFS
Disallows subroutine (function) definitions.
Definition: QC_Program.dox.h:1743
Qore::PO_NO_REFLECTION
const PO_NO_REFLECTION
Disallows access to reflection.
Definition: QC_Program.dox.h:1738
Qore::Program::getExpression
Expression getExpression(string source, string label)
returns an expression object for the given source code
Qore::PO_BROKEN_CAST
const PO_BROKEN_CAST
Allows for old pre-Qore 0.9.4 broken cast<> operator behavior where NOTHING was silently accepted.
Definition: QC_Program.dox.h:1508
Qore::PO_FREE_OPTIONS
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:1556
Qore::DomainCodeMap
const DomainCodeMap
Maps from functional domain bitfield code values (as string keys) to functional domain names.
Definition: QC_Program.dox.h:1454
Qore::Program::importHashDecl
nothing importHashDecl(string name, *string new_name)
Imports a typed hash declaration into the program object's space.
Qore::Program::callFunction
auto callFunction(string name,...)
Calls a function in the program object and returns the return value.
Qore::PO_STRONG_ENCAPSULATION
const PO_STRONG_ENCAPSULATION
disallows out-of-line class and namespace declarations
Definition: QC_Program.dox.h:1870
Qore::Program::getScriptPath
*string getScriptPath()
Returns the current script directory and filename if known, otherwise returns NOTHING.
Qore::PO_NO_THREAD_INFO
const PO_NO_THREAD_INFO
Disallows access to functionality that provides information about threading.
Definition: QC_Program.dox.h:1789
Qore::Program::importGlobalVariable
nothing importGlobalVariable(string varname, bool readonly=False)
Imports a global variable into the program object's space.
Qore::DOM_INJECTION
const DOM_INJECTION
provides functionality related to code / dependency injection
Definition: QC_Program.dox.h:1384
Qore::ParseOptionCmdStringMap
const ParseOptionCmdStringMap
Maps from parse option strings to parse option integer codes. Names are in form used in script or on ...
Definition: QC_Program.dox.h:1882
Qore::PO_NO_EXTERNAL_ACCESS
const PO_NO_EXTERNAL_ACCESS
Prohibits any external access.
Definition: QC_Program.dox.h:1626
Qore::DomainStringMap
const DomainStringMap
Maps from functional domain strings to functional domain bitfield integer codes.
Definition: QC_Program.dox.h:1460
Qore::SourceLocationInfo
source location information
Definition: QC_Program.dox.h:8
Qore::SourceLocationInfo::file
*string file
the file name or parse label for the code
Definition: QC_Program.dox.h:14
Qore::SourceLocationInfo::source
*string source
the source object or file name tag (used when multiple source objects are defined from the same sourc...
Definition: QC_Program.dox.h:20
Qore::SourceLocationInfo::builtin
bool builtin
if True then the code is builtin and there is no user source location
Definition: QC_Program.dox.h:10
Qore::WARN_DUPLICATE_HASH_KEY
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:1942
Qore::Program::getTimeZone
TimeZone getTimeZone()
Returns the default local time zone for the object.
Qore::PO_NO_NEW
const PO_NO_NEW
Disallows use of the new operator.
Definition: QC_Program.dox.h:1728
Qore::CSP_UNCHANGED
const CSP_UNCHANGED
Imports the object with the same module visibility.
Definition: QC_Program.dox.h:1334
Qore::PO_NO_THREAD_CLASSES
const PO_NO_THREAD_CLASSES
Disallows access to any thread classes.
Definition: QC_Program.dox.h:1779
Qore::DOM_THREAD_INFO
const DOM_THREAD_INFO
provides access to information regarding threading (tid, active threads, etc)
Definition: QC_Program.dox.h:1436
Qore::Program::getAllDefines
*hash< auto > getAllDefines()
Retrieves all parse defines in the current Program.
Qore::PO_ASSUME_LOCAL
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:1502
Qore::Program::getCallReference
code getCallReference(string identifier)
resolve the string as a call reference in the given Program
Qore::DOM_UNCONTROLLED_API
const DOM_UNCONTROLLED_API
provides unchecked access to system functionality that could bypass Qore's sandboxing controls
Definition: QC_Program.dox.h:1442
Qore::Program::replaceParseOptions
nothing replaceParseOptions(softint opt)
Replaces the parse options for the Program object.
Qore::Program::getProgram
ProgramControl getProgram()
Get ProgramControl.
Qore::Program::setParseOptions
nothing setParseOptions(softint opt=PO_DEFAULT)
Sets parse options in the parse option mask for the Program object.
Qore::WARN_DEPRECATED
const WARN_DEPRECATED
Enables a warning when deprecated code is used.
Definition: QC_Program.dox.h:1930
Qore::Expression
Expression objects represent a single executable expression.
Definition: QC_Expression.dox.h:7
Qore::PO_NO_GUI
const PO_NO_GUI
Disallows access to functionality that draws graphics to the display.
Definition: QC_Program.dox.h:1651
Qore::WARN_BROKEN_LOGIC_PRECEDENCE
const WARN_BROKEN_LOGIC_PRECEDENCE
This warns before expressions affected by %broken-logic-precedence.
Definition: QC_Program.dox.h:1908
Qore::PO_REQUIRE_PROTOTYPES
const PO_REQUIRE_PROTOTYPES
Requires all function and method parameters and return types to have type declarations.
Definition: QC_Program.dox.h:1839
Qore::ParseOptionCmdCodeMap
const ParseOptionCmdCodeMap
Maps from parse option code values (as string keys) to parse option names. Names are in form used in ...
Definition: QC_Program.dox.h:1876
Qore::Program::loadApplyToPrivateUserModule
loadApplyToPrivateUserModule(string name, int warning_mask=WARN_MODULES)
Loads a Qore user module privately into the given Program container at run-time; after this call the ...
Qore::PO_NO_SYSTEM_API
const PO_NO_SYSTEM_API
Prohibits any code from being inherited into the Program object, including the system API.
Definition: QC_Program.dox.h:1753
Qore::DOM_DEBUGGER
const DOM_DEBUGGER
provides debugging functionality
Definition: QC_Program.dox.h:1352
Qore::Program::getProgramId
int getProgramId()
Get program id.
Qore::PO_ALLOW_RETURNS
const PO_ALLOW_RETURNS
Allows the use of the deprecated returns keyword.
Definition: QC_Program.dox.h:1485
Qore::DOM_FILESYSTEM
const DOM_FILESYSTEM
provides access to the filesystem
Definition: QC_Program.dox.h:1374
Qore::Program::importFunction
nothing importFunction(string func, string new_name, *softbool inject)
Imports a function into the program object's space and gives it a new name; any calls to the imported...
Qore::PO_NO_CHILD_PO_RESTRICTIONS
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:1597
Qore::PO_NO_USER_API
const PO_NO_USER_API
Prohibits any user code from being inherited into the Program object.
Definition: QC_Program.dox.h:1815
Qore::WARN_DEFAULT
const WARN_DEFAULT
The default warning mask.
Definition: QC_Program.dox.h:1926
Qore::PO_ALLOW_WEAK_REFERENCES
const PO_ALLOW_WEAK_REFERENCES
Allows the use of the weak assignment operator (:=).
Definition: QC_Program.dox.h:1496
Qore::WARN_UNDECLARED_VAR
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:1982
Qore::Program::setTimeZone
nothing setTimeZone(TimeZone zone)
Sets the default local time zone for the object.
Qore::DOM_REFLECTION
const DOM_REFLECTION
provides reflection functionality
Definition: QC_Program.dox.h:1412
Qore::PO_NO_UNCONTROLLED_APIS
const PO_NO_UNCONTROLLED_APIS
disallow access to "uncontrolled APIs" like external language bindings or direct generic system call ...
Definition: QC_Program.dox.h:1805
Qore::DOM_THREAD_CLASS
const DOM_THREAD_CLASS
provides thread control functionality
Definition: QC_Program.dox.h:1424
Qore::DOM_DATABASE
const DOM_DATABASE
provides access to databases
Definition: QC_Program.dox.h:1348
Qore::True
const True
logical True
Definition: qc_qore.dox.h:98
Qore::PO_BROKEN_LIST_PARSING
const PO_BROKEN_LIST_PARSING
allows for old pre-Qore 0.8.12 broken list rewriting in the parser
Definition: QC_Program.dox.h:1520
Qore::PO_NO_DATABASE
const PO_NO_DATABASE
Disallows access to database functionality.
Definition: QC_Program.dox.h:1612
Qore::CSP_SETPUB
const CSP_SETPUB
Imports the object with public visibility.
Definition: QC_Program.dox.h:1332
Qore::PO_NO_INHERIT_GLOBAL_VARS
const PO_NO_INHERIT_GLOBAL_VARS
Precludes global variables from being inherited into the new Program object.
Definition: QC_Program.dox.h:1653
Qore::WARN_INVALID_OPERATION
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:1954
Qore::WARN_DUPLICATE_GLOBAL_VARS
const WARN_DUPLICATE_GLOBAL_VARS
Indicates that the embedded code has declared the same global variable more than once.
Definition: QC_Program.dox.h:1938
Qore::Program::setTimeZoneUTCOffset
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...
Qore::Program::getThreadList
list< int > getThreadList()
returns a list of thread IDs active in this Program
Qore::WARN_WARNING_MASK_UNCHANGED
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:1998
Qore::Program::existsFunction
bool existsFunction(string name)
Checks if a user function exists in the program object.
Qore::PO_POSITIVE_OPTIONS
const PO_POSITIVE_OPTIONS
mask of all parse options allowing for more freedom (instead of less)
Definition: QC_Program.dox.h:1826
Qore::Program::issueModuleCmd
nothing issueModuleCmd(string module, string cmd)
issues a module command for the given module; the module is loaded into the current Program object if...
Qore::DOM_TERMINAL_IO
const DOM_TERMINAL_IO
provides terminal I/O functionality
Definition: QC_Program.dox.h:1418
Qore::PO_REQUIRE_TYPES
const PO_REQUIRE_TYPES
Requires all function and method parameters, return types, variables, and object members to have type...
Definition: QC_Program.dox.h:1846
Qore::DOM_PROCESS_CONTROL
const DOM_PROCESS_CONTROL
provides process control functionality (can affect or stop the current process)
Definition: QC_Program.dox.h:1408
Qore::Program::lockOptions
nothing lockOptions()
Locks parse options so that they cannot be changed.
Qore::Program::copy
copy()
Throws an exception to prevent objects of this class from being copied.
Qore::WARN_NONEXISTENT_METHOD_CALL
const WARN_NONEXISTENT_METHOD_CALL
Indicates that the embedded code is calling an unknown method in a class.
Definition: QC_Program.dox.h:1974
Qore::Program::importClass
nothing importClass(string cls, *string new_name, *softbool inject, int module_visibility=CSP_UNCHANGED)
Imports a class into the program object's space; any calls to the imported class's code will run with...
Qore::PO_BROKEN_OPERATORS
const PO_BROKEN_OPERATORS
allows for old pre-Qore 0.8.12 broken runtime parsing of multi-character operators with spaces
Definition: QC_Program.dox.h:1538
Qore::WARN_RETURN_VALUE_IGNORED
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:1978
Qore::PO_NO_INHERIT_SYSTEM_CLASSES
const PO_NO_INHERIT_SYSTEM_CLASSES
Prohibits system classes from being imported into the new Program object.
Definition: QC_Program.dox.h:1659
Qore::Program::parsePending
*hash< ExceptionInfo > 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...
Qore::CSP_SETPRIV
const CSP_SETPRIV
Imports the object with private visibility.
Definition: QC_Program.dox.h:1330
Qore::PO_ALLOW_BARE_REFS
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:1466
Qore::ProgramControl
The ProgramControl class provides safe information about a Qore program.
Definition: QC_ProgramControl.dox.h:45
Qore::PO_REQUIRE_OUR
const PO_REQUIRE_OUR
Requires global variables to be declared with our before use.
Definition: QC_Program.dox.h:1831
Qore::Program::getGlobalVariable
auto getGlobalVariable(string varname, *reference< bool > rexists)
Returns a the value of the global variable identified by the first string argument.
Qore::SourceLocationInfo::line
int line
the starting source line number
Definition: QC_Program.dox.h:16
Qore::Program::callFunctionArgs
auto callFunctionArgs(string name, *softlist< auto > vargs)
Calls a function in the program object giving the arguments to the function as a list and returns the...
Qore::PO_NO_INHERIT_USER_CLASSES
const PO_NO_INHERIT_USER_CLASSES
Prohibits user classes from being imported into the new Program object.
Definition: QC_Program.dox.h:1681
Qore::WARN_EXCESS_ARGS
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:1950
Qore::Program::setThreadInit
bool setThreadInit(*code init)
Sets a call reference or closure to run every time a new thread is started.
Qore::Program::isDefined
bool isDefined(string def)
Returns True if the given parse define is defined in the current Program (does not have to have a val...
Qore::PO_NO_LOCALE_CONTROL
const PO_NO_LOCALE_CONTROL
Disallows access to functionality that can change locale parameters.
Definition: QC_Program.dox.h:1704
Qore::Program::getUserFunctionList
softlist< string > getUserFunctionList()
Returns a list of strings of all user functions defined in the program object.
Qore::Program::loadUserModuleWithProgramWarn
*hash< ExceptionInfo > loadUserModuleWithProgramWarn(string name, Qore::Program pgm, int warning_mask=WARN_MODULES)
Loads a Qore user module into the Program object at run-time using the given Program object as the co...
Qore::DOM_GUI
const DOM_GUI
provides GUI functionality
Definition: QC_Program.dox.h:1380
Qore::PO_NO_CLASS_DEFS
const PO_NO_CLASS_DEFS
Disallows class definitions.
Definition: QC_Program.dox.h:1602
Qore::PO_NO_FILESYSTEM
const PO_NO_FILESYSTEM
Disallows access to the filesystem.
Definition: QC_Program.dox.h:1641
Qore::WARN_NONE
const WARN_NONE
Represents no warning.
Definition: QC_Program.dox.h:1968
Qore::Program::loadUserModuleWithProgram
loadUserModuleWithProgram(string name, Qore::Program pgm, int warning_mask=WARN_MODULES)
Loads a Qore user module into the Program object at run-time using the given Program object as the co...
Qore::Program::disableParseOptions
nothing disableParseOptions(softint opt)
Removes the given parse options to the current parse option mask.
Qore::PO_NO_INHERIT_SYSTEM_HASHDECLS
const PO_NO_INHERIT_SYSTEM_HASHDECLS
Prohibits system hashdecls from being imported into the new Program object.
Definition: QC_Program.dox.h:1675
Qore::PO_NO_API
const PO_NO_API
Prohibits any code from being inherited into the Program object, including the system API.
Definition: QC_Program.dox.h:1592
Qore::PO_NO_GLOBAL_VARS
const PO_NO_GLOBAL_VARS
Disallows the use of global variables.
Definition: QC_Program.dox.h:1646
Qore::Program::importFunction
nothing importFunction(string func)
Imports a function into the program object's space; any calls to the imported function will run with ...
Qore::PO_NO_NAMESPACE_DEFS
const PO_NO_NAMESPACE_DEFS
Disallows new namespace definitions.
Definition: QC_Program.dox.h:1714
Qore::PO_NO_THREADS
const PO_NO_THREADS
Prohibits access to all threading information.
Definition: QC_Program.dox.h:1774
Qore::Program::getScriptName
*string getScriptName()
Returns the current script name as a string or NOTHING if not set.
Qore::WARN_CALL_WITH_TYPE_ERRORS
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:1912
Qore::Program::setScriptPath
nothing setScriptPath(*string path)
Sets (or clears) the script path (directory and filename) for the object.
Qore::Program::setGlobalVarValue
nothing setGlobalVarValue(string name, auto value)
set the value of a global variable
Qore::PO_NO_SYSTEM_FUNC_VARIANTS
const PO_NO_SYSTEM_FUNC_VARIANTS
Prohibits builtin/system function variants from being imported into the new Program object.
Definition: QC_Program.dox.h:1763
Qore::PO_DEFAULT
const PO_DEFAULT
This option is the empty option, meaning no options are set.
Definition: QC_Program.dox.h:1552
Qore::TimeZone
The TimeZone class provides access to time zone functionality.
Definition: QC_TimeZone.dox.h:11
Qore::PO_BROKEN_LOGIC_PRECEDENCE
const PO_BROKEN_LOGIC_PRECEDENCE
allows for old pre-Qore 0.8.12 precedence of logical and bitwise operators
Definition: QC_Program.dox.h:1526
Qore::PO_NO_PROCESS_CONTROL
const PO_NO_PROCESS_CONTROL
Disallows access to functions that would affect the current process (exit(), exec(),...
Definition: QC_Program.dox.h:1733
Qore::Program::run
auto run()
Runs the program and optionally returns a value if the top-level code exits with a return statement.
Qore::PO_NO_IO
const PO_NO_IO
Prohibits all terminal and file I/O and GUI operations.
Definition: QC_Program.dox.h:1699
Qore::PO_NO_CONSTANT_DEFS
const PO_NO_CONSTANT_DEFS
Disallows constant definitions.
Definition: QC_Program.dox.h:1607
Qore::Program::findFunctionVariants
list< hash< auto > > findFunctionVariants(string function)
finds all variants of a function or class method and returns a list of the results
Qore::PO_NO_SYSTEM_CLASSES
const PO_NO_SYSTEM_CLASSES
Prohibits system classes from being imported into the new Program object.
Definition: QC_Program.dox.h:1758
Qore::Program::define
nothing define(string def, auto val)
Sets a parse define for the current Program.
Qore::Program::setTimeZoneRegion
nothing setTimeZoneRegion(string region)
Sets the default local time zone for the object from a path to a zoneinfo time zone region file.
Qore::Program::loadApplyToPrivateUserModuleWarn
*hash< ExceptionInfo > loadApplyToPrivateUserModuleWarn(string name, int warning_mask=WARN_MODULES)
Loads a Qore user module privately into the given Program container at run-time; after this call the ...
Qore::PO_NO_TRANSIENT
const PO_NO_TRANSIENT
Disallows the transient.
Definition: QC_Program.dox.h:1799
Qore::DOM_LOCALE_CONTROL
const DOM_LOCALE_CONTROL
provides access to functionality that changes locale information
Definition: QC_Program.dox.h:1390
Qore::PO_NO_INHERIT_USER_FUNC_VARIANTS
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:1689
Qore::PO_STRICT_BOOLEAN_EVAL
const PO_STRICT_BOOLEAN_EVAL
Sets strict mathematical boolean evaluation runtime mode (the qore default prior to v0....
Definition: QC_Program.dox.h:1858
Qore::PO_LOCKDOWN
const PO_LOCKDOWN
Sets very restrictive access; this restriction is designed to allow code to only execute logic,...
Definition: QC_Program.dox.h:1566
Qore::SourceLocationInfo::endline
int endline
the ending source line number
Definition: QC_Program.dox.h:12
Qore::WARN_MODULES
const WARN_MODULES
The default warning mask for user modules.
Definition: QC_Program.dox.h:1966
Qore::PO_BROKEN_SPRINTF
const PO_BROKEN_SPRINTF
Enables broken sprintf() handling where no argument is treated diffferently than NOTHING.
Definition: QC_Program.dox.h:1550
Qore::Program::getParseOptions
int getParseOptions()
Returns the current binary-or'ed parse option mask for the Program object.
Qore::Program::parseRollback
nothing parseRollback()
Removes all partially or fully-parsed code from the object along with other builtin objects; a Progra...
Qore::PO_NO_INHERIT_SYSTEM_CONSTANTS
const PO_NO_INHERIT_SYSTEM_CONSTANTS
Prohibits system constants from being imported into the new Program object.
Definition: QC_Program.dox.h:1665
Qore::DOM_EXTERNAL_PROCESS
const DOM_EXTERNAL_PROCESS
provides external process control functionality (can affect) start) or stop external processes)
Definition: QC_Program.dox.h:1368
Qore::Program::getGlobalVars
hash< auto > getGlobalVars()
returns a hash of global variables
Qore::PO_STRICT_ARGS
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:1852
Qore::Program::parseCommit
nothing parseCommit()
Commits and pending code processed with Program::parsePending() to the Program object after resolving...
Qore::Program::destructor
destructor()
Waits for all threads to finish executing, then deletes all global variables, dereferences the intern...
Qore::Program
Program objects allow Qore programs to support subprograms with the option to restrict capabilities,...
Definition: QC_Program.dox.h:56
Qore::Program::parse
*hash< ExceptionInfo > 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.
Qore::DOM_EXTERNAL_INFO
const DOM_EXTERNAL_INFO
provides access to external information (ex: hostname, pid, process uid, etc)
Definition: QC_Program.dox.h:1362
Qore::False
const False
logical False
Definition: qc_qore.dox.h:96
Qore::PO_STRICT_TYPES
const PO_STRICT_TYPES
Sets strict type checking and automatically sets default values for lvalues with type restrictions fo...
Definition: QC_Program.dox.h:1864
Qore::PO_NO_NETWORK
const PO_NO_NETWORK
Disallows access to network functionality.
Definition: QC_Program.dox.h:1719
Qore::WARN_ALL
const WARN_ALL
Enables all warnings.
Definition: QC_Program.dox.h:1902
Qore::WARN_UNREACHABLE_CODE
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:1990
Qore::PO_NO_INHERIT_USER_CONSTANTS
const PO_NO_INHERIT_USER_CONSTANTS
Prohibits user constants from being imported into the new Program object.
Definition: QC_Program.dox.h:1687
Qore::PO_NO_TOP_LEVEL_STATEMENTS
const PO_NO_TOP_LEVEL_STATEMENTS
Disallows top level code.
Definition: QC_Program.dox.h:1794
Qore::WARN_UNKNOWN_WARNING
const WARN_UNKNOWN_WARNING
Indicates that the embedded code tried to enable or disable an unknown warning.
Definition: QC_Program.dox.h:1986
Qore::Program::importSystemHashDecls
importSystemHashDecls()
imports system hashdecls into a Program container at runtime; will throw an exception if the Program ...
Qore::Program::undefine
nothing undefine(string def)
Unsets a parse define for the current Program.
Qore::WARN_UNREFERENCED_VARIABLE
const WARN_UNREFERENCED_VARIABLE
This warning is raised when a variable is declared in a block but never referenced.
Definition: QC_Program.dox.h:1994
Qore::Program::loadApplyToUserModuleWarn
*hash< ExceptionInfo > loadApplyToUserModuleWarn(string name, *softbool reinject, int warning_mask=WARN_MODULES, bool reexport=False)
Loads a Qore user module into the given Program container at run-time; after this call the Program ob...
Qore::Program::importSystemConstants
importSystemConstants()
imports system constants into a Program container at runtime; will throw an exception if the Program ...
Qore::Program::importSystemApi
importSystemApi()
imports system classes and functions into a Program container at runtime; will throw an exception if ...
Qore::Program::loadApplyToUserModule
loadApplyToUserModule(string name, *softbool reinject, int warning_mask=WARN_MODULES, bool reexport=False)
Loads a Qore user module into the given Program container at run-time; after this call the Program ob...
Qore::PO_NO_DEBUGGING
const PO_NO_DEBUGGING
Forbids debugging of the current Program object; when this option is set, debuggers cannot attach to ...
Definition: QC_Program.dox.h:1618
Qore::WARN_DUPLICATE_BLOCK_VARS
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:1934
Qore::Program::getDefine
auto getDefine(string def)
Retrieves the value of the given parse define in the current Program.
Qore::ParseOptionCodeMap
const ParseOptionCodeMap
Maps from parse option code values (as string keys) to parse option names.
Definition: QC_Program.dox.h:1888
Qore::Program::getScriptDir
*string getScriptDir()
Returns the current script directory as a string or NOTHING if not set.
Qore::PO_NO_EXTERNAL_PROCESS
const PO_NO_EXTERNAL_PROCESS
Disallows any access to external processes (with system(), backquote(), exec(), etc)
Definition: QC_Program.dox.h:1636
Qore::DOM_MODULE
const DOM_MODULE
provides access to external modules
Definition: QC_Program.dox.h:1396
Qore::PO_NO_MODULES
const PO_NO_MODULES
Disallows loading modules with the %requires directive or at runtime with load_module()
Definition: QC_Program.dox.h:1709
Qore::Program::getParseOptionStringList
list< string > getParseOptionStringList()
returns a list of parse option strings for the program object
Qore::PO_NO_INHERIT_USER_HASHDECLS
const PO_NO_INHERIT_USER_HASHDECLS
Prohibits user hashdecls from being imported into the new Program object.
Definition: QC_Program.dox.h:1693
Qore::DOM_NETWORK
const DOM_NETWORK
provides network functionality
Definition: QC_Program.dox.h:1402
Qore::PO_ALLOW_STATEMENT_NO_EFFECT
const PO_ALLOW_STATEMENT_NO_EFFECT
Allows for old pre-Qore 0.9 top-level statements having no effect.
Definition: QC_Program.dox.h:1490
Qore::Program::loadModule
loadModule(string name, int warning_mask=WARN_MODULES)
Loads a Qore module into the Program object at run-time.
Qore::Program::importSystemFunctions
importSystemFunctions()
imports system functions into a Program container at runtime; will throw an exception if the Program ...
Qore::ParseOptionStringMap
const ParseOptionStringMap
Maps from parse option strings to parse option bitfield integer codes.
Definition: QC_Program.dox.h:1894
Qore::PO_ALLOW_DEBUGGER
const PO_ALLOW_DEBUGGER
Allows the use of functionality required to implement a debugger, mainly via DebugProgram.
Definition: QC_Program.dox.h:1471
Qore::Program::constructor
constructor(softint po=PO_DEFAULT)
Creates the program object and optionally sets program capabilities (parse options)
Qore::PO_ALLOW_INJECTION
const PO_ALLOW_INJECTION
Allows code/dependency injections in the contained Program object.
Definition: QC_Program.dox.h:1479
Qore::PO_NO_EXTERNAL_INFO
const PO_NO_EXTERNAL_INFO
Disallows access to functionality that provides information about the computing environment.
Definition: QC_Program.dox.h:1631
Qore::DOM_EMBEDDED_LOGIC
const DOM_EMBEDDED_LOGIC
provides dynamic parsing functionality
Definition: QC_Program.dox.h:1356
Qore::SourceLocationInfo::offset
int offset
the offset line in the source (for when multiple source objects are defined from the same source)
Definition: QC_Program.dox.h:18
Qore
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3
Qore::PO_NO_THREAD_CONTROL
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:1784
Qore::PO_BROKEN_INT_ASSIGNMENTS
const PO_BROKEN_INT_ASSIGNMENTS
allows for old pre-Qore 0.8.12 broken runtime int assignments where runtime type errors were ignored
Definition: QC_Program.dox.h:1514
Qore::WARN_DUPLICATE_LOCAL_VARS
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:1946
Qore::PO_BROKEN_REFERENCES
const PO_BROKEN_REFERENCES
allows for old pre-Qore 0.8.13 handling of reference and *reference
Definition: QC_Program.dox.h:1544
Qore::PO_NEW_STYLE
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:1577
Qore::PO_NO_USER_CLASSES
const PO_NO_USER_CLASSES
Prohibits user classes from being imported into the new Program object.
Definition: QC_Program.dox.h:1820
Qore::PO_BROKEN_LOOP_STATEMENT
const PO_BROKEN_LOOP_STATEMENT
allows for old pre-Qore 0.8.13 handling of break and continue
Definition: QC_Program.dox.h:1532
Qore::PO_IN_MODULE
const PO_IN_MODULE
Only set by the system when in a user module Program.
Definition: QC_Program.dox.h:1560
Qore::Program::loadModuleWarn
*hash< ExceptionInfo > loadModuleWarn(string name, int warning_mask=WARN_MODULES)
Loads a Qore module into the Program object at run-time.
Qore::PO_NO_TERMINAL_IO
const PO_NO_TERMINAL_IO
Disallows access to reading from and/or writing to the terminal.
Definition: QC_Program.dox.h:1768
Qore::PO_LOCK_WARNINGS
const PO_LOCK_WARNINGS
Disallows changes to the warning mask.
Definition: QC_Program.dox.h:1571
Qore::PO_NO_EMBEDDED_LOGIC
const PO_NO_EMBEDDED_LOGIC
Prohibits embedded logic from being used.
Definition: QC_Program.dox.h:1620
Qore::DOM_THREAD_CONTROL
const DOM_THREAD_CONTROL
provides the ability to check or manipulate threads (including starting new threads)
Definition: QC_Program.dox.h:1430
Qore::Program::importSystemClasses
importSystemClasses()
imports system classes into a Program container at runtime; will throw an exception if the Program wa...
Qore::Program::parseCommit
*hash< ExceptionInfo > parseCommit(int warning_mask)
Commits and pending code processed with Program::parsePending() to the Program object after resolving...