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] prop A string property [out] pMaxLength Pointer to an integer to receive the maximum length of the string value of this property
- Returns
true
on success, otherwisefalse
.
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] prop A string property [out] buffer Pointer to a character array to receive the string value.
This parameter can beNULL
to find out the required space without allocating an initial array.[in,out] buffer_size Pointer 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, otherwisefalse
.
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.
Ifbuffer
is notNULL
, 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] prop A string property [in] buffer Pointer to a buffer containing the new string value [in] buffer_size Length of buffer
.
If0
, interpretbuffer
as a null-terminated string.
- Returns
true
on success, otherwisefalse
.
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.