Tizen Native API  6.5
Generic Value Storage

Abstracts generic data storage and access to it in an extensible and efficient way.

It comes with pre-defined types for numbers, arrays, lists, hashes, blobs and structs. It is able to convert between data types, including to string.

It is meant for simple data types, providing uniform access and release functions, useful to exchange data preserving their types. For more complex hierarchical data, with properties and children, reference counting, inheritance and interfaces,

Examples of usage of the Eina_Value API:

Typedefs

typedef struct _Eina_Value Eina_Value
typedef struct _Eina_Value_Type Eina_Value_Type
typedef union _Eina_Value_Union Eina_Value_Union

Defines

#define EINA_VALUE_EMPTY   ((Eina_Value){ NULL, { { 0, 0, 0, 0, 0, 0, 0, 0 } } })

Define Documentation

#define EINA_VALUE_EMPTY   ((Eina_Value){ NULL, { { 0, 0, 0, 0, 0, 0, 0, 0 } } })

This is simply a value with all memory zeroed. It may be used to safely initialize or return a value without a type.

Since (EFL) :
1.21

Typedef Documentation

Store generic values.

Since (EFL) :
1.2

Describes the data contained by the value.

Since (EFL) :
1.2

Union of all known value types.

This is only used to specify the minimum payload memory for Eina_Value.


Variable Documentation

Since :
3.0

manages array type. Use the value get/set for arrays:

eina_value_set() takes an Eina_Value_Array where just subtype and step are used. If there is an array, it will be copied (including each item) and its contents must be properly configurable as subtype expects. eina_value_pset() takes a pointer to an Eina_Value_Array. For your convenience, use eina_value_array_setup().

eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_Array, it's an exact copy of the current structure in use by value, no copies are done.

Since (EFL) :
1.2
Since :
3.0

manages blob of bytes type, see Eina_Value_Blob

eina_value_set() takes an Eina_Value_Blob eina_value_pset() takes a pointer to Eina_Value_Blob.

eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_Blob and it's an exact copy of value, no allocations are made.

Memory is untouched unless you provide ops (operations) pointer.

Since (EFL) :
1.2
Since :
3.0

manages char type.

Since (EFL) :
1.2
Examples:
eina_value_02.c, and eina_value_03.c.
Since :
3.0

manages double type.

Since (EFL) :
1.2
Examples:
eina_value_03.c.

manages Eina_Error values. This value will hold an Eina_Error number, which can be converted to string to get its message or call eina_error_msg_get() on the number to convert yourself.

Since (EFL) :
1.21
Since :
3.0

manages float type.

Since (EFL) :
1.2
Examples:
eina_value_03.c.
Since :
3.0

manages hash type. Use the value get/set for hashes:

eina_value_set() takes an Eina_Value_Hash where just subtype and buckets_power_size are used. If there is an hash, it will be copied (including each item) and its contents must be properly configurable as subtype expects. eina_value_pset() takes a pointer to an Eina_Value_Hash. For your convenience, use eina_value_hash_setup().

eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_Hash, it's an exact copy of the current structure in use by value, no copies are done.

Note:
Be aware that hash data is always an allocated memory of size defined by subtype->value_size. If your subtype is an integer, add as data malloc(sizeof(int)). If your subtype is an string, add as data malloc(sizeof(char*)) and this data value must point to strdup(string)!
Since (EFL) :
1.2
Since :
3.0

manages int type.

Since (EFL) :
1.2
Examples:
eina_value_01.c, eina_value_02.c, eina_value_03.c, and prefs_data_example.c.
Since :
3.0

manages integer of 64 bits type.

Since (EFL) :
1.2
Examples:
eina_value_03.c.
Since :
3.0

manages list type. Use the value get/set for lists:

eina_value_set() takes an Eina_Value_List where just subtype is used. If there is an list, it will be copied (including each item) and its contents must be properly configurable as subtype expects. eina_value_pset() takes a pointer to an Eina_Value_List. For your convenience, use eina_value_list_setup().

eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_List, it's an exact copy of the current structure in use by value, no copies are done.

Since (EFL) :
1.2
Since :
3.0

manages long type.

Since (EFL) :
1.2
Examples:
eina_value_03.c.
Since :
3.0

manages short type.

Since (EFL) :
1.2
Examples:
eina_value_03.c.
Since :
3.0

manages string type.

Since (EFL) :
1.2
Examples:
eina_value_01.c, and eina_value_03.c.
Since :
3.0

manages stringshared string type.

Since (EFL) :
1.2
Examples:
eina_value_03.c.
Since :
3.0

manages struct type. Use the value get/set for structs:

eina_value_set() takes an Eina_Value_Struct where just desc is used. If there is an memory, it will be copied (including each member) and its contents must be properly configurable as desc expects. eina_value_pset() takes a pointer to an Eina_Value_Struct. For your convenience, use eina_value_struct_setup().

eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_Struct, it's an exact copy of the current structure in use by value, no copies are done.

Since (EFL) :
1.2
Examples:
eina_value_02.c.
Since :
3.0

manages unsigned long type used for timestamps.

Note:
this is identical in function to EINA_VALUE_TYPE_ULONG
Since (EFL) :
1.2
Examples:
eina_value_03.c.
Since :
3.0

manages 'struct timeval' type

eina_value_set() takes a "struct timeval" from sys/time.h. eina_value_pset() takes a pointer to "struct timeval".

eina_value_get() and eina_value_pget() takes a pointer to "struct timeval" and it's an exact copy of value.

Since (EFL) :
1.2
Examples:
eina_value_03.c.

manages 'struct tm' type

eina_value_set() takes a "struct tm" from time.h. eina_value_pset() takes a pointer to "struct tm".

eina_value_get() and eina_value_pget() takes a pointer to "struct tm" and it's an exact copy of value.

Since (EFL) :
1.21
Since :
3.0

manages unsigned char type.

Since (EFL) :
1.2

manages unsigned char type.

Since (EFL) :
1.21
Examples:
eina_value_03.c.
Since :
3.0

manages unsigned int type.

Since (EFL) :
1.2
Examples:
eina_value_03.c.
Since :
3.0

manages unsigned integer of 64 bits type.

Since (EFL) :
1.2
Examples:
eina_value_03.c.
Since :
3.0

manages unsigned long type.

Since (EFL) :
1.2
Examples:
eina_value_03.c.
Since :
3.0

manages unsigned short type.

Since (EFL) :
1.2
Examples:
eina_value_03.c.

manages Eina_Value values. This value will hold an Eina_Value, which can be useful for storing data inside an Eina_Value_Array.

Since (EFL) :
1.21