Gwyfile Library
|
Functions | |
GwyfileItem * | gwyfile_item_new_object (const char *name, GwyfileObject *value) |
Creates a new object GWY file item. More... | |
GwyfileObject * | gwyfile_item_get_object (const GwyfileItem *item) |
Gets the object value contained in a GWY file data item. More... | |
GwyfileObject * | gwyfile_item_release_object (GwyfileItem *item) |
Releases the object contained in a GWY file data item and frees the item. More... | |
void | gwyfile_item_set_object (GwyfileItem *item, GwyfileObject *value) |
Sets the value of an object GWY file item. More... | |
GwyfileObject* gwyfile_item_get_object | ( | const GwyfileItem * | item | ) |
Gets the object value contained in a GWY file data item.
The item must be of the object type. Use gwyfile_item_type() to check item type if the type may not match the expected type. Use gwyfile_object_get_with_type() to obtain object items ensuring the type.
item | An object GWY file data item. |
item
. The object remains owned by item
. GwyfileItem* gwyfile_item_new_object | ( | const char * | name, |
GwyfileObject * | value | ||
) |
Creates a new object GWY file item.
The item consumes the provied object and will take care of freeing it later.
name | Item name. It must be a non-empty UTF-8-encoded string (usually, it should be an ASCII string). A copy of the string will be made. |
value | Item value (to be consumed). The object must not be placed in any item yet. |
GwyfileObject* gwyfile_item_release_object | ( | GwyfileItem * | item | ) |
Releases the object contained in a GWY file data item and frees the item.
The item must be of the object type. It must be also a root, i.e. not be contained in any object. The object is released from the item, becoming a new root object, and the item is freed.
item | A root object GWY file data item. |
item
. void gwyfile_item_set_object | ( | GwyfileItem * | item, |
GwyfileObject * | value | ||
) |
Sets the value of an object GWY file item.
The item must be of the object type.
The item consumes the provied object and will take care of freeing it later. It is not permitted to pass an object already present in another item.
item | An object GWY file data item. |
value | New value for the item (to be consumed). |