Qore Programming Language Reference Manual
1.7.0
|
Methods in this pseudo-class can be executed on hash values. More...
Public Member Methods | |
bool | compareKeys (hash< auto > oh) |
Returns True if the hash argument passed has the same keys in the same order as the current hash, False if not. More... | |
bool | complexType () |
returns True if the hash has a complex type (Hashdecl: Type-Safe Hash Declarations or Hash With Declared Value Type), False if not More... | |
HashListIterator | contextIterator () |
Returns a HashListIterator object for the hash. More... | |
bool | empty () |
Returns True if the hash has no keys, False if it does. More... | |
*string | firstKey () |
Returns the first key name in the hash or NOTHING if the hash has no keys. More... | |
auto | firstValue () |
Returns the value assigned to the first key in the hash if any or NOTHING if the hash has no keys. More... | |
bool | hasKey (softstring key) |
Returns True if the key exists in the hash (may or may not be assigned a value), False if not. More... | |
bool | hasKeyValue (softstring key) |
Returns True if the key exists and is assigned to a value, False if not. More... | |
AbstractIterator | iterator () |
Returns a HashIterator object for the hash. More... | |
HashKeyIterator | keyIterator () |
Returns a HashKeyIterator object for the hash. More... | |
list< string > | keys () |
Returns a list of key names of the hash. More... | |
*string | lastKey () |
Returns the last key name in the hash or NOTHING if the hash has no keys. More... | |
auto | lastValue () |
Returns the value assigned to the last key in the hash if any or NOTHING if the hash has no keys. More... | |
HashPairIterator | pairIterator () |
Returns a HashPairIterator object for the hash. More... | |
int | size () |
Returns the number of keys in the hash. More... | |
bool | sizep () |
Returns True since hashes can return a non-zero size. More... | |
int | typeCode () |
Returns Qore::NT_HASH. More... | |
bool | val () |
Returns False if the hash has no keys, True if it does. More... | |
list< auto > | values () |
Returns a list of values of the hash. More... | |
Public Member Methods inherited from <value> | |
bool | callp () |
Returns False; this method is reimplemented in other types and will return True if the given expression is a callable value (ie closures or call references) More... | |
bool | complexType () |
returns True if the value has a complex type, False if not More... | |
bool | empty () |
Returns True; this method will be reimplemented in container types where it may return False. More... | |
string | fullType (*bool with_namespaces) |
returns the full type name which differs from the simple type name in case of complex types and objects More... | |
bool | intp () |
Returns False; this method is reimplemented in other types and will return True if the given expression can be converted to an integer. More... | |
AbstractIterator | iterator () |
Returns an iterator object for the value; the default iterator object returned is SingleValueIterator. More... | |
int | lsize () |
Returns 1; the return value of this method should give the list size of the value, which is normally 1 for non-lists (except for NOTHING where the size will be 0) and the number of the elements in the list for lists; this method will be reimplemented in other types where it may return other values. More... | |
int | size () |
Returns zero; this method will be reimplemented in container types where it may return a non-zero value. More... | |
bool | sizep () |
Returns True if the type can return a non-zero size (True for containers including binary objects and strings, False for everything else) More... | |
bool | strp () |
Returns False; this method is reimplemented in other types and will return True if the given expression can be converted to a string. More... | |
bool | toBool () |
Returns the boolean representation of the value; the default is False. More... | |
float | toFloat () |
Returns the floating-point representation of the value; the default is 0.0. More... | |
int | toInt () |
Returns the integer representation of the value; the default is 0. More... | |
number | toNumber () |
Returns the arbitrary-precision numeric representation of the value; the default is 0. More... | |
string | toString () |
Returns the string representation of the value; the default is an empty string. More... | |
string | type () |
Returns the string type for the value. More... | |
int | typeCode () |
Returns the type code for the value. More... | |
bool | val () |
Returns False; this method is reimplemented in other types and will return True if the given expression has a non-empty value. More... | |
Methods in this pseudo-class can be executed on hash values.
bool <hash>::compareKeys | ( | hash< auto > | oh | ) |
Returns True if the hash argument passed has the same keys in the same order as the current hash, False if not.
Values are not compraed, only the key names and order
oh | a hash to compare the keys against |
bool <hash>::complexType | ( | ) |
returns True if the hash has a complex type (Hashdecl: Type-Safe Hash Declarations or Hash With Declared Value Type), False if not
HashListIterator <hash>::contextIterator | ( | ) |
Returns a HashListIterator object for the hash.
bool <hash>::empty | ( | ) |
*string <hash>::firstKey | ( | ) |
Returns the first key name in the hash or NOTHING if the hash has no keys.
auto <hash>::firstValue | ( | ) |
Returns the value assigned to the first key in the hash if any or NOTHING if the hash has no keys.
bool <hash>::hasKey | ( | softstring | key | ) |
Returns True if the key exists in the hash (may or may not be assigned a value), False if not.
key | the key name to check |
bool <hash>::hasKeyValue | ( | softstring | key | ) |
Returns True if the key exists and is assigned to a value, False if not.
key | the key name to check |
AbstractIterator <hash>::iterator | ( | ) |
Returns a HashIterator object for the hash.
HashKeyIterator <hash>::keyIterator | ( | ) |
Returns a HashKeyIterator object for the hash.
Returns a list of key names of the hash.
*string <hash>::lastKey | ( | ) |
Returns the last key name in the hash or NOTHING if the hash has no keys.
auto <hash>::lastValue | ( | ) |
Returns the value assigned to the last key in the hash if any or NOTHING if the hash has no keys.
HashPairIterator <hash>::pairIterator | ( | ) |
Returns a HashPairIterator object for the hash.
int <hash>::size | ( | ) |
Returns the number of keys in the hash.
The opposite of <hash>::val()
bool <hash>::sizep | ( | ) |
Returns True since hashes can return a non-zero size.
int <hash>::typeCode | ( | ) |
Returns Qore::NT_HASH.
bool <hash>::val | ( | ) |
Returns False if the hash has no keys, True if it does.
The opposite of <hash>::empty()
list<auto> <hash>::values | ( | ) |
Returns a list of values of the hash.