Imaging Control 4 C Library 1.2.0
Loading...
Searching...
No Matches
String Properties

String properties represent features whole value is a text. More...

Functions

bool ic4_prop_string_get_value (struct IC4_PROPERTY *prop, char *buffer, size_t *buffer_size)
 Reads the current value of a string property.
 
bool ic4_prop_string_set_value (struct IC4_PROPERTY *prop, const char *buffer, size_t buffer_size)
 Changes the value of a string property.
 
bool ic4_prop_string_get_max_len (struct IC4_PROPERTY *prop, uint64_t *pMaxLength)
 Returns the maximum length of the string that can be stored in this property.
 

Detailed Description

String properties represent features whole value is a text.

The maximum length of the text is indicated by ic4_prop_string_get_max_len().

Function Documentation

◆ ic4_prop_string_get_max_len()

bool ic4_prop_string_get_max_len ( struct IC4_PROPERTY prop,
uint64_t *  pMaxLength 
)

Returns the maximum length of the string that can be stored in this property.

Parameters
[in]propA string property
[out]pMaxLengthPointer to an integer to receive the maximum length of the string value of this property
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Remarks
If prop is not a string property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.

◆ ic4_prop_string_get_value()

bool ic4_prop_string_get_value ( struct IC4_PROPERTY prop,
char *  buffer,
size_t *  buffer_size 
)

Reads the current value of a string property.

Parameters
[in]propA string property
[out]bufferPointer to a character array to receive the string value.
This parameter can be NULL to find out the required space without allocating an initial array.
[in,out]buffer_sizePointer to a size_t describing the length of the array pointed to by buffer.
The function always writes the actual number of characters required to store the string representation.
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Remarks
If prop is not a string property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
If buffer is not NULL, and *buffer_size is less than the length of the value of this property, the function fails and the error value is set to IC4_ERROR_BUFFER_TOO_SMALL.

◆ ic4_prop_string_set_value()

bool ic4_prop_string_set_value ( struct IC4_PROPERTY prop,
const char *  buffer,
size_t  buffer_size 
)

Changes the value of a string property.

Parameters
[in]propA string property
[in]bufferPointer to a buffer containing the new string value
[in]buffer_sizeLength of buffer.
If 0, interpret buffer as a null-terminated string.
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Remarks
If prop is not a string property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
If the value is currently not writable, the function fails and the error value is set to IC4_ERROR_GENICAM_ACCESS_DENIED.