Tizen Native API
4.0
|
Functions | |
Eina_Value * | eina_value_new (const Eina_Value_Type *type) |
Creates generic value storage. | |
void | eina_value_free (Eina_Value *value) |
Frees value and its data. | |
static Eina_Bool | eina_value_setup (Eina_Value *value, const Eina_Value_Type *type) |
Initializes generic value storage. | |
static void | eina_value_flush (Eina_Value *value) |
Creates generic value storage. | |
Eina_Bool | eina_value_copy (const Eina_Value *value, Eina_Value *copy) |
Copies generic value storage. | |
static int | eina_value_compare (const Eina_Value *a, const Eina_Value *b) |
Compares generic value storage. | |
static Eina_Bool | eina_value_set (Eina_Value *value,...) |
Sets the generic value. | |
static Eina_Bool | eina_value_get (const Eina_Value *value,...) |
Gets the generic value. | |
static Eina_Bool | eina_value_vset (Eina_Value *value, va_list args) |
Sets the generic value. | |
static Eina_Bool | eina_value_vget (const Eina_Value *value, va_list args) |
Gets the generic value. | |
static Eina_Bool | eina_value_pset (Eina_Value *value, const void *ptr) |
Sets the generic value from pointer. | |
static Eina_Bool | eina_value_pget (const Eina_Value *value, void *ptr) |
Gets the generic value to pointer. | |
Eina_Bool | eina_value_convert (const Eina_Value *value, Eina_Value *convert) |
Converts one value to another type. | |
char * | eina_value_to_string (const Eina_Value *value) |
Converts value to string. | |
static const Eina_Value_Type * | eina_value_type_get (const Eina_Value *value) |
Queries value type. |
static int eina_value_compare | ( | const Eina_Value * | a, |
const Eina_Value * | b | ||
) | [static] |
Compares generic value storage.
a | left side of comparison |
b | right side of comparison |
Eina_Bool eina_value_convert | ( | const Eina_Value * | value, |
Eina_Value * | convert | ||
) |
Converts one value to another type.
value | Source value object. |
convert | Destination value object. |
Converts one value to another trying first value type convert_to()
function. If unsuccessful, tries using convert_from()
function in convert.
Conversion functions are type defined, and the basic types can convert between themselves, but conversion is strict! That is, if converting from negative value to unsigned type, it will fail. It also fails on value overflow.
It is recommended that all types implement at least convert to string, used by eina_value_to_string().
Eina_Bool eina_value_copy | ( | const Eina_Value * | value, |
Eina_Value * | copy | ||
) |
Copies generic value storage.
value | Source value object |
copy | Destination value object |
The copy object is considered uninitialized and its existing contents are overwritten (just as if eina_value_flush() was called on it).
The copy happens by calling eina_value_setup() on copy, followed by getting the contents of value and setting it to copy.
static void eina_value_flush | ( | Eina_Value * | value | ) | [static] |
Creates generic value storage.
value | Value object |
Releases all the resources associated with an Eina_Value. The value must be already set with eina_value_setup() or eina_value_new().
After this call returns, the contents of the value are undefined, but the value can be reused by calling eina_value_setup() again.
void eina_value_free | ( | Eina_Value * | value | ) |
Frees value and its data.
value | value object |
static Eina_Bool eina_value_get | ( | const Eina_Value * | value, |
... | |||
) | [static] |
Gets the generic value.
value | Source value object |
The value is returned in the variable argument parameter, the actual value is type-dependent, but usually it will be what is stored inside the object. There shouldn't be any memory allocation, thus the contents should not be freed.
The variable argument is dependent on chosen type. The list for basic types:
Eina_Value *value = eina_value_new(EINA_VALUE_TYPE_INT); int x; const char *s; eina_value_set(value, 1234); eina_value_get(value, &x); eina_value_flush(value); eina_value_setup(value, EINA_VALUE_TYPE_STRING); eina_value_set(value, "hello world!"); eina_value_get(value, &s); eina_value_free(value);
Eina_Value* eina_value_new | ( | const Eina_Value_Type * | type | ) |
Creates generic value storage.
type | How to manage this value. |
NULL
on failure.Create a new generic value storage. The members are managed using the description specified by type.
Some types may specify more operations: eg. EINA_VALUE_TYPE_ARRAY uses eina_value_array_set(), eina_value_array_get() and so on.
On failure, NULL
is returned.
static Eina_Bool eina_value_pget | ( | const Eina_Value * | value, |
void * | ptr | ||
) | [static] |
Gets the generic value to pointer.
value | Source value object |
ptr | Pointer to receive the contents. |
The value is returned in pointer contents, the actual value is type-dependent, but usually it will be what is stored inside the object. There shouldn't be any memory allocation, thus the contents should not be freed.
The pointer type is dependent on chosen value type. The list for basic types:
Eina_Value *value = eina_value_new(EINA_VALUE_TYPE_INT); int x; const char *s; eina_value_set(value, 1234); eina_value_pget(value, &x); eina_value_flush(value); eina_value_setup(value, EINA_VALUE_TYPE_STRING); eina_value_set(value, "hello world!"); eina_value_pget(value, &s); eina_value_free(value);
static Eina_Bool eina_value_pset | ( | Eina_Value * | value, |
const void * | ptr | ||
) | [static] |
Sets the generic value from pointer.
value | Source value object |
ptr | Pointer to specify the contents. |
The pointer type is dependent on chosen value type. The list for basic types:
Eina_Value *value = eina_value_new(EINA_VALUE_TYPE_INT); int x = 567; const char *s = "hello world!"; eina_value_pset(value, &x); eina_value_flush(value); eina_value_setup(value, EINA_VALUE_TYPE_STRING); eina_value_pset(value, &s); eina_value_free(value);
static Eina_Bool eina_value_set | ( | Eina_Value * | value, |
... | |||
) | [static] |
Sets the generic value.
value | Source value object |
The variable argument is dependent on chosen type. The list for basic types:
Eina_Value *value = eina_value_new(EINA_VALUE_TYPE_INT); int x = 567; eina_value_set(value, 1234); eina_value_set(value, x); eina_value_flush(value); eina_value_setup(value, EINA_VALUE_TYPE_STRING); eina_value_set(value, "hello world!"); eina_value_free(value);
static Eina_Bool eina_value_setup | ( | Eina_Value * | value, |
const Eina_Value_Type * | type | ||
) | [static] |
Initializes generic value storage.
value | Value object |
type | How to manage this value. |
Initializes existing generic value storage. The members are managed using the description specified by type.
Some types may specify more operations, as an example EINA_VALUE_TYPE_ARRAY uses eina_value_array_set(), eina_value_array_get() and so on.
On failure, EINA_FALSE is returned.
char* eina_value_to_string | ( | const Eina_Value * | value | ) |
Converts value to string.
value | value object. |
NULL
on failure.static const Eina_Value_Type* eina_value_type_get | ( | const Eina_Value * | value | ) | [static] |
Queries value type.
value | Value object. |
NULL
if type is invalid.Check if value type is valid and returns it. A type is invalid if it does not exist or if it is using a different version field.
static Eina_Bool eina_value_vget | ( | const Eina_Value * | value, |
va_list | args | ||
) | [static] |
Gets the generic value.
value | Source value object |
args | Variable argument |
The value is returned in the variable argument parameter, the actual value is type-dependent, but usually it will be what is stored inside the object. There shouldn't be any memory allocation, thus the contents should not be freed.
static Eina_Bool eina_value_vset | ( | Eina_Value * | value, |
va_list | args | ||
) | [static] |
Sets the generic value.
value | Source value object |
args | Variable argument |