gvalue.h File Reference

__G_VALUE_H__

G_TYPE_IS_VALUE

G_TYPE_IS_VALUE: : A GType value.

Checks whether the passed in type ID can be used for g_value_init(). That is, this macro checks whether this type provides an implementation of the GTypeValueTable functions required for a type to create a GValue of.

Returns: Whether is suitable as a GValue type.

G_IS_VALUE

G_IS_VALUE: : A GValue structure.

Checks if is a valid and initialized GValue structure.

Returns: TRUE on success.

G_VALUE_TYPE

G_VALUE_TYPE: : A GValue structure.

Get the type identifier of .

Returns: the GType.

G_VALUE_TYPE_NAME

G_VALUE_TYPE_NAME: : A GValue structure.

Gets the the type name of .

Returns: the type name.

G_VALUE_HOLDS

G_VALUE_HOLDS: : A GValue structure. : A GType value.

Checks if holds (or contains) a value of . This macro will also check for != NULL and issue a warning if the check fails.

Returns: TRUE if holds the .

Typedef GValueTransform

typedef void(*GValueTransform

GValueTransform: : Source value. : Target value.

The type of value transformation functions which can be registered with g_value_register_transform_func().

g_value_init ( GValue *, GType )

IMPORT_C GValue *g_value_init(GValue *value,
GTypeg_type
)

g_value_init: : A zero-filled (uninitialized) GValue structure. : Type the GValue should hold values of.

Initializes with the default value of .

Returns: the GValue structure that has been passed in

g_value_copy ( const GValue *, GValue * )

IMPORT_C voidg_value_copy(const GValue *src_value,
GValue *dest_value
)

g_value_copy: : An initialized GValue structure. : An initialized GValue structure of the same type as .

Copies the value of into .

g_value_reset ( GValue * )

IMPORT_C GValue *g_value_reset(GValue *value)

g_value_reset: : An initialized GValue structure.

Clears the current value in and resets it to the default value (as if the value had just been initialized).

Returns: the GValue structure that has been passed in

g_value_unset ( GValue * )

IMPORT_C voidg_value_unset(GValue *value)

g_value_unset: : An initialized GValue structure.

Clears the current value in and "unsets" the type, this releases all resources associated with this GValue. An unset value is the same as an uninitialized (zero-filled) GValue structure.

g_value_set_instance ( GValue *, gpointer )

IMPORT_C voidg_value_set_instance(GValue *value,
gpointerinstance
)

g_value_set_instance: : An initialized GValue structure. : the instance

Sets from an instantiatable type via the value_table's collect_value() function.

g_value_fits_pointer ( const GValue * )

IMPORT_C gbooleang_value_fits_pointer(const GValue *value)

g_value_fits_pointer: : An initialized GValue structure.

Determines if will fit inside the size of a pointer value. This is an internal function introduced mainly for C marshallers.

Returns: TRUE if will fit inside a pointer value.

g_value_peek_pointer ( const GValue * )

IMPORT_C gpointerg_value_peek_pointer(const GValue *value)

g_value_peek_pointer: : An initialized GValue structure.

Return the value contents as pointer. This function asserts that g_value_fits_pointer() returned TRUE for the passed in value. This is an internal function introduced mainly for C marshallers.

Returns: TRUE if will fit inside a pointer value.

g_value_type_compatible ( GType, GType )

IMPORT_C gbooleang_value_type_compatible(GTypesrc_type,
GTypedest_type
)

g_value_type_compatible: : source type to be copied. : destination type for copying.

Returns whether a GValue of type can be copied into a GValue of type .

Returns: TRUE if g_value_copy() is possible with and .

g_value_type_transformable ( GType, GType )

IMPORT_C gbooleang_value_type_transformable(GTypesrc_type,
GTypedest_type
)

g_value_type_transformable: : Source type. : Target type.

Check whether g_value_transform() is able to transform values of type into values of type .

Returns: TRUE if the transformation is possible, FALSE otherwise.

g_value_transform ( const GValue *, GValue * )

IMPORT_C gbooleang_value_transform(const GValue *src_value,
GValue *dest_value
)

g_value_transform: : Source value. : Target value.

Tries to cast the contents of into a type appropriate to store in , e.g. to transform a G_TYPE_INT value into a G_TYPE_FLOAT value. Performing transformations between value types might incur precision lossage. Especially transformations into strings might reveal seemingly arbitrary results and shouldn't be relied upon for production code (such as rcfile value or object property serialization).

Returns: Whether a transformation rule was found and could be applied. Upon failing transformations, is left untouched.

g_value_register_transform_func ( GType, GType, GValueTransform )

IMPORT_C voidg_value_register_transform_func(GTypesrc_type,
GTypedest_type,
GValueTransformtransform_func
)

g_value_register_transform_func: : Source type. : Target type. : a function which transforms values of type into value of type

Registers a value transformation function for use in g_value_transform(). A previously registered transformation function for and will be replaced.

G_VALUE_NOCOPY_CONTENTS