Qore Programming Language Reference Manual  0.8.8
 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 
212 string decode_url(string url);
213 
215 
219 nothing decode_url();
220 
222 
234 bool exists( ...);
235 
237 
249 bool existsFunction(string name);
250 
252 
261 bool existsFunction(code c);
262 
264 
268 nothing existsFunction();
269 
271 
279 *string functionType(string name);
280 
282 
286 nothing functionType();
287 
289 
307 *int getByte(string str, softint offset = 0);
308 
310 
314 nothing getByte();
315 
317 
335 *int getByte(binary b, softint offset = 0);
336 
338 
346 string getClassName(object obj);
347 
349 
353 nothing getClassName();
354 
356 
367 
369 
390 
392 
413 
415 
434 *int getWord32(string str, softint offset = 0);
435 
437 
456 *int getWord32(binary b, softint offset = 0);
457 
459 
463 nothing getWord32();
464 
466 
482 *int get_byte(string str, softint offset = 0);
483 
485 
501 *int get_byte(binary b, softint offset = 0);
502 
504 
511 string get_default_encoding();
512 
514 
533 string get_ex_pos(hash ex);
534 
536 
548 int get_parse_options();
549 
551 
574 
576 
595 
597 
614 
616 
623 *string get_script_dir();
624 
626 
633 *string get_script_name();
634 
636 
643 *string get_script_path();
644 
646 
663 *int get_word_16(string str, softint offset = 0);
664 
666 
683 *int get_word_16(binary b, softint offset = 0);
684 
686 
703 *int get_word_16_lsb(string str, softint offset = 0);
704 
706 
723 *int get_word_16_lsb(binary b, softint offset = 0);
724 
726 
745 *int get_word_32(string str, softint offset = 0);
746 
748 
767 *int get_word_32(binary b, softint offset = 0);
768 
770 
789 *int get_word_32_lsb(string str, softint offset = 0);
790 
792 
809 *int get_word_32_lsb(binary b, softint offset = 0);
810 
812 
829 *int get_word_64(string str, softint offset = 0);
830 
832 
849 *int get_word_64(binary b, softint offset = 0);
850 
852 
869 *int get_word_64_lsb(string str, softint offset = 0);
870 
872 
889 *int get_word_64_lsb(binary b, softint offset = 0);
890 
892 
904 bool has_key(hash h, string key);
905 
907 
916 bool has_key(object obj, string key);
917 
919 
936 
938 
942 nothing hash_values();
943 
945 
956 int hextoint(string str);
957 
959 
963 nothing hextoint();
964 
966 
978 string html_decode(string str);
979 
981 
985 nothing html_decode();
986 
988 
1000 string html_encode(string str);
1001 
1003 
1007 nothing html_encode();
1008 
1010 
1030 nothing load_module(string name);
1031 
1033 
1040 nothing load_module();
1041 
1043 
1064 string makeBase64String(string str, softint maxlinelen = -1);
1065 
1067 
1088 string makeBase64String(binary bin, softint maxlinelen = -1);
1089 
1091 
1095 nothing makeBase64String();
1096 
1098 
1115 string makeHexString(string str);
1116 
1118 
1132 string makeHexString(binary bin);
1133 
1135 
1139 nothing makeHexString();
1140 
1142 
1167 *hash parse(string code, string label, *softint warning_mask, *string source, *softint offset, softbool format_label = True);
1168 
1170 
1177 nothing parse();
1178 
1180 
1195 binary parseBase64String(string str);
1196 
1198 
1202 nothing parseBase64String();
1203 
1205 
1223 string parseBase64StringToString(string str, *string encoding);
1224 
1226 
1230 nothing parseBase64StringToString();
1231 
1233 
1247 binary parseHexString(string hexstr);
1248 
1250 
1254 nothing parseHexString();
1255 
1257 
1275 *hash parseURL(string url, bool keep_brackets = False);
1276 
1278 
1282 nothing parseURL();
1283 
1285 
1305 hash parse_url(string url, bool keep_brackets = False);
1306 
1308 
1317 string splice(string str);
1318 
1320 
1334 string splice(string str, softint start);
1335 
1337 
1353 string splice(string str, softint start, softint len, *string nstr);
1354 
1356 
1368 list splice(list l, softint start);
1369 
1371 
1387 list splice(list l, softint start, softint len, *softlist nlist);
1388 
1390 
1394 nothing splice();
1395 
1397 
1409 int strtoint(string num, softint base = 10);
1410 
1412 
1416 nothing strtoint();
1417 
1419 };
1420 
1422 namespace Qore {
1427 
1429  const NameToSignal = (
1430  "SIGABRT": SIGABRT,
1431  "SIGALRM": SIGALRM,
1432  "SIGBUS": SIGBUS,
1433  "SIGCANCEL": SIGCANCEL,
1434  "SIGCHLD": SIGCHLD,
1435  "SIGCLD": SIGCLD,
1436  "SIGCONT": SIGCONT,
1437  "SIGEMT": SIGEMT,
1438  "SIGFPE": SIGFPE,
1439  "SIGFREEZE": SIGFREEZE,
1440  "SIGHUP": SIGHUP,
1441  "SIGILL": SIGILL,
1442  "SIGINFO": SIGINFO,
1443  "SIGINT": SIGINT,
1444  "SIGIO": SIGIO,
1445  "SIGIOT": SIGIOT,
1446  "SIGJVM1": SIGJVM1,
1447  "SIGJVM2": SIGJVM2,
1448  "SIGKILL": SIGKILL,
1449  "SIGLOST": SIGLOST,
1450  "SIGLWP": SIGLWP,
1451  "SIGPIPE": SIGPIPE,
1452  "SIGPOLL": SIGPOLL,
1453  "SIGPROF": SIGPROF,
1454  "SIGPWR": SIGPWR,
1455  "SIGQUIT": SIGQUIT,
1456  "SIGSEGV": SIGSEGV,
1457  "SIGSTKFLT": SIGSTKFLT,
1458  "SIGSTOP": SIGSTOP,
1459  "SIGSYS": SIGSYS,
1460  "SIGTERM": SIGTERM,
1461  "SIGTHAW": SIGTHAW,
1462  "SIGTRAP": SIGTRAP,
1463  "SIGTSTP": SIGTSTP,
1464  "SIGTTIN": SIGTTIN,
1465  "SIGTTOU": SIGTTOU,
1466  "SIGURG": SIGURG,
1467  "SIGUSR1": SIGUSR1,
1468  "SIGUSR2": SIGUSR2,
1469  "SIGVTALRM": SIGVTALRM,
1470  "SIGWAITING": SIGWAITING,
1471  "SIGWINCH": SIGWINCH,
1472  "SIGXCPU": SIGXCPU,
1473  "SIGXFSZ": SIGXFSZ,
1474  "SIGXRES": SIGXRES,
1475  );
1477  const SIGABRT = SIGABRT;
1479  const SIGALRM = SIGALRM;
1481  const SIGBUS = SIGBUS;
1485  const SIGCHLD = SIGCHLD;
1487  const SIGCLD = SIGCLD;
1489  const SIGCONT = SIGCONT;
1491  const SIGEMT = SIGEMT;
1493  const SIGFPE = SIGFPE;
1497  const SIGHUP = SIGHUP;
1499  const SIGILL = SIGILL;
1501  const SIGINFO = SIGINFO;
1503  const SIGINT = SIGINT;
1505  const SIGIO = SIGIO;
1507  const SIGIOT = SIGIOT;
1509  const SIGJVM1 = SIGJVM1;
1511  const SIGJVM2 = SIGJVM2;
1513  const SIGKILL = SIGKILL;
1515  const SIGLOST = SIGLOST;
1517  const SIGLWP = SIGLWP;
1519  const SIGPIPE = SIGPIPE;
1521  const SIGPOLL = SIGPOLL;
1523  const SIGPROF = SIGPROF;
1525  const SIGPWR = SIGPWR;
1527  const SIGQUIT = SIGQUIT;
1529  const SIGSEGV = SIGSEGV;
1533  const SIGSTOP = SIGSTOP;
1535  const SIGSYS = SIGSYS;
1537  const SIGTERM = SIGTERM;
1539  const SIGTHAW = SIGTHAW;
1541  const SIGTRAP = SIGTRAP;
1543  const SIGTSTP = SIGTSTP;
1545  const SIGTTIN = SIGTTIN;
1547  const SIGTTOU = SIGTTOU;
1549  const SIGURG = SIGURG;
1551  const SIGUSR1 = SIGUSR1;
1553  const SIGUSR2 = SIGUSR2;
1561  const SIGXCPU = SIGXCPU;
1563  const SIGXFSZ = SIGXFSZ;
1565  const SIGXRES = SIGXRES;
1567  const SignalToName = (
1568  SIGABRT: "SIGABRT",
1569  SIGALRM: "SIGALRM",
1570  SIGBUS: "SIGBUS",
1571  SIGCANCEL: "SIGCANCEL",
1572  SIGCHLD: "SIGCHLD",
1573  SIGCONT: "SIGCONT",
1574  SIGEMT: "SIGEMT",
1575  SIGFPE: "SIGFPE",
1576  SIGFREEZE: "SIGFREEZE",
1577  SIGHUP: "SIGHUP",
1578  SIGILL: "SIGILL",
1579  SIGINFO: "SIGINFO",
1580  SIGINT: "SIGINT",
1581  SIGIO: "SIGIO",
1582  SIGIOT: "SIGIOT",
1583  SIGJVM1: "SIGJVM1",
1584  SIGJVM2: "SIGJVM2",
1585  SIGKILL: "SIGKILL",
1586  SIGLOST: "SIGLOST",
1587  SIGLWP: "SIGLWP",
1588  SIGPIPE: "SIGPIPE",
1589  SIGPOLL: "SIGPOLL",
1590  SIGPROF: "SIGPROF",
1591  SIGPWR: "SIGPWR",
1592  SIGQUIT: "SIGQUIT",
1593  SIGSEGV: "SIGSEGV",
1594  SIGSTKSZ: "SIGSTKSZ",
1595  SIGSTOP: "SIGSTOP",
1596  SIGSYS: "SIGSYS",
1597  SIGTERM: "SIGTERM",
1598  SIGTHAW: "SIGTHAW",
1599  SIGTRAP: "SIGTRAP",
1600  SIGTSTP: "SIGTSTP",
1601  SIGTTIN: "SIGTTIN",
1602  SIGTTOU: "SIGTTOU",
1603  SIGURG: "SIGURG",
1604  SIGUSR1: "SIGUSR1",
1605  SIGUSR2: "SIGUSR2",
1606  SIGVTALRM: "SIGVTALRM",
1607  SIGWAITING: "SIGWAITING",
1608  SIGWINCH: "SIGWINCH",
1609  SIGXCPU: "SIGXCPU",
1610  SIGXFSZ: "SIGXFSZ",
1611  SIGXRES: "SIGXRES",
1612  );
1614 };
const SIGKILL
SIGKILL.
Definition: ql_misc.dox.h:1513
*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:1535
const SIGINFO
SIGINFO.
Definition: ql_misc.dox.h:1501
*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.
binary parseHexString(string hexstr)
Parses a hex-encoded string and returns the binary object.
const SIGURG
SIGURG.
Definition: ql_misc.dox.h:1549
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:1523
const SIGSTKFLT
SIGSTKFLT.
Definition: ql_misc.dox.h:1531
*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:1481
*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:1547
const SIGQUIT
SIGQUIT.
Definition: ql_misc.dox.h:1527
*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:1559
const SIGPWR
SIGPWR.
Definition: ql_misc.dox.h:1525
const True
logical True
Definition: qc_qore.dox.h:94
const SIGIO
SIGIO.
Definition: ql_misc.dox.h:1505
const SIGCLD
SIGCLD.
Definition: ql_misc.dox.h:1487
const SIGUSR2
SIGUSR2.
Definition: ql_misc.dox.h:1553
*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:1555
*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:1533
const SIGTERM
SIGTERM.
Definition: ql_misc.dox.h:1537
const SIGALRM
SIGALRM.
Definition: ql_misc.dox.h:1479
*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:1541
const False
logical False
Definition: qc_qore.dox.h:92
const SIGCONT
SIGCONT.
Definition: ql_misc.dox.h:1489
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:1517
const SIGTTIN
SIGTTIN.
Definition: ql_misc.dox.h:1545
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:1511
const SIGCHLD
SIGCHLD.
Definition: ql_misc.dox.h:1485
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:1529
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:1491
list getFeatureList()
Returns a list of strings of the builtin and module-supplied features of Qore.
const SIGABRT
SIGABRT.
Definition: ql_misc.dox.h:1477
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:1567
*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:1495
*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:1521
const SIGXCPU
SIGXCPU.
Definition: ql_misc.dox.h:1561
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:1497
const SIGILL
SIGILL.
Definition: ql_misc.dox.h:1499
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:1509
const SIGTSTP
SIGTSTP.
Definition: ql_misc.dox.h:1543
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:1493
*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:1551
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:1557
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)
const SIGINT
SIGINT.
Definition: ql_misc.dox.h:1503
*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:1429
const SIGXFSZ
SIGXFSZ.
Definition: ql_misc.dox.h:1563
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:1507
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:1519
const SIGCANCEL
SIGCANCEL.
Definition: ql_misc.dox.h:1483
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:1565
const SIGTHAW
SIGTHAW.
Definition: ql_misc.dox.h:1539
const SIGLOST
SIGLOST.
Definition: ql_misc.dox.h:1515