Qore Programming Language Reference Manual 2.0.0
|
Functions | |
auto | Qore::auto_cast (auto val) |
Returns complex types converted to the most specific types possible using internal type folding. | |
binary | Qore::binary () |
Always returns an empty binary object (of zero length) | |
binary | Qore::binary (null x) |
Always returns an empty binary object (of zero length) | |
binary | Qore::binary (softstring str) |
Returns a binary data type of the string passed; data types other than string will first be converted to a string and then returned as binary data. | |
binary | Qore::binary (binary bin) |
Always returns the same binary object passed. | |
string | Qore::binary_to_string (binary b, __7_ string encoding) |
Returns a string created from the binary data passed, taking an optional second argument giving the string encoding; if no second argument is passed then the default character encoding is assumed. | |
bool | Qore::boolean (any arg) |
Converts the argument to a boolean value. | |
float | Qore::float (softfloat f) |
Converts the argument to a floating-point (float) value. | |
float | Qore::float () |
Always returns 0.0. | |
hash< auto > | Qore::hash (object obj) |
Returns a hash of an object's members. | |
hash< auto > | Qore::hash (list< auto > l) |
Returns a hash by taking even numbered list elements (starting with 0) and converting them to strings for the hash keys, and the odd numbered elements following the keys as the key value. | |
hash< auto > | Qore::hash (list< softstring > keys, list< auto > values) |
Returns a hash by taking the first list as a list of keys, and the second list as a list of values. | |
hash | Qore::hash (hash h) |
Returns the same hash with all complex types stripped. | |
hash< auto > | Qore::hash () |
Always returns the same hash passed. | |
int | Qore::int (string str, int base=10) |
Converts the string to an integer value with respect to the base. | |
int | Qore::int (softint i) |
Converts the argument to an integer value. | |
int | Qore::int () |
Always returns 0. | |
list< auto > | Qore::list (...) |
Returns a list of the arguments passed at the top level. | |
number | Qore::number (softnumber n) |
Converts the argument to a number value. | |
number | Qore::number () |
Always returns 0.0. | |
string | Qore::string (softstring str, __7_ string enc) |
Converts the argument to a string. | |
string | Qore::string () |
Always returns an empty string. | |
string | Qore::type (auto arg) |
Returns a string giving the data type of the argument passed; see String Type Constants for the values returned by this function. | |
string | Qore::typename (auto arg) |
Returns a string giving the data type of the argument passed; see String Type Constants for the values returned by this function. | |
Returns complex types converted to the most specific types possible using internal type folding.
val | the value to convert |
binary Qore::binary | ( | ) |
binary Qore::binary | ( | binary | bin | ) |
binary Qore::binary | ( | null | x | ) |
Always returns an empty binary object (of zero length)
The binary() function is used for type conversions, therefore this variant is not tagged with NOOP
binary Qore::binary | ( | softstring | str | ) |
Returns a binary data type of the string passed; data types other than string will first be converted to a string and then returned as binary data.
This function is useful if, for example, a string type actually contains binary data; using this function will ensure that all data in the string (even if it contains embedded nulls) is maintained in the binary object (Qore strings must normally be terminated by a single null, so some Qore string operations do not work on binary data with embedded nulls).
Returns a string created from the binary data passed, taking an optional second argument giving the string encoding; if no second argument is passed then the default character encoding is assumed.
b | the binary object to convert directly to a string |
encoding | the character encoding tag for the string return value; if not present, the default character encoding is assumed |
Converts the argument to a boolean value.
arg | the argument to convert to a boolean |
float Qore::float | ( | ) |
Always returns 0.0.
The float() function is used for type conversions, therefore this variant is not tagged with NOOP
float Qore::float | ( | softfloat | f | ) |
Converts the argument to a floating-point (float) value.
f | the argument to convert to a float |
hash< auto > Qore::hash | ( | ) |
hash Qore::hash | ( | hash | h | ) |
Returns the same hash with all complex types stripped.
h | the hash to return |
Returns a hash by taking even numbered list elements (starting with 0) and converting them to strings for the hash keys, and the odd numbered elements following the keys as the key value.
l | the list to process in a manner similar to perl's hash initialization |
hash< auto > Qore::hash | ( | list< softstring > | keys, |
list< auto > | values | ||
) |
Returns a hash by taking the first list as a list of keys, and the second list as a list of values.
If the two lists are of unequal sizes, then the keys list takes precedence (if the values list is longer, excess values are ignored, if the keys list is longer, then excess elements are assigned NOTHING)
keys | a list of key values for the hash |
values | a list of values for the hash, corresponding to the elements in keys |
Returns a hash of an object's members.
obj | the object to process |
int Qore::int | ( | ) |
Always returns 0.
The int() function is used for type conversions, therefore this variant is not tagged with NOOP
int Qore::int | ( | softint | i | ) |
Converts the argument to an integer value.
i | the argument to convert to an integer |
int Qore::int | ( | string | str, |
int | base = 10 |
||
) |
Converts the string to an integer value with respect to the base.
If a character is out of range of the corresponding base only the substring preceeding the character is taken into account.
Base 0 means to interpret as a code literal, so that the actual base is 8, 10, or 16.
(Does the same as <string>::toInt(int base)).
str | the string to convert to an integer |
base | the base of the integer in the string; this value must be 0 or 2 - 36 inclusive or an INVALID-BASE exception will be thrown |
INVALID-BASE | the base is invalid; must be 0 or 2 - 36 inclusive |
list< auto > Qore::list | ( | ... | ) |
Returns a list of the arguments passed at the top level.
... | the arguments that will be returned as a list |
number Qore::number | ( | ) |
Always returns 0.0.
The number() function is used for type conversions, therefore this variant is not tagged with NOOP
number Qore::number | ( | softnumber | n | ) |
string Qore::string | ( | ) |
string Qore::string | ( | softstring | str, |
__7_ string | enc | ||
) |
Converts the argument to a string.
str | the argument to convert to a string |
enc | the encoding of the string returned |
enc
argument was added in Qore 0.8.12 Returns a string giving the data type of the argument passed; see String Type Constants for the values returned by this function.
arg | the argument to check |
Returns a string giving the data type of the argument passed; see String Type Constants for the values returned by this function.
arg | the argument to check |