Qore Programming Language Reference Manual  0.8.9
 All Classes Namespaces Functions Variables Groups Pages
ql_misc.dox.h
1 
3 namespace Qore {
8 
10 
27 nothing remove_signal_handler(softint signal);
28 
30 
50 nothing set_signal_handler(softint signal, code f);
51 
53 };
54 
56 namespace Qore {
61 
63 
85 string backquote(string cmd, *reference rc);
86 
88 
95 nothing backquote();
96 
98 
115 any call_builtin_function(string name, ...);
116 
118 
135 any call_builtin_function_args(string name, *softlist vargs);
136 
138 
153 any call_function(string name, ...);
154 
156 
166 any call_function(code f, ...);
167 
169 
184 any call_function_args(string name, *softlist vargs);
185 
187 
197 any call_function_args(code f, *softlist vargs);
198 
200 
216 string decode_url(string url);
217 
219 
223 nothing decode_url();
224 
226 
243 string encode_url(string url, softbool encode_all = False);
244 
246 
258 bool exists( ...);
259 
261 
273 bool existsFunction(string name);
274 
276 
285 bool existsFunction(code c);
286 
288 
292 nothing existsFunction();
293 
295 
303 *string functionType(string name);
304 
306 
310 nothing functionType();
311 
313 
331 *int getByte(string str, softint offset = 0);
332 
334 
338 nothing getByte();
339 
341 
359 *int getByte(binary b, softint offset = 0);
360 
362 
370 string getClassName(object obj);
371 
373 
377 nothing getClassName();
378 
380 
391 
393 
414 
416 
437 
439 
458 *int getWord32(string str, softint offset = 0);
459 
461 
480 *int getWord32(binary b, softint offset = 0);
481 
483 
487 nothing getWord32();
488 
490 
506 *int get_byte(string str, softint offset = 0);
507 
509 
525 *int get_byte(binary b, softint offset = 0);
526 
528 
535 string get_default_encoding();
536 
538 
557 string get_ex_pos(hash ex);
558 
560 
572 int get_parse_options();
573 
575 
598 
600 
619 
621 
638 
640 
647 *string get_script_dir();
648 
650 
657 *string get_script_name();
658 
660 
667 *string get_script_path();
668 
670 
687 *int get_word_16(string str, softint offset = 0);
688 
690 
707 *int get_word_16(binary b, softint offset = 0);
708 
710 
727 *int get_word_16_lsb(string str, softint offset = 0);
728 
730 
747 *int get_word_16_lsb(binary b, softint offset = 0);
748 
750 
769 *int get_word_32(string str, softint offset = 0);
770 
772 
791 *int get_word_32(binary b, softint offset = 0);
792 
794 
813 *int get_word_32_lsb(string str, softint offset = 0);
814 
816 
833 *int get_word_32_lsb(binary b, softint offset = 0);
834 
836 
853 *int get_word_64(string str, softint offset = 0);
854 
856 
873 *int get_word_64(binary b, softint offset = 0);
874 
876 
893 *int get_word_64_lsb(string str, softint offset = 0);
894 
896 
913 *int get_word_64_lsb(binary b, softint offset = 0);
914 
916 
928 bool has_key(hash h, string key);
929 
931 
940 bool has_key(object obj, string key);
941 
943 
960 
962 
966 nothing hash_values();
967 
969 
980 int hextoint(string str);
981 
983 
987 nothing hextoint();
988 
990 
1002 string html_decode(string str);
1003 
1005 
1009 nothing html_decode();
1010 
1012 
1024 string html_encode(string str);
1025 
1027 
1031 nothing html_encode();
1032 
1034 
1054 nothing load_module(string name);
1055 
1057 
1064 nothing load_module();
1065 
1067 
1088 string makeBase64String(string str, softint maxlinelen = -1);
1089 
1091 
1112 string makeBase64String(binary bin, softint maxlinelen = -1);
1113 
1115 
1119 nothing makeBase64String();
1120 
1122 
1139 string makeHexString(string str);
1140 
1142 
1156 string makeHexString(binary bin);
1157 
1159 
1163 nothing makeHexString();
1164 
1166 
1191 *hash parse(string code, string label, *softint warning_mask, *string source, *softint offset, softbool format_label = True);
1192 
1194 
1201 nothing parse();
1202 
1204 
1219 binary parseBase64String(string str);
1220 
1222 
1226 nothing parseBase64String();
1227 
1229 
1247 string parseBase64StringToString(string str, *string encoding);
1248 
1250 
1254 nothing parseBase64StringToString();
1255 
1257 
1271 binary parseHexString(string hexstr);
1272 
1274 
1278 nothing parseHexString();
1279 
1281 
1301 *hash parseURL(string url, bool keep_brackets = False);
1302 
1304 
1308 nothing parseURL();
1309 
1311 
1333 hash parse_url(string url, bool keep_brackets = False);
1334 
1336 
1345 string splice(string str);
1346 
1348 
1362 string splice(string str, softint start);
1363 
1365 
1381 string splice(string str, softint start, softint len, *string nstr);
1382 
1384 
1396 list splice(list l, softint start);
1397 
1399 
1415 list splice(list l, softint start, softint len, *softlist nlist);
1416 
1418 
1422 nothing splice();
1423 
1425 
1437 int strtoint(string num, softint base = 10);
1438 
1440 
1444 nothing strtoint();
1445 
1447 };
1448 
1450 namespace Qore {
1455 
1457  const NameToSignal = (
1458  "SIGABRT": SIGABRT,
1459  "SIGALRM": SIGALRM,
1460  "SIGBUS": SIGBUS,
1461  "SIGCANCEL": SIGCANCEL,
1462  "SIGCHLD": SIGCHLD,
1463  "SIGCLD": SIGCLD,
1464  "SIGCONT": SIGCONT,
1465  "SIGEMT": SIGEMT,
1466  "SIGFPE": SIGFPE,
1467  "SIGFREEZE": SIGFREEZE,
1468  "SIGHUP": SIGHUP,
1469  "SIGILL": SIGILL,
1470  "SIGINFO": SIGINFO,
1471  "SIGINT": SIGINT,
1472  "SIGIO": SIGIO,
1473  "SIGIOT": SIGIOT,
1474  "SIGJVM1": SIGJVM1,
1475  "SIGJVM2": SIGJVM2,
1476  "SIGKILL": SIGKILL,
1477  "SIGLOST": SIGLOST,
1478  "SIGLWP": SIGLWP,
1479  "SIGPIPE": SIGPIPE,
1480  "SIGPOLL": SIGPOLL,
1481  "SIGPROF": SIGPROF,
1482  "SIGPWR": SIGPWR,
1483  "SIGQUIT": SIGQUIT,
1484  "SIGSEGV": SIGSEGV,
1485  "SIGSTKFLT": SIGSTKFLT,
1486  "SIGSTOP": SIGSTOP,
1487  "SIGSYS": SIGSYS,
1488  "SIGTERM": SIGTERM,
1489  "SIGTHAW": SIGTHAW,
1490  "SIGTRAP": SIGTRAP,
1491  "SIGTSTP": SIGTSTP,
1492  "SIGTTIN": SIGTTIN,
1493  "SIGTTOU": SIGTTOU,
1494  "SIGURG": SIGURG,
1495  "SIGUSR1": SIGUSR1,
1496  "SIGUSR2": SIGUSR2,
1497  "SIGVTALRM": SIGVTALRM,
1498  "SIGWAITING": SIGWAITING,
1499  "SIGWINCH": SIGWINCH,
1500  "SIGXCPU": SIGXCPU,
1501  "SIGXFSZ": SIGXFSZ,
1502  "SIGXRES": SIGXRES,
1503  );
1505  const SIGABRT = SIGABRT;
1507  const SIGALRM = SIGALRM;
1509  const SIGBUS = SIGBUS;
1513  const SIGCHLD = SIGCHLD;
1515  const SIGCLD = SIGCLD;
1517  const SIGCONT = SIGCONT;
1519  const SIGEMT = SIGEMT;
1521  const SIGFPE = SIGFPE;
1525  const SIGHUP = SIGHUP;
1527  const SIGILL = SIGILL;
1529  const SIGINFO = SIGINFO;
1531  const SIGINT = SIGINT;
1533  const SIGIO = SIGIO;
1535  const SIGIOT = SIGIOT;
1537  const SIGJVM1 = SIGJVM1;
1539  const SIGJVM2 = SIGJVM2;
1541  const SIGKILL = SIGKILL;
1543  const SIGLOST = SIGLOST;
1545  const SIGLWP = SIGLWP;
1547  const SIGPIPE = SIGPIPE;
1549  const SIGPOLL = SIGPOLL;
1551  const SIGPROF = SIGPROF;
1553  const SIGPWR = SIGPWR;
1555  const SIGQUIT = SIGQUIT;
1557  const SIGSEGV = SIGSEGV;
1561  const SIGSTOP = SIGSTOP;
1563  const SIGSYS = SIGSYS;
1565  const SIGTERM = SIGTERM;
1567  const SIGTHAW = SIGTHAW;
1569  const SIGTRAP = SIGTRAP;
1571  const SIGTSTP = SIGTSTP;
1573  const SIGTTIN = SIGTTIN;
1575  const SIGTTOU = SIGTTOU;
1577  const SIGURG = SIGURG;
1579  const SIGUSR1 = SIGUSR1;
1581  const SIGUSR2 = SIGUSR2;
1589  const SIGXCPU = SIGXCPU;
1591  const SIGXFSZ = SIGXFSZ;
1593  const SIGXRES = SIGXRES;
1595  const SignalToName = (
1596  SIGABRT: "SIGABRT",
1597  SIGALRM: "SIGALRM",
1598  SIGBUS: "SIGBUS",
1599  SIGCANCEL: "SIGCANCEL",
1600  SIGCHLD: "SIGCHLD",
1601  SIGCONT: "SIGCONT",
1602  SIGEMT: "SIGEMT",
1603  SIGFPE: "SIGFPE",
1604  SIGFREEZE: "SIGFREEZE",
1605  SIGHUP: "SIGHUP",
1606  SIGILL: "SIGILL",
1607  SIGINFO: "SIGINFO",
1608  SIGINT: "SIGINT",
1609  SIGIO: "SIGIO",
1610  SIGIOT: "SIGIOT",
1611  SIGJVM1: "SIGJVM1",
1612  SIGJVM2: "SIGJVM2",
1613  SIGKILL: "SIGKILL",
1614  SIGLOST: "SIGLOST",
1615  SIGLWP: "SIGLWP",
1616  SIGPIPE: "SIGPIPE",
1617  SIGPOLL: "SIGPOLL",
1618  SIGPROF: "SIGPROF",
1619  SIGPWR: "SIGPWR",
1620  SIGQUIT: "SIGQUIT",
1621  SIGSEGV: "SIGSEGV",
1622  SIGSTKSZ: "SIGSTKSZ",
1623  SIGSTOP: "SIGSTOP",
1624  SIGSYS: "SIGSYS",
1625  SIGTERM: "SIGTERM",
1626  SIGTHAW: "SIGTHAW",
1627  SIGTRAP: "SIGTRAP",
1628  SIGTSTP: "SIGTSTP",
1629  SIGTTIN: "SIGTTIN",
1630  SIGTTOU: "SIGTTOU",
1631  SIGURG: "SIGURG",
1632  SIGUSR1: "SIGUSR1",
1633  SIGUSR2: "SIGUSR2",
1634  SIGVTALRM: "SIGVTALRM",
1635  SIGWAITING: "SIGWAITING",
1636  SIGWINCH: "SIGWINCH",
1637  SIGXCPU: "SIGXCPU",
1638  SIGXFSZ: "SIGXFSZ",
1639  SIGXRES: "SIGXRES",
1640  );
1642 };
const SIGKILL
SIGKILL.
Definition: ql_misc.dox.h:1541
*int get_word_32_lsb(string str, softint offset=0)
Returns the 32-bit integer value at the given 4-byte offset (the first value is at offset 0) or NOTHI...
string get_default_encoding()
Returns the name of the default character encoding.
const SIGSYS
SIGSYS.
Definition: ql_misc.dox.h:1563
const SIGINFO
SIGINFO.
Definition: ql_misc.dox.h:1529
*string get_script_name()
Returns the filename of the current script if known or NOTHING if unknown (i.e. no parent script...
string decode_url(string url)
Decodes percent numeric codes in a URL string and returns the decoded string in UTF-8 encoding...
binary parseHexString(string hexstr)
Parses a hex-encoded string and returns the binary object.
const SIGURG
SIGURG.
Definition: ql_misc.dox.h:1577
hash get_qore_option_hash()
Returns a hash of hashes giving information about Qore library options for the current build...
any call_function(string name,...)
Calls a function and returns the return value, passing the remaining arguments after the function nam...
nothing set_signal_handler(softint signal, code f)
Sets or replaces a signal handler according to the signal number and closure or call reference (funct...
const SIGPROF
SIGPROF.
Definition: ql_misc.dox.h:1551
const SIGSTKFLT
SIGSTKFLT.
Definition: ql_misc.dox.h:1559
*hash parse(string code, string label, *softint warning_mask, *string source, *softint offset, softbool format_label=True)
Adds the text passed to the current program's code, tagged with the given label.
const SIGBUS
SIGBUS.
Definition: ql_misc.dox.h:1509
*string get_script_path()
Returns the path (directory and filename) of the current script or NOTHING if unknown (i...
const SIGTTOU
SIGTTOU.
Definition: ql_misc.dox.h:1575
const SIGQUIT
SIGQUIT.
Definition: ql_misc.dox.h:1555
*int get_word_32(string str, softint offset=0)
Returns the 32-bit integer value at the given 4-byte offset (the first value is at offset 0) or NOTHI...
const SIGWINCH
SIGWINCH.
Definition: ql_misc.dox.h:1587
const SIGPWR
SIGPWR.
Definition: ql_misc.dox.h:1553
const True
logical True
Definition: qc_qore.dox.h:94
const SIGIO
SIGIO.
Definition: ql_misc.dox.h:1533
const SIGCLD
SIGCLD.
Definition: ql_misc.dox.h:1515
const SIGUSR2
SIGUSR2.
Definition: ql_misc.dox.h:1581
*int get_byte(string str, softint offset=0)
Returns the byte value at the given byte offset (the first value is at offset 0) or NOTHING if the of...
const SIGVTALRM
SIGVTALRM.
Definition: ql_misc.dox.h:1583
*hash parseURL(string url, bool keep_brackets=False)
Parses a URL string and returns a hash of the components; if the URL cannot be parsed then NOTHING is...
any call_builtin_function(string name,...)
Calls a function and returns the return value, passing the remaining arguments after the function nam...
binary binary()
Always returns an empty binary object (of zero length)
const SIGSTOP
SIGSTOP.
Definition: ql_misc.dox.h:1561
const SIGTERM
SIGTERM.
Definition: ql_misc.dox.h:1565
const SIGALRM
SIGALRM.
Definition: ql_misc.dox.h:1507
*int get_word_16(string str, softint offset=0)
Returns the 16-bit integer value at the given 2-byte offset (the first value is at offset 0) or NOTHI...
string parseBase64StringToString(string str, *string encoding)
Parses a base64 encoded string and returns a string of the decoded data.
const SIGTRAP
SIGTRAP.
Definition: ql_misc.dox.h:1569
const False
logical False
Definition: qc_qore.dox.h:92
const SIGCONT
SIGCONT.
Definition: ql_misc.dox.h:1517
list list(...)
Returns a list of the arguments passed at the top level.
nothing load_module(string name)
Loads in a Qore module at run-time.
const SIGLWP
SIGLWP.
Definition: ql_misc.dox.h:1545
const SIGTTIN
SIGTTIN.
Definition: ql_misc.dox.h:1573
string html_decode(string str)
Returns a string with any HTML escape codes translated to the original characters.
int hextoint(string str)
Returns an integer for a hexadecimal string value; throws an exception if non-hex digits are found...
*string get_script_dir()
Returns the name of the directory from which the current script was executed or NOTHING if unknown (i...
nothing remove_signal_handler(softint signal)
Removes a signal handler and returns the signal handling state to the default.
const SIGJVM2
SIGJVM2.
Definition: ql_misc.dox.h:1539
const SIGCHLD
SIGCHLD.
Definition: ql_misc.dox.h:1513
list hash_values(hash h)
Returns a list of all the values in the hash argument passed.
*int getByte(string str, softint offset=0)
Returns the byte value at the given byte offset (the first value is at offset 0) or NOTHING if the of...
const SIGSEGV
SIGSEGV.
Definition: ql_misc.dox.h:1557
bool exists(...)
A function performing the same role as the exists operator.
int get_parse_options()
returns the current parse options for the current Program object
const SIGEMT
SIGEMT.
Definition: ql_misc.dox.h:1519
list getFeatureList()
Returns a list of strings of the builtin and module-supplied features of Qore.
const SIGABRT
SIGABRT.
Definition: ql_misc.dox.h:1505
string splice(string str)
This function always returns an empty string "".
const SignalToName
maps signal numbers (as a string key) to the symbolic name for the signal
Definition: ql_misc.dox.h:1595
*string functionType(string name)
Returns "builtin" (for a builtin function), "user" (for a user function), or NOTHING (if the function...
const SIGFREEZE
SIGFREEZE.
Definition: ql_misc.dox.h:1523
*int getWord32(string str, softint offset=0)
Returns the 32-bit integer value at the given 4-byte offset (the first value is at offset 0) or NOTHI...
string getClassName(object obj)
Returns the class name of the object passed.
const SIGPOLL
SIGPOLL.
Definition: ql_misc.dox.h:1549
const SIGXCPU
SIGXCPU.
Definition: ql_misc.dox.h:1589
string html_encode(string str)
Returns a string with characters needing HTML escaping translated to HTML escape codes.
const SIGHUP
SIGHUP.
Definition: ql_misc.dox.h:1525
const SIGILL
SIGILL.
Definition: ql_misc.dox.h:1527
string makeHexString(string str)
Returns a hex-encoded representation of a string.
binary parseBase64String(string str)
Parses a base64 encoded string and returns a binary object of the decoded data.
hash parse_url(string url, bool keep_brackets=False)
Parses a URL string and returns a hash of the components; throws an exception if the string cannot be...
const SIGJVM1
SIGJVM1.
Definition: ql_misc.dox.h:1537
const SIGTSTP
SIGTSTP.
Definition: ql_misc.dox.h:1571
any call_builtin_function_args(string name, *softlist vargs)
Calls a function and returns the return value, using the optional second argument as a list of argume...
const SIGFPE
SIGFPE.
Definition: ql_misc.dox.h:1521
*int get_word_64_lsb(string str, softint offset=0)
Returns the 64-bit integer value at the given 8-byte offset (the first value is at offset 0) or NOTHI...
const SIGUSR1
SIGUSR1.
Definition: ql_misc.dox.h:1579
int strtoint(string num, softint base=10)
parses a string representing a number in a configurable base and returns the integer ...
const SIGWAITING
SIGWAITING.
Definition: ql_misc.dox.h:1585
any call_function_args(string name, *softlist vargs)
Calls a function and returns the return value, using the optional second argument as a list of argume...
bool existsFunction(string name)
Returns True if the function exists in the current program's function name space. ...
string backquote(string cmd, *reference rc)
Executes a process and returns a string of the output (stdout only)
string encode_url(string url, softbool encode_all=False)
Encodes URLs by substituting '' characters with '%25', spaces (' ') with '%20', and non-ascii charact...
const SIGINT
SIGINT.
Definition: ql_misc.dox.h:1531
*int get_word_16_lsb(string str, softint offset=0)
Returns the 16-bit integer value at the given 2-byte offset (the first value is at offset 0) or NOTHI...
list get_qore_option_list()
Returns a list of hashes giving information about Qore library options for the current build...
const NameToSignal
maps signal names to signal values
Definition: ql_misc.dox.h:1457
const SIGXFSZ
SIGXFSZ.
Definition: ql_misc.dox.h:1591
string get_ex_pos(hash ex)
returns a descriptive string for an exception location; the source and offset information will also b...
list getModuleList()
Returns a list of hashes describing the currently-loaded Qore modules.
hash hash(object obj)
Returns a hash of an object's members.
const SIGIOT
SIGIOT.
Definition: ql_misc.dox.h:1535
string makeBase64String(string str, softint maxlinelen=-1)
Returns a base64-encoded representation of a string.
*int get_word_64(string str, softint offset=0)
Returns the 64-bit integer value at the given 8-byte offset (the first value is at offset 0) or NOTHI...
bool has_key(hash h, string key)
Returns True if the given key exists in the hash (does not necessarily have to have a value assigned)...
const SIGPIPE
SIGPIPE.
Definition: ql_misc.dox.h:1547
const SIGCANCEL
SIGCANCEL.
Definition: ql_misc.dox.h:1511
hash getModuleHash()
Returns a hash of hashes describing the currently-loaded Qore modules; the top-level hash keys are th...
hash get_qore_library_info()
Returns a hash of library build and version info.
const SIGXRES
SIGXRES.
Definition: ql_misc.dox.h:1593
const SIGTHAW
SIGTHAW.
Definition: ql_misc.dox.h:1567
const SIGLOST
SIGLOST.
Definition: ql_misc.dox.h:1543