libcollection 0.6.2
Loading...
Searching...
No Matches
Update property functions

Functions

int col_update_str_property (struct collection_item *ci, const char *property, int mode_flags, char *string, int length)
 
int col_update_binary_property (struct collection_item *ci, const char *property, int mode_flags, void *binary_data, int length)
 
int col_update_int_property (struct collection_item *ci, const char *property, int mode_flags, int32_t number)
 
int col_update_unsigned_property (struct collection_item *ci, const char *property, int mode_flags, uint32_t number)
 
int col_update_long_property (struct collection_item *ci, const char *property, int mode_flags, int64_t number)
 
int col_update_ulong_property (struct collection_item *ci, const char *property, int mode_flags, uint64_t number)
 
int col_update_double_property (struct collection_item *ci, const char *property, int mode_flags, double number)
 
int col_update_bool_property (struct collection_item *ci, const char *property, int mode_flags, unsigned char logical)
 
int col_update_property (struct collection_item *ci, const char *property, int type, void *new_data, int length, int mode_flags)
 

Detailed Description

Functions in this section update properties in a collection.

All update functions search the property using the internal traverse function. Use same "x!y" notation to specify a property. For more details about the search logic see col_get_item_and_do function.

The existing value of the property is destroyed and lost.

It is not possible to rename the property using these functions. To do more advanced modifications see col_modify_item function and item modification wrappers .

Common parameters for these functions are:

Parameters
[in]ciRoot collection object.
[in]propertyName of the property.
[in]mode_flagsSpecify how the collection should to be traversed.

The rest of the arguments specify the new values for the property. For more details about these arguments see the description of the col_add_xxx_property corresponding function.

Returns
0 - Property was updated successfully.
ENOMEM - No memory.
EINVAL - The value of some of the arguments is invalid. The attempt to update a property which is a reference to a collection or a collection name.
ENOENT - Property to update is not found.

Function Documentation

◆ col_update_str_property()

int col_update_str_property ( struct collection_item * ci,
const char * property,
int mode_flags,
char * string,
int length )

Update a property with a string value. Length should include the terminating 0.

◆ col_update_binary_property()

int col_update_binary_property ( struct collection_item * ci,
const char * property,
int mode_flags,
void * binary_data,
int length )

Update a property with a binary value.

◆ col_update_int_property()

int col_update_int_property ( struct collection_item * ci,
const char * property,
int mode_flags,
int32_t number )

Update a property with an integer value.

◆ col_update_unsigned_property()

int col_update_unsigned_property ( struct collection_item * ci,
const char * property,
int mode_flags,
uint32_t number )

Update a property with an unsigned value.

◆ col_update_long_property()

int col_update_long_property ( struct collection_item * ci,
const char * property,
int mode_flags,
int64_t number )

Update a property with a long value.

◆ col_update_ulong_property()

int col_update_ulong_property ( struct collection_item * ci,
const char * property,
int mode_flags,
uint64_t number )

Update a property with an unsigned long value.

◆ col_update_double_property()

int col_update_double_property ( struct collection_item * ci,
const char * property,
int mode_flags,
double number )

Update a property with a floating point value.

◆ col_update_bool_property()

int col_update_bool_property ( struct collection_item * ci,
const char * property,
int mode_flags,
unsigned char logical )

Update a property with a Boolean value.

◆ col_update_property()

int col_update_property ( struct collection_item * ci,
const char * property,
int type,
void * new_data,
int length,
int mode_flags )

Update a property with a value by specifying type and value. See definitions of the type constants here. All other col_update_xxx_property functions are wrappers around this one.