![]() |
![]() |
![]() |
libsoup Reference Manual | ![]() |
---|---|---|---|---|
GValue SupportGValue Support — GValue utilities |
GHashTable* soup_value_hash_new (void); void soup_value_hash_insert_value (GHashTable *hash, const char *key, GValue *value); void soup_value_hash_insert (GHashTable *hash, const char *key, GType type, ...); gboolean soup_value_hash_lookup (GHashTable *hash, const char *key, GType type, ...); GValueArray* soup_value_array_from_args (va_list args); gboolean soup_value_array_to_args (GValueArray *array, va_list args); void soup_value_array_insert (GValueArray *array, guint index_, GType type, ...); void soup_value_array_append (GValueArray *array, GType type, ...); gboolean soup_value_array_get_nth (GValueArray *array, guint index_, GType type, ...); #define SOUP_VALUE_SETV (val, type, args) #define SOUP_VALUE_GETV (val, type, args) #define SOUP_TYPE_BYTE_ARRAY
GHashTable* soup_value_hash_new (void);
Creates a GHashTable whose keys are strings and whose values are GValue.
Returns : |
void soup_value_hash_insert_value (GHashTable *hash, const char *key, GValue *value);
Inserts value
into hash
. (Unlike with g_hash_table_insert()
, both
the key and the value are copied).
|
a value hash |
|
the key |
|
a value |
void soup_value_hash_insert (GHashTable *hash, const char *key, GType type, ...);
Inserts the provided value of type type
into hash
. (Unlike with
g_hash_table_insert()
, both the key and the value are copied).
|
a value hash |
|
the key |
|
a GType |
|
a value of type type
|
gboolean soup_value_hash_lookup (GHashTable *hash, const char *key, GType type, ...);
Looks up key
in hash
and stores its value into the provided
location.
GValueArray* soup_value_array_from_args (va_list args);
Creates a GValueArray from the provided arguments, which must
consist of pairs of a GType and a value of that type, terminated
by G_TYPE_INVALID
. (The array will contain copies of the provided
data rather than pointing to the passed-in data directly.)
|
arguments to create a GValueArray from |
Returns : |
a new GValueArray, or NULL if an error occurred.
|
gboolean soup_value_array_to_args (GValueArray *array, va_list args);
Extracts a GValueArray into the provided arguments, which must
consist of pairs of a GType and a value of pointer-to-that-type,
terminated by G_TYPE_INVALID
. The returned values will point to the
same memory as the values in the array.
|
a GValueArray |
|
arguments to extract array into
|
Returns : |
success or failure |
void soup_value_array_insert (GValueArray *array, guint index_, GType type, ...);
Inserts the provided value of type type
into array
as with
g_value_array_insert()
. (The provided data is copied rather than
being inserted directly.)
|
a GValueArray |
|
the index to insert at |
|
a GType |
|
a value of type type
|
void soup_value_array_append (GValueArray *array, GType type, ...);
Appends the provided value of type type
to array
as with
g_value_array_append()
. (The provided data is copied rather than
being inserted directly.)
|
a GValueArray |
|
a GType |
|
a value of type type
|
gboolean soup_value_array_get_nth (GValueArray *array, guint index_, GType type, ...);
Gets the index_
element of array
and stores its value into the
provided location.
|
a GValueArray |
|
the index to look up |
|
a GType |
|
a value of type pointer-to-type
|
Returns : |
TRUE if array contained a value with index index_
and type type , FALSE if not.
|
#define SOUP_VALUE_SETV(val, type, args)
Copies an argument of type type
from args
into val
. val
will
point directly to the value in args
rather than copying it, so you
must g_value_copy()
it if you want it to remain valid.
#define SOUP_VALUE_GETV(val, type, args)
Extracts a value of type type
from val
into args
. The return
value will point to the same data as val
rather than being a copy
of it.