libcollection 0.6.2
Loading...
Searching...
No Matches
Functions
Item modification wrappers

Functions

int col_modify_item_property (struct collection_item *item, const char *property)
 Modify item property.
 
int col_modify_str_item (struct collection_item *item, const char *property, const char *string, int length)
 Modify item value to be a string.
 
int col_modify_binary_item (struct collection_item *item, const char *property, void *binary_data, int length)
 Modify item value to be a binary blob.
 
int col_modify_bool_item (struct collection_item *item, const char *property, unsigned char logical)
 Modify item value to be a Boolean.
 
int col_modify_int_item (struct collection_item *item, const char *property, int32_t number)
 Modify item value to be an integer.
 
int col_modify_long_item (struct collection_item *item, const char *property, int64_t number)
 Modify item value to be a long integer.
 
int col_modify_ulong_item (struct collection_item *item, const char *property, uint64_t number)
 Modify item value to be an unsigned long.
 
int col_modify_unsigned_item (struct collection_item *item, const char *property, uint32_t number)
 Modify item value to be an unsigned integer.
 
int col_modify_double_item (struct collection_item *item, const char *property, double number)
 Modify item value to be a floating point.
 

Detailed Description

The functions in this section are convenience wrappers around col_modify_item. They return same error codes.

Function Documentation

◆ col_modify_item_property()

int col_modify_item_property ( struct collection_item item,
const char *  property 
)

Modify item property.

This function is a convenience wrapper around col_modify_item. It is equivalent to: col_modify_item(item, property, 0, NULL, 0);

◆ col_modify_str_item()

int col_modify_str_item ( struct collection_item item,
const char *  property,
const char *  string,
int  length 
)

Modify item value to be a string.

This function is a convenience wrapper around col_modify_item. It sets a value of the item to a provided string. If property is not NULL it also renames the property. If the length argument is not zero the string will be truncated to this length. If the length is 0 the length will be calculated based on the length of the actual string. Original value is always destroyed.

Returns
- same error values as col_modify_item.

◆ col_modify_binary_item()

int col_modify_binary_item ( struct collection_item item,
const char *  property,
void *  binary_data,
int  length 
)

Modify item value to be a binary blob.

This function is a convenience wrapper around col_modify_item. It sets a value of the item to a provided binary buffer. If property is not NULL it also renames the property. Original value is always destroyed.

Returns
- same error values as col_modify_item.

◆ col_modify_bool_item()

int col_modify_bool_item ( struct collection_item item,
const char *  property,
unsigned char  logical 
)

Modify item value to be a Boolean.

This function is a convenience wrapper around col_modify_item. It sets a value of the item to a provided logical value. If property is not NULL it also renames the property. Original value is always destroyed.

Returns
- same error values as col_modify_item.

◆ col_modify_int_item()

int col_modify_int_item ( struct collection_item item,
const char *  property,
int32_t  number 
)

Modify item value to be an integer.

This function is a convenience wrapper around col_modify_item. It sets a value of the item to a provided integer value. If property is not NULL it also renames the property. Original value is always destroyed.

Returns
- same error values as col_modify_item.

◆ col_modify_long_item()

int col_modify_long_item ( struct collection_item item,
const char *  property,
int64_t  number 
)

Modify item value to be a long integer.

This function is a convenience wrapper around col_modify_item. It sets a value of the item to a provided long integer value. If property is not NULL it also renames the property. Original value is always destroyed.

Returns
- same error values as col_modify_item.

◆ col_modify_ulong_item()

int col_modify_ulong_item ( struct collection_item item,
const char *  property,
uint64_t  number 
)

Modify item value to be an unsigned long.

This function is a convenience wrapper around col_modify_item. It sets a value of the item to a provided unsigned long value. If property is not NULL it also renames the property. Original value is always destroyed.

Returns
- same error values as col_modify_item.

◆ col_modify_unsigned_item()

int col_modify_unsigned_item ( struct collection_item item,
const char *  property,
uint32_t  number 
)

Modify item value to be an unsigned integer.

This function is a convenience wrapper around col_modify_item. It sets a value of the item to a provided unsigned integer value. If property is not NULL it also renames the property. Original value is always destroyed.

Returns
- same error values as col_modify_item.

◆ col_modify_double_item()

int col_modify_double_item ( struct collection_item item,
const char *  property,
double  number 
)

Modify item value to be a floating point.

This function is a convenience wrapper around col_modify_item. It sets a value of the item to a provided floating point value. If property is not NULL it also renames the property. Original value is always destroyed.

Returns
- same error values as col_modify_item.