Valadoc | Vala | Tutorial | API-References | Markup

transform


Description:

public bool transform (ref Value dest_value)

Tries to cast the contents of src_value into a type appropriate to store in dest_value, 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).

Upon failing transformations, dest_value is left untouched.

Parameters:

dest_value Target value.

Returns:

Whether a transformation rule was found and could be applied.