Qore Programming Language Reference Manual
1.12.2
|
Modules | |
String Type Constants | |
Functions | |
auto | Qore::auto_cast (auto val) |
Returns complex types converted to the most specific types possible using internal type folding. More... | |
binary | Qore::binary () |
Always returns an empty binary object (of zero length) More... | |
binary | Qore::binary (null x) |
Always returns an empty binary object (of zero length) More... | |
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. More... | |
binary | Qore::binary (binary bin) |
Always returns the same binary object passed. More... | |
string | Qore::binary_to_string (binary b, *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. More... | |
bool | Qore::boolean (any arg) |
Converts the argument to a boolean value. More... | |
float | Qore::float (softfloat f) |
Converts the argument to a floating-point (float) value. More... | |
float | Qore::float () |
Always returns 0.0. More... | |
hash< auto > | Qore::hash (object obj) |
Returns a hash of an object's members. More... | |
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. More... | |
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. More... | |
hash | Qore::hash (hash h) |
Returns the same hash with all complex types stripped. More... | |
hash< auto > | Qore::hash () |
Always returns the same hash passed. More... | |
int | Qore::int (string str, int base=10) |
Converts the string to an integer value with respect to the base. More... | |
int | Qore::int (softint i) |
Converts the argument to an integer value. More... | |
int | Qore::int () |
Always returns 0. More... | |
list< auto > | Qore::list (...) |
Returns a list of the arguments passed at the top level. More... | |
number | Qore::number (softnumber n) |
Converts the argument to a number value. More... | |
number | Qore::number () |
Always returns 0.0. More... | |
string | Qore::string (softstring str, *string enc) |
Converts the argument to a string. More... | |
string | Qore::string () |
Always returns an empty string. More... | |
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. More... | |
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. More... | |
auto Qore::auto_cast | ( | auto | val | ) |
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 |
bool Qore::boolean | ( | any | arg | ) |
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 | ) |
hash<auto> Qore::hash | ( | ) |
hash Qore::hash | ( | hash | h | ) |
Returns the same hash with all complex types stripped.
h | the hash to return |
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.
l | the list to process in a manner similar to perl's hash initialization |
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 |
hash<auto> Qore::hash | ( | object | obj | ) |
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, |
*string | enc | ||
) |
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.
arg | the argument to check |
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.
arg | the argument to check |