Qore Programming Language Reference Manual
0.8.11.1
|
Functions | |
string | Qore::backquote (string cmd, *reference rc) |
Executes a process and returns a string of the output (stdout only) More... | |
nothing | Qore::backquote () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
any | Qore::call_builtin_function (string name,...) |
Calls a function and returns the return value, passing the remaining arguments after the function name to the builtin function. More... | |
any | Qore::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 arguments for the function. More... | |
any | Qore::call_function (string name,...) |
Calls a function and returns the return value, passing the remaining arguments after the function name to the function. More... | |
any | Qore::call_function (code f,...) |
Calls the given call reference or closure and returns the result, passing the remaining arguments to the call reference or closure. More... | |
any | Qore::call_function_args (string name, *softlist vargs) |
Calls a function and returns the return value, using the optional second argument as a list of arguments for the function. More... | |
any | Qore::call_function_args (code f, *softlist vargs) |
Calls the given call reference or closure and returns the result, using the optional second argument as a list of arguments to the call reference or closure. More... | |
string | Qore::decode_url (string url) |
Decodes percent numeric codes in a URL string and returns the decoded string in UTF-8 encoding. More... | |
nothing | Qore::decode_url () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
string | Qore::encode_url (string url, softbool encode_all=False) |
Encodes URLs by substituting '%' characters with '%25' , spaces (' ') with '%20' , and non-ascii characters by percent-encoded representations. More... | |
bool | Qore::exists (...) |
A function performing the same role as the exists operator. More... | |
bool | Qore::existsFunction (string name) |
Returns True if the function exists in the current program's function name space. More... | |
bool | Qore::existsFunction (code c) |
Always returns True. More... | |
nothing | Qore::existsFunction () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
*string | Qore::functionType (string name) |
Returns "builtin" (for a builtin function), "user" (for a user function), or NOTHING (if the function cannot be found) according to the function name passed. More... | |
nothing | Qore::functionType () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
*int | Qore::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 offset is not legal for the given data. More... | |
nothing | Qore::getByte () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
*int | Qore::getByte (binary b, softint offset=0) |
Returns the byte value at the given byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data. More... | |
string | Qore::getClassName (object obj) |
Returns the class name of the object passed. More... | |
nothing | Qore::getClassName () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
list | Qore::getFeatureList () |
Returns a list of strings of the builtin and module-supplied features of Qore. More... | |
hash | Qore::getModuleHash () |
Returns a hash of hashes describing the currently-loaded Qore modules; the top-level hash keys are the module names. More... | |
list | Qore::getModuleList () |
Returns a list of hashes describing the currently-loaded Qore modules. More... | |
*int | Qore::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 NOTHING if the offset is not legal for the given data. More... | |
*int | Qore::getWord32 (binary b, softint offset=0) |
Returns the 32-bit integer value at the given 4-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data. More... | |
nothing | Qore::getWord32 () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
*int | Qore::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 offset is not legal for the given data. More... | |
*int | Qore::get_byte (binary b, softint offset=0) |
Returns the byte value at the given byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data. More... | |
string | Qore::get_default_encoding () |
Returns the name of the default character encoding. More... | |
string | Qore::get_ex_pos (hash ex) |
returns a descriptive string for an exception location; the source and offset information will also be included in the string returned if present in the exception hash argument More... | |
int | Qore::get_parse_options () |
returns the current parse options for the current Program object More... | |
hash | Qore::get_qore_library_info () |
Returns a hash of library build and version info. More... | |
hash | Qore::get_qore_option_hash () |
Returns a hash of hashes giving information about Qore library options for the current build. More... | |
list | Qore::get_qore_option_list () |
Returns a list of hashes giving information about Qore library options for the current build. More... | |
*string | Qore::get_script_dir () |
Returns the name of the directory from which the current script was executed or NOTHING if unknown (i.e. no parent script, script read from stdin, etc) More... | |
*string | Qore::get_script_name () |
Returns the filename of the current script if known or NOTHING if unknown (i.e. no parent script, script read from stdin, etc) More... | |
*string | Qore::get_script_path () |
Returns the path (directory and filename) of the current script or NOTHING if unknown (i.e. no parent script, script read from stdin, etc) More... | |
*int | Qore::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 NOTHING if the offset is not legal for the given data. More... | |
*int | Qore::get_word_16 (binary b, softint offset=0) |
Returns the 16-bit integer value at the given 2-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data. More... | |
*int | Qore::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 NOTHING if the offset is not legal for the given data. More... | |
*int | Qore::get_word_16_lsb (binary b, softint offset=0) |
Returns the 16-bit integer value at the given 2-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data. More... | |
*int | Qore::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 NOTHING if the offset is not legal for the given data. More... | |
*int | Qore::get_word_32 (binary b, softint offset=0) |
Returns the 32-bit integer value at the given 4-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data. More... | |
*int | Qore::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 NOTHING if the offset is not legal for the given data. More... | |
*int | Qore::get_word_32_lsb (binary b, softint offset=0) |
Returns the 32-bit integer value at the given 4-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data. More... | |
*int | Qore::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 NOTHING if the offset is not legal for the given data. More... | |
*int | Qore::get_word_64 (binary b, softint offset=0) |
Returns the 64-bit integer value at the given 8-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data. More... | |
*int | Qore::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 NOTHING if the offset is not legal for the given data. More... | |
*int | Qore::get_word_64_lsb (binary b, softint offset=0) |
Returns the 64-bit integer value at the given 8-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data. More... | |
bool | Qore::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); exceptions are only raised if string encoding errors are encountered. More... | |
bool | Qore::has_key (object obj, string key) |
Returns True if the given key exists in the object (does not necessarily have to have a value assigned); exceptions are only raised if string encoding errors are encountered or in case of object access errors. More... | |
list | Qore::hash_values (hash h) |
Returns a list of all the values in the hash argument passed. More... | |
nothing | Qore::hash_values () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
int | Qore::hextoint (string str) |
Returns an integer for a hexadecimal string value; throws an exception if non-hex digits are found. More... | |
nothing | Qore::hextoint () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
string | Qore::html_decode (string str) |
Returns a string with any HTML escape codes translated to the original characters. More... | |
nothing | Qore::html_decode () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
string | Qore::html_encode (string str) |
Returns a string with characters needing HTML escaping translated to HTML escape codes. More... | |
nothing | Qore::html_encode () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
nothing | Qore::load_module (string name) |
Loads in a Qore module at run-time. More... | |
nothing | Qore::load_module () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
string | Qore::makeBase64String (string str, softint maxlinelen=-1) |
Returns a base64-encoded representation of a string. More... | |
string | Qore::makeBase64String (binary bin, softint maxlinelen=-1) |
Returns a base64-encoded representation of a binary object. More... | |
nothing | Qore::makeBase64String () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
string | Qore::makeHexString (string str) |
Returns a hex-encoded representation of a string. More... | |
string | Qore::makeHexString (binary bin) |
Returns a hex-encoded representation of a binary object. More... | |
nothing | Qore::makeHexString () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
*hash | Qore::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. More... | |
nothing | Qore::parse () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
binary | Qore::parseBase64String (string str) |
Parses a base64 encoded string and returns a binary object of the decoded data. More... | |
nothing | Qore::parseBase64String () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
string | Qore::parseBase64StringToString (string str, *string encoding) |
Parses a base64 encoded string and returns a string of the decoded data. More... | |
nothing | Qore::parseBase64StringToString () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
binary | Qore::parseHexString (string hexstr) |
Parses a hex-encoded string and returns the binary object. More... | |
nothing | Qore::parseHexString () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
*hash | Qore::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 returned. More... | |
nothing | Qore::parseURL () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
hash | Qore::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 parsed as a URL. More... | |
string | Qore::splice (string str) |
This function always returns an empty string "" . More... | |
string | Qore::splice (string str, softint start) |
Returns a string based on the argument string but with characters removed from a certain character index. More... | |
string | Qore::splice (string str, softint start, softint len, *string nstr) |
Returns a string based on the argument string but optionally with characters removed and/or added from a certain character index. More... | |
list | Qore::splice (list l, softint start) |
Returns a list based on the argument list but with elements removed from the given index to the end of the list. More... | |
list | Qore::splice (list l, softint start, softint len, *softlist nlist) |
Returns a list based on the argument list but optionally with elements removed and/or added from a certain index. More... | |
nothing | Qore::splice () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
int | Qore::strtoint (string num, softint base=10) |
parses a string representing a number in a configurable base and returns the integer More... | |
nothing | Qore::strtoint () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
Miscellaneous functions
string Qore::backquote | ( | string | cmd, |
*reference | rc | ||
) |
Executes a process and returns a string of the output (stdout only)
cmd | The shell command to executed as a subprocess |
rc | an optional reference to an integer to return the return code of the process |
BACKQUOTE-ERROR | An error occurred with the fork() or opening the stdout pipe |
nothing Qore::backquote | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
any Qore::call_builtin_function | ( | string | name, |
... | |||
) |
Calls a function and returns the return value, passing the remaining arguments after the function name to the builtin function.
name | The name of the builtin function to call |
... | Any optional arguments to the function |
INVALID-FUNCTION-ACCESS | Parse options do not allow access to the function |
NO-FUNCTION | The function does not exist |
any Qore::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 arguments for the function.
name | The name of the builtin function to call |
vargs | Optionally a single argument to the function or a list of arguments to the function |
INVALID-FUNCTION-ACCESS | Parse options do not allow access to the function |
NO-FUNCTION | The function does not exist |
any Qore::call_function | ( | string | name, |
... | |||
) |
Calls a function and returns the return value, passing the remaining arguments after the function name to the function.
name | The name of the function to call |
... | Any optional arguments to the function |
INVALID-FUNCTION-ACCESS | Parse options do not allow access to the function |
NO-FUNCTION | The function does not exist |
any Qore::call_function | ( | code | f, |
... | |||
) |
Calls the given call reference or closure and returns the result, passing the remaining arguments to the call reference or closure.
f | The call reference or closure |
... | Any optional arguments to the call reference or closure |
any Qore::call_function_args | ( | string | name, |
*softlist | vargs | ||
) |
Calls a function and returns the return value, using the optional second argument as a list of arguments for the function.
name | The name of the function to call |
vargs | Optionally a single argument to the function or a list of arguments to the function |
INVALID-FUNCTION-ACCESS | Parse options do not allow access to the function |
NO-FUNCTION | The function does not exist |
any Qore::call_function_args | ( | code | f, |
*softlist | vargs | ||
) |
Calls the given call reference or closure and returns the result, using the optional second argument as a list of arguments to the call reference or closure.
f | The call reference or closure |
vargs | Optionally a single argument to the call reference or closure or a list of arguments to the call reference or closure |
string Qore::decode_url | ( | string | url | ) |
Decodes percent numeric codes in a URL string and returns the decoded string in UTF-8 encoding.
url | a URL string with percent-encodings to decode |
nothing Qore::decode_url | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
string Qore::encode_url | ( | string | url, |
softbool | encode_all = False |
||
) |
Encodes URLs by substituting '%'
characters with '%25'
, spaces ('
') with '%20'
, and non-ascii characters by percent-encoded representations.
url | a URL string to encode |
encode_all | if True, then in addition to '%' , spaces (' '), and non-ascii characters the following reserved characters (according to RFC 3986 are also encoded: '!' , '*' , '\'' , ' (', ' )', ' ;', ' :', '@' , '&' , '=' , '+' , '$' , ' ,', '/' , ' ?', '#' , ' [', ' ]' |
bool Qore::exists | ( | ... | ) |
A function performing the same role as the exists operator.
... | if only a single argument is passed, then this function returns True if the single argument exists, False if not; otherwise is multiple arguments are passed to the function, it always returns True; this is to emulate the behavior of the exists operator |
bool Qore::existsFunction | ( | string | name | ) |
bool Qore::existsFunction | ( | code | c | ) |
Always returns True.
This function variant is included for backwards-compatibility
c | a call reference or closure: |
nothing Qore::existsFunction | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
*string Qore::functionType | ( | string | name | ) |
Returns "builtin"
(for a builtin function), "user"
(for a user function), or NOTHING (if the function cannot be found) according to the function name passed.
name | The function name to check |
"builtin"
(for a builtin function), "user"
(for a user function), or NOTHING (if the function cannot be found) according to the function name passednothing Qore::functionType | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
*int Qore::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 offset is not legal for the given data.
str | the string data to process |
offset | the byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::get_byte | ( | binary | b, |
softint | offset = 0 |
||
) |
Returns the byte value at the given byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data.
b | the data to process |
offset | the byte offset of the data to retrieve (the first value is at offset 0) |
string Qore::get_default_encoding | ( | ) |
Returns the name of the default character encoding.
string Qore::get_ex_pos | ( | hash | ex | ) |
returns a descriptive string for an exception location; the source
and offset
information will also be included in the string returned if present in the exception hash argument
ex | an exception hash |
"sftp-poller.q:140"
)int Qore::get_parse_options | ( | ) |
returns the current parse options for the current Program object
hash Qore::get_qore_library_info | ( | ) |
Returns a hash of library build and version info.
PlatformOS:
The operating system used to build the Qore libraryPlatformCPU:
The CPU used as a target for the Qore library buildVersionString:
The full version string for this version of the Qore libraryVersionMajor:
An integer giving the Qore library's major version numberVersionMinor:
An integer giving the Qore library's minor version numberVersionSub:
An integer giving the Qore library's release version numberBuild:
An integer giving the Qore library's subversion revision numberBuildHost:
A string giving information about the host used to compile the Qore libraryCompiler:
The compiler used to build the Qore libraryModuleDir:
The module directory assumed by default in the Qore libraryCFLAGS:
The compiler flags used to compile the Qore libraryLDFLAGS:
The linker flags used to link the Qore libraryhash Qore::get_qore_option_hash | ( | ) |
Returns a hash of hashes giving information about Qore library options for the current build.
option:
The string description of the optionconstant:
A string giving the name of the constant that has the boolean value for this option (equal to the hash key name)type:
The type of optionvalue:
The boolean value of the optionlist Qore::get_qore_option_list | ( | ) |
Returns a list of hashes giving information about Qore library options for the current build.
option:
The string description of the optionconstant:
A string giving the name of the constant that has the boolean value for this optiontype:
The type of optionvalue:
The boolean value of the option*string Qore::get_script_dir | ( | ) |
Returns the name of the directory from which the current script was executed or NOTHING if unknown (i.e. no parent script, script read from stdin, etc)
*string Qore::get_script_name | ( | ) |
Returns the filename of the current script if known or NOTHING if unknown (i.e. no parent script, script read from stdin, etc)
*string Qore::get_script_path | ( | ) |
Returns the path (directory and filename) of the current script or NOTHING if unknown (i.e. no parent script, script read from stdin, etc)
*int Qore::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 NOTHING if the offset is not legal for the given data.
This function assumes MSB byte order when retrieving the value from the data
str | the string data to process |
offset | the 2-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::get_word_16 | ( | binary | b, |
softint | offset = 0 |
||
) |
Returns the 16-bit integer value at the given 2-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data.
This function assumes MSB byte order when retrieving the value from the data
b | the data to process |
offset | the 2-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::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 NOTHING if the offset is not legal for the given data.
This function assumes LSB byte order when retrieving the value from the data
str | the string data to process |
offset | the 2-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::get_word_16_lsb | ( | binary | b, |
softint | offset = 0 |
||
) |
Returns the 16-bit integer value at the given 2-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data.
This function assumes LSB byte order when retrieving the value from the data
b | the data to process |
offset | the 2-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::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 NOTHING if the offset is not legal for the given data.
This function assumes MSB byte order when retrieving the value from the data
str | the string data to process |
offset | the 4-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::get_word_32 | ( | binary | b, |
softint | offset = 0 |
||
) |
Returns the 32-bit integer value at the given 4-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data.
This function assumes MSB byte order when retrieving the value from the data
b | the data to process |
offset | the 4-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::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 NOTHING if the offset is not legal for the given data.
This function assumes LSB byte order when retrieving the value from the data
str | the string data to process |
offset | the 4-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::get_word_32_lsb | ( | binary | b, |
softint | offset = 0 |
||
) |
Returns the 32-bit integer value at the given 4-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data.
This function assumes LSB byte order when retrieving the value from the data
b | the data to process |
offset | the 4-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::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 NOTHING if the offset is not legal for the given data.
This function assumes MSB byte order when retrieving the value from the data
str | the string data to process |
offset | the 8-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::get_word_64 | ( | binary | b, |
softint | offset = 0 |
||
) |
Returns the 64-bit integer value at the given 8-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data.
This function assumes MSB byte order when retrieving the value from the data
b | the data to process |
offset | the 8-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::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 NOTHING if the offset is not legal for the given data.
This function assumes LSB byte order when retrieving the value from the data
str | the string data to process |
offset | the 8-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::get_word_64_lsb | ( | binary | b, |
softint | offset = 0 |
||
) |
Returns the 64-bit integer value at the given 8-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data.
This function assumes LSB byte order when retrieving the value from the data
b | the data to process |
offset | the 8-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::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 offset is not legal for the given data.
str | the string data to process |
offset | the byte offset of the data to retrieve (the first value is at offset 0) |
nothing Qore::getByte | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
*int Qore::getByte | ( | binary | b, |
softint | offset = 0 |
||
) |
Returns the byte value at the given byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data.
b | the data to process |
offset | the byte offset of the data to retrieve (the first value is at offset 0) |
string Qore::getClassName | ( | object | obj | ) |
Returns the class name of the object passed.
obj | the object to get the class name of |
nothing Qore::getClassName | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
list Qore::getFeatureList | ( | ) |
Returns a list of strings of the builtin and module-supplied features of Qore.
hash Qore::getModuleHash | ( | ) |
Returns a hash of hashes describing the currently-loaded Qore modules; the top-level hash keys are the module names.
filename:
the path to the modulename:
the name of the moduledesc:
the description of the moduleversion:
the version of the moduleauthor:
the author of the moduleapi_major:
the major number of the Qore module API version the module supportapi_minor:
the minor number of the Qore module API version the module supporturl:
the module's URLlicense:
the module's licenselist Qore::getModuleList | ( | ) |
Returns a list of hashes describing the currently-loaded Qore modules.
filename:
the path to the modulename:
the name of the moduledesc:
the description of the moduleversion:
the version of the moduleauthor:
the author of the moduleapi_major:
the major number of the Qore module API version the module supportapi_minor:
the minor number of the Qore module API version the module supporturl:
the module's URLlicense:
the module's license*int Qore::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 NOTHING if the offset is not legal for the given data.
This function assumes MSB byte order when retrieving the value from the data
str | the string data to process |
offset | the 4-byte offset of the data to retrieve (the first value is at offset 0) |
*int Qore::getWord32 | ( | binary | b, |
softint | offset = 0 |
||
) |
Returns the 32-bit integer value at the given 4-byte offset (the first value is at offset 0) or NOTHING if the offset is not legal for the given data.
This function assumes MSB byte order when retrieving the value from the data
b | the data to process |
offset | the 4-byte offset of the data to retrieve (the first value is at offset 0) |
nothing Qore::getWord32 | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
bool Qore::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); exceptions are only raised if string encoding errors are encountered.
h | the hash to check |
key | the key name to check; this value will be converted to the default character encoding to check the hash |
ENCODING-CONVERSION-ERROR | this error is thrown if the given key cannot be converted to the default character encoding |
bool Qore::has_key | ( | object | obj, |
string | key | ||
) |
Returns True if the given key exists in the object (does not necessarily have to have a value assigned); exceptions are only raised if string encoding errors are encountered or in case of object access errors.
ENCODING-CONVERSION-ERROR | this error is thrown if the given key cannot be converted to the default character encoding |
list Qore::hash_values | ( | hash | h | ) |
Returns a list of all the values in the hash argument passed.
h | a hash to get all the values of |
nothing Qore::hash_values | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
int Qore::hextoint | ( | string | str | ) |
Returns an integer for a hexadecimal string value; throws an exception if non-hex digits are found.
str | a string of hexadecimal digits (like "6d4f84e0" ; with or without leading "x" or "0x" ) |
PARSE-HEX-ERROR | invalid hex digit found |
nothing Qore::hextoint | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
string Qore::html_decode | ( | string | str | ) |
Returns a string with any HTML escape codes translated to the original characters.
str | the argument to decode |
nothing Qore::html_decode | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
string Qore::html_encode | ( | string | str | ) |
Returns a string with characters needing HTML escaping translated to HTML escape codes.
str | the argument to process |
nothing Qore::html_encode | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
nothing Qore::load_module | ( | string | name | ) |
Loads in a Qore module at run-time.
If a feature with the same name already exists, then this feature's code is imported into the current Program object if necessary and no further action is taken.
Note that modules providing objects resolved at parse time (classes, constants, functions, etc) must be loaded with the %requires directive instead, unless all references to the objects provided by the module will be made in code embedded in child Program objects.
name | either a feature name (a module will be searched with this feature name) or a path to a module to load |
LOAD-MODULE-ERROR | module cannot be loaded: API incompatibility, module defines symbols already defined in the target object, etc |
nothing Qore::load_module | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
string Qore::makeBase64String | ( | string | str, |
softint | maxlinelen = -1 |
||
) |
Returns a base64-encoded representation of a string.
Implementation based on RFC-1421 and RFC-2045
str | the string to encode |
maxlinelen | the maximum length of a line in the resulting output string in bytes; if this value is > 0 then output lines will be separated by CRLF characters |
string Qore::makeBase64String | ( | binary | bin, |
softint | maxlinelen = -1 |
||
) |
Returns a base64-encoded representation of a binary object.
Implementation based on RFC-1421 and RFC-2045
bin | the data to encode |
maxlinelen | the maximum length of a line in the resulting output string in bytes; if this value is > 0 then output lines will be separated by CRLF characters |
nothing Qore::makeBase64String | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
string Qore::makeHexString | ( | string | str | ) |
Returns a hex-encoded representation of a string.
str | the string to encode |
string Qore::makeHexString | ( | binary | bin | ) |
Returns a hex-encoded representation of a binary object.
bin | the binary object to encode |
nothing Qore::makeHexString | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
*hash Qore::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.
code | the string of Qore source code to parse; the parsed code will be added to the current program |
label | a label identifying the code or the code's source |
warning_mask | An optional warning mask; see Warning Constants for values to combine by binary-or; if this arguments is 0 or not given then no warnings will be checked or issued and the return value will always be NOTHING |
source | An optional source file name for the code being parsed; this is useful if sections of a file are parsed |
offset | An optional line offset for use with the source parameter; this gives the line offset in the file to the code being parsed |
format_label | If this argument is True, then the label is formatted as "<run-time-loaded: label>" ; if False, then it is passed as-is |
nothing Qore::parse | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
hash Qore::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 parsed as a URL.
url | the URL to parse (ex: "https://user:pass@host:8080/path" ); either a hostname or path is required at a minimum or a PARSE-URL-ERROR exception is raised |
keep_brackets | if this argument is true then if the hostname or address is enclosed in square brackets, then the brackets will be included in the "host" key output as well; square brackets are used by some Qore methods to denote IPv6 addresses; for example see Socket::connect() |
"host"
or the "path"
keys will always be returned if no PARSE-URL-ERROR
is raised):protocol:
the scheme in the URL (ex: "http"
)path:
any path given in the URL; the path will be prefixed by "/"
if a hostname is found in the URL argument string, otherwise it will not if it was not given as such in the argument stringusername:
any username given in the URLpassword:
any password given in the URLhost:
any hostname given in the URL; note that this key will be given if no other information can be found in the URL argument and the URL argument string has no "/"
characters; depending on the usage context for this function, this may actually be a filenameport:
any port number given in the URLPARSE-URL-ERROR | The URL string given could not be parsed |
scheme://socket=<url_encoded_path>/path
, where url_encoded_path
is a path with URL-encoding as performed by encode_url(); for example: "http://socket=%2ftmp%socket-dir%2fsocket-file-1/url/path"
; this allows a filesystem path to be used in the host portion of the URL and for the URL to include a URL path as well.binary Qore::parseBase64String | ( | string | str | ) |
Parses a base64 encoded string and returns a binary object of the decoded data.
Implementation based on RFC-1421 and RFC-2045
str | the base64-encoded input data to decode |
BASE64-PARSE-ERROR | A syntax error occurred parsing the base64 string (invalid character, etc) |
nothing Qore::parseBase64String | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
string Qore::parseBase64StringToString | ( | string | str, |
*string | encoding | ||
) |
Parses a base64 encoded string and returns a string of the decoded data.
Implementation based on RFC-1421 and RFC-2045
str | the base64-encoded input data to decode |
encoding | the character encoding tag for the string return value; if not present, the default character encoding is assumed. |
BASE64-PARSE-ERROR | A syntax error occurred parsing the base64 string (invalid character, etc) |
nothing Qore::parseBase64StringToString | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
binary Qore::parseHexString | ( | string | hexstr | ) |
Parses a hex-encoded string and returns the binary object.
hexstr | a string of an even-number of only hexadecimal digits |
PARSE-HEX-ERROR | A syntax error occurred parsing the hex string (odd number of digits, invalid hex character, etc) |
nothing Qore::parseHexString | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
*hash Qore::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 returned.
url | the URL to parse (ex: "https://user:pass@host:8080/path" ); either a hostname or path is required at a minimum or the function will return NOTHING |
keep_brackets | if this argument is true then if the hostname or address is enclosed in square brackets, then the brackets will be included in the "host" key output as well; square brackets are used by some Qore methods to denote IPv6 addresses; for example see Socket::connect() |
"host"
or the "path"
keys will always be returned if a hash is returned):protocol:
the scheme in the URL (ex: "http"
)path:
any path given in the URL; the path will be prefixed by "/"
if a hostname is found in the URL argument string, otherwise it will not if it was not given as such in the argument stringusername:
any username given in the URLpassword:
any password given in the URLhost:
any hostname given in the URL; note that this key will be given if no other information can be found in the URL argument and the URL argument string has no "/"
characters; depending on the usage context for this function, this may actually be a filenameport:
any port number given in the URLscheme://socket=<url_encoded_path>/path
, where url_encoded_path
is a path with URL-encoding as performed by encode_url(); for example: "http://socket=%2ftmp%socket-dir%2fsocket-file-1/url/path"
; this allows a filesystem path to be used in the host portion of the URL and for the URL to include a URL path as well.nothing Qore::parseURL | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
string Qore::splice | ( | string | str | ) |
This function always returns an empty string ""
.
This function variant is included for backwards-compatibility
str | no action is taken on the argument |
""
string Qore::splice | ( | string | str, |
softint | start | ||
) |
Returns a string based on the argument string but with characters removed from a certain character index.
An exception can only be thrown here if an invalid multi-byte encoding is found
str | the string to process |
start | the character index (where the first character is 0) to start removing characters; if this value is negative, it gives the offset from the end of the string |
string Qore::splice | ( | string | str, |
softint | start, | ||
softint | len, | ||
*string | nstr | ||
) |
Returns a string based on the argument string but optionally with characters removed and/or added from a certain character index.
An exception can only be thrown here if an invalid multi-byte encoding is found
str | the string to process |
start | the character index (where the first character is 0) to start removing (and/or adding) characters; if this value is negative, it gives the offset from the end of the string |
len | the number of characters to remove; if this argument is 0 then no characters are removed; if this value is negative, then it gives an offset from the end of the string (ie -2 means remove all characters up to but not including the two last characters) |
nstr | the optional string for inserting new characters |
list Qore::splice | ( | list | l, |
softint | start | ||
) |
Returns a list based on the argument list but with elements removed from the given index to the end of the list.
Exceptions can only be thrown here if objects are removed from the list and this causes them to go out of scope and an exception is thrown in one of the destructors
l | the list to process |
start | the starting element (where the first element is 0) to start removing elements; if this value is negative, it gives the offset from the end of the list |
list Qore::splice | ( | list | l, |
softint | start, | ||
softint | len, | ||
*softlist | nlist | ||
) |
Returns a list based on the argument list but optionally with elements removed and/or added from a certain index.
Exceptions can only be thrown here if objects are removed from the list and this causes them to go out of scope and an exception is thrown in one of the destructors
l | the list to process |
start | the starting element (where the first element is 0) to start removing (and/or adding) elements; if this value is negative, it gives the offset from the end of the list |
len | the number of list elements to remove; if this argument is 0 then no elements are removed; if this value is negative, then it gives an offset from the end of the list (ie -2 means remove all elements up to but not including the two last elements) |
nlist | the optional list for inserting new elements |
nothing Qore::splice | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
int Qore::strtoint | ( | string | num, |
softint | base = 10 |
||
) |
parses a string representing a number in a configurable base and returns the integer
num | a string representing a number |
base | the base of the number |
STRTOINT-ERROR | cannot parse string; unsupported base, etc |
nothing Qore::strtoint | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.