Qore Programming Language Reference Manual  0.8.11.1
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 
223 string decode_uri_request(string url);
224 
226 
245 string decode_url(string url);
246 
248 
252 nothing decode_url();
253 
255 
277 string encode_uri_request(string url);
278 
280 
300 string encode_url(string url, softbool encode_all = False);
301 
303 
315 bool exists( ...);
316 
318 
330 bool existsFunction(string name);
331 
333 
342 bool existsFunction(code c);
343 
345 
349 nothing existsFunction();
350 
352 
360 *string functionType(string name);
361 
363 
367 nothing functionType();
368 
370 
388 *int getByte(string str, softint offset = 0);
389 
391 
395 nothing getByte();
396 
398 
416 *int getByte(binary b, softint offset = 0);
417 
419 
427 string getClassName(object obj);
428 
430 
434 nothing getClassName();
435 
437 
448 
450 
472 
474 
496 
498 
517 *int getWord32(string str, softint offset = 0);
518 
520 
539 *int getWord32(binary b, softint offset = 0);
540 
542 
546 nothing getWord32();
547 
549 
565 *int get_byte(string str, softint offset = 0);
566 
568 
584 *int get_byte(binary b, softint offset = 0);
585 
587 
594 string get_default_encoding();
595 
597 
616 string get_ex_pos(hash ex);
617 
619 
631 int get_parse_options();
632 
634 
657 
659 
678 
680 
697 
699 
706 *string get_script_dir();
707 
709 
716 *string get_script_name();
717 
719 
726 *string get_script_path();
727 
729 
746 *int get_word_16(string str, softint offset = 0);
747 
749 
766 *int get_word_16(binary b, softint offset = 0);
767 
769 
786 *int get_word_16_lsb(string str, softint offset = 0);
787 
789 
806 *int get_word_16_lsb(binary b, softint offset = 0);
807 
809 
828 *int get_word_32(string str, softint offset = 0);
829 
831 
850 *int get_word_32(binary b, softint offset = 0);
851 
853 
872 *int get_word_32_lsb(string str, softint offset = 0);
873 
875 
892 *int get_word_32_lsb(binary b, softint offset = 0);
893 
895 
912 *int get_word_64(string str, softint offset = 0);
913 
915 
932 *int get_word_64(binary b, softint offset = 0);
933 
935 
952 *int get_word_64_lsb(string str, softint offset = 0);
953 
955 
972 *int get_word_64_lsb(binary b, softint offset = 0);
973 
975 
987 bool has_key(hash h, string key);
988 
990 
999 bool has_key(object obj, string key);
1000 
1002 
1018 list hash_values(hash h);
1019 
1021 
1025 nothing hash_values();
1026 
1028 
1039 int hextoint(string str);
1040 
1042 
1046 nothing hextoint();
1047 
1049 
1061 string html_decode(string str);
1062 
1064 
1068 nothing html_decode();
1069 
1071 
1083 string html_encode(string str);
1084 
1086 
1090 nothing html_encode();
1091 
1093 
1113 nothing load_module(string name);
1114 
1116 
1123 nothing load_module();
1124 
1126 
1147 string makeBase64String(string str, softint maxlinelen = -1);
1148 
1150 
1171 string makeBase64String(binary bin, softint maxlinelen = -1);
1172 
1174 
1178 nothing makeBase64String();
1179 
1181 
1198 string makeHexString(string str);
1199 
1201 
1215 string makeHexString(binary bin);
1216 
1218 
1222 nothing makeHexString();
1223 
1225 
1250 *hash parse(string code, string label, *softint warning_mask, *string source, *softint offset, softbool format_label = True);
1251 
1253 
1260 nothing parse();
1261 
1263 
1278 binary parseBase64String(string str);
1279 
1281 
1285 nothing parseBase64String();
1286 
1288 
1306 string parseBase64StringToString(string str, *string encoding);
1307 
1309 
1313 nothing parseBase64StringToString();
1314 
1316 
1330 binary parseHexString(string hexstr);
1331 
1333 
1337 nothing parseHexString();
1338 
1340 
1360 *hash parseURL(string url, bool keep_brackets = False);
1361 
1363 
1367 nothing parseURL();
1368 
1370 
1392 hash parse_url(string url, bool keep_brackets = False);
1393 
1395 
1404 string splice(string str);
1405 
1407 
1421 string splice(string str, softint start);
1422 
1424 
1440 string splice(string str, softint start, softint len, *string nstr);
1441 
1443 
1455 list splice(list l, softint start);
1456 
1458 
1474 list splice(list l, softint start, softint len, *softlist nlist);
1475 
1477 
1481 nothing splice();
1482 
1484 
1496 int strtoint(string num, softint base = 10);
1497 
1499 
1503 nothing strtoint();
1504 
1506 };
1507 
1509 namespace Qore {
1514 
1516  const NameToSignal = (
1517  "SIGABRT": SIGABRT,
1518  "SIGALRM": SIGALRM,
1519  "SIGBUS": SIGBUS,
1520  "SIGCANCEL": SIGCANCEL,
1521  "SIGCHLD": SIGCHLD,
1522  "SIGCLD": SIGCLD,
1523  "SIGCONT": SIGCONT,
1524  "SIGEMT": SIGEMT,
1525  "SIGFPE": SIGFPE,
1526  "SIGFREEZE": SIGFREEZE,
1527  "SIGHUP": SIGHUP,
1528  "SIGILL": SIGILL,
1529  "SIGINFO": SIGINFO,
1530  "SIGINT": SIGINT,
1531  "SIGIO": SIGIO,
1532  "SIGIOT": SIGIOT,
1533  "SIGJVM1": SIGJVM1,
1534  "SIGJVM2": SIGJVM2,
1535  "SIGKILL": SIGKILL,
1536  "SIGLOST": SIGLOST,
1537  "SIGLWP": SIGLWP,
1538  "SIGPIPE": SIGPIPE,
1539  "SIGPOLL": SIGPOLL,
1540  "SIGPROF": SIGPROF,
1541  "SIGPWR": SIGPWR,
1542  "SIGQUIT": SIGQUIT,
1543  "SIGSEGV": SIGSEGV,
1544  "SIGSTKFLT": SIGSTKFLT,
1545  "SIGSTOP": SIGSTOP,
1546  "SIGSYS": SIGSYS,
1547  "SIGTERM": SIGTERM,
1548  "SIGTHAW": SIGTHAW,
1549  "SIGTRAP": SIGTRAP,
1550  "SIGTSTP": SIGTSTP,
1551  "SIGTTIN": SIGTTIN,
1552  "SIGTTOU": SIGTTOU,
1553  "SIGURG": SIGURG,
1554  "SIGUSR1": SIGUSR1,
1555  "SIGUSR2": SIGUSR2,
1556  "SIGVTALRM": SIGVTALRM,
1557  "SIGWAITING": SIGWAITING,
1558  "SIGWINCH": SIGWINCH,
1559  "SIGXCPU": SIGXCPU,
1560  "SIGXFSZ": SIGXFSZ,
1561  "SIGXRES": SIGXRES,
1562  );
1564  const SIGABRT = SIGABRT;
1566  const SIGALRM = SIGALRM;
1568  const SIGBUS = SIGBUS;
1572  const SIGCHLD = SIGCHLD;
1574  const SIGCLD = SIGCLD;
1576  const SIGCONT = SIGCONT;
1578  const SIGEMT = SIGEMT;
1580  const SIGFPE = SIGFPE;
1584  const SIGHUP = SIGHUP;
1586  const SIGILL = SIGILL;
1588  const SIGINFO = SIGINFO;
1590  const SIGINT = SIGINT;
1592  const SIGIO = SIGIO;
1594  const SIGIOT = SIGIOT;
1596  const SIGJVM1 = SIGJVM1;
1598  const SIGJVM2 = SIGJVM2;
1600  const SIGKILL = SIGKILL;
1602  const SIGLOST = SIGLOST;
1604  const SIGLWP = SIGLWP;
1606  const SIGPIPE = SIGPIPE;
1608  const SIGPOLL = SIGPOLL;
1610  const SIGPROF = SIGPROF;
1612  const SIGPWR = SIGPWR;
1614  const SIGQUIT = SIGQUIT;
1616  const SIGSEGV = SIGSEGV;
1620  const SIGSTOP = SIGSTOP;
1622  const SIGSYS = SIGSYS;
1624  const SIGTERM = SIGTERM;
1626  const SIGTHAW = SIGTHAW;
1628  const SIGTRAP = SIGTRAP;
1630  const SIGTSTP = SIGTSTP;
1632  const SIGTTIN = SIGTTIN;
1634  const SIGTTOU = SIGTTOU;
1636  const SIGURG = SIGURG;
1638  const SIGUSR1 = SIGUSR1;
1640  const SIGUSR2 = SIGUSR2;
1648  const SIGXCPU = SIGXCPU;
1650  const SIGXFSZ = SIGXFSZ;
1652  const SIGXRES = SIGXRES;
1654  const SignalToName = (
1655  SIGABRT: "SIGABRT",
1656  SIGALRM: "SIGALRM",
1657  SIGBUS: "SIGBUS",
1658  SIGCANCEL: "SIGCANCEL",
1659  SIGCHLD: "SIGCHLD",
1660  SIGCONT: "SIGCONT",
1661  SIGEMT: "SIGEMT",
1662  SIGFPE: "SIGFPE",
1663  SIGFREEZE: "SIGFREEZE",
1664  SIGHUP: "SIGHUP",
1665  SIGILL: "SIGILL",
1666  SIGINFO: "SIGINFO",
1667  SIGINT: "SIGINT",
1668  SIGIO: "SIGIO",
1669  SIGIOT: "SIGIOT",
1670  SIGJVM1: "SIGJVM1",
1671  SIGJVM2: "SIGJVM2",
1672  SIGKILL: "SIGKILL",
1673  SIGLOST: "SIGLOST",
1674  SIGLWP: "SIGLWP",
1675  SIGPIPE: "SIGPIPE",
1676  SIGPOLL: "SIGPOLL",
1677  SIGPROF: "SIGPROF",
1678  SIGPWR: "SIGPWR",
1679  SIGQUIT: "SIGQUIT",
1680  SIGSEGV: "SIGSEGV",
1681  SIGSTKSZ: "SIGSTKSZ",
1682  SIGSTOP: "SIGSTOP",
1683  SIGSYS: "SIGSYS",
1684  SIGTERM: "SIGTERM",
1685  SIGTHAW: "SIGTHAW",
1686  SIGTRAP: "SIGTRAP",
1687  SIGTSTP: "SIGTSTP",
1688  SIGTTIN: "SIGTTIN",
1689  SIGTTOU: "SIGTTOU",
1690  SIGURG: "SIGURG",
1691  SIGUSR1: "SIGUSR1",
1692  SIGUSR2: "SIGUSR2",
1693  SIGVTALRM: "SIGVTALRM",
1694  SIGWAITING: "SIGWAITING",
1695  SIGWINCH: "SIGWINCH",
1696  SIGXCPU: "SIGXCPU",
1697  SIGXFSZ: "SIGXFSZ",
1698  SIGXRES: "SIGXRES",
1699  );
1701 };
const SIGKILL
SIGKILL.
Definition: ql_misc.dox.h:1600
*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:1622
const SIGINFO
SIGINFO.
Definition: ql_misc.dox.h:1588
*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:1636
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:1610
const SIGSTKFLT
SIGSTKFLT.
Definition: ql_misc.dox.h:1618
*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:1568
*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:1634
const SIGQUIT
SIGQUIT.
Definition: ql_misc.dox.h:1614
*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:1646
const SIGPWR
SIGPWR.
Definition: ql_misc.dox.h:1612
const True
logical True
Definition: qc_qore.dox.h:94
const SIGIO
SIGIO.
Definition: ql_misc.dox.h:1592
string encode_uri_request(string url)
Encodes URI requests by substituting all special characters according to RFC 3986 in the path with pe...
const SIGCLD
SIGCLD.
Definition: ql_misc.dox.h:1574
const SIGUSR2
SIGUSR2.
Definition: ql_misc.dox.h:1640
*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:1642
*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...
string decode_uri_request(string url)
Decodes percent-encoded codes in a URI path and converts "+" signs in the query component to spaces a...
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:1620
const SIGTERM
SIGTERM.
Definition: ql_misc.dox.h:1624
const SIGALRM
SIGALRM.
Definition: ql_misc.dox.h:1566
*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:1628
const False
logical False
Definition: qc_qore.dox.h:92
const SIGCONT
SIGCONT.
Definition: ql_misc.dox.h:1576
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:1604
const SIGTTIN
SIGTTIN.
Definition: ql_misc.dox.h:1632
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:1598
const SIGCHLD
SIGCHLD.
Definition: ql_misc.dox.h:1572
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:1616
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:1578
list getFeatureList()
Returns a list of strings of the builtin and module-supplied features of Qore.
const SIGABRT
SIGABRT.
Definition: ql_misc.dox.h:1564
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:1654
*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:1582
*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:1608
const SIGXCPU
SIGXCPU.
Definition: ql_misc.dox.h:1648
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:1584
const SIGILL
SIGILL.
Definition: ql_misc.dox.h:1586
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:1596
const SIGTSTP
SIGTSTP.
Definition: ql_misc.dox.h:1630
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:1580
*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:1638
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:1644
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 charac...
const SIGINT
SIGINT.
Definition: ql_misc.dox.h:1590
*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:1516
const SIGXFSZ
SIGXFSZ.
Definition: ql_misc.dox.h:1650
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:2
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:1594
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:1606
const SIGCANCEL
SIGCANCEL.
Definition: ql_misc.dox.h:1570
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:1652
const SIGTHAW
SIGTHAW.
Definition: ql_misc.dox.h:1626
const SIGLOST
SIGLOST.
Definition: ql_misc.dox.h:1602