An Embeddable NoSQL Database Engine |
Tweet |
Follow @unqlite_db |
UnQLite C/C++ API Reference - UnQLite Object Values Type.
int unqlite_value_is_int(unqlite_value *pVal);
int unqlite_value_is_float(unqlite_value *pVal);
int unqlite_value_is_bool(unqlite_value *pVal);
int unqlite_value_is_string(unqlite_value *pVal);
int unqlite_value_is_null(unqlite_value *pVal);
int unqlite_value_is_numeric(unqlite_value *pVal);
int unqlite_value_is_callable(unqlite_value *pVal);
int unqlite_value_is_scalar(unqlite_value *pVal);
int unqlite_value_is_json_array(unqlite_value *pVal);
int unqlite_value_is_json_object(unqlite_value *pVal);
int unqlite_value_is_resource(unqlite_value *pVal);
int unqlite_value_is_empty(unqlite_value *pVal);
Check if the given value object is of the expected type.
Description
As their name suggests, these routines returns TRUE (1) if the given unqlite_value is of the expected type. For example unqlite_value_is_int() return TRUE only if the given unqlite_value is of type integer, unqlite_value_is_string() return TRUE only if the given unqlite_value is of type string and so forth.
Note that these routines does not perform any conversion. If such behavior is wanted, please use unqlite_value_to_string(), unqlite_value_to_int(), etc. instead.
These routines are useful inside foreign functions to make sure that the given arguments are of the expected type.
The unqlite_value_is_callable() interface does not check for a type but instead check if the given unqlite_value is a callback. That is, a function that can be called from the target Jx9 code.
Parameters
pValue |
A pointer to a unqlite_value. |
Return value
These routines returns 1 (TRUE) if the given unqlite_value is of the expected type. 0 (FALSE) otherwise.
Example
Compile this C file for a smart introduction to these interfaces.
See also
On Demand Object Allocation, Populating UnQLite Object Values, Setting the Result of a Foreign Function, Obtaining UnQLite Object Values.