Functions | |
| cpl_array * | cpl_array_new (int length, cpl_type type) |
| Create a new array of given type. | |
| cpl_array * | cpl_array_wrap_int (int *data, int length) |
| Create a new integer array from existing data. | |
| cpl_array * | cpl_array_wrap_float (float *data, int length) |
| Create a new float array from existing data. | |
| cpl_array * | cpl_array_wrap_double (double *data, int length) |
| Create a new double array from existing data. | |
| cpl_array * | cpl_array_wrap_string (char **data, int length) |
| Create a new character string array from existing data. | |
| cpl_error_code | cpl_array_copy_data (cpl_array *array, const double *data) |
| Copy buffer of numerical data to a numerical array. | |
| cpl_error_code | cpl_array_copy_data_int (cpl_array *array, const int *data) |
| Copy existing data to an integer array. | |
| cpl_error_code | cpl_array_copy_data_float (cpl_array *array, const float *data) |
| Copy existing data to a float array. | |
| cpl_error_code | cpl_array_copy_data_double (cpl_array *array, const double *data) |
| Copy existing data to a double array. | |
| cpl_error_code | cpl_array_copy_data_string (cpl_array *array, const char **data) |
| Copy existing data to a string array. | |
| void | cpl_array_delete (cpl_array *array) |
| Delete an array. | |
| void * | cpl_array_unwrap (cpl_array *array) |
| Delete an array, without losing the data buffer. | |
| int | cpl_array_get_size (const cpl_array *array) |
| Get the length of an array. | |
| cpl_type | cpl_array_get_type (const cpl_array *array) |
| Get the type of an array. | |
| int | cpl_array_has_invalid (const cpl_array *array) |
| Check if an array contains at least one invalid element. | |
| int | cpl_array_has_valid (const cpl_array *array) |
| Check if an array contains at least one valid value. | |
| int | cpl_array_count_invalid (const cpl_array *array) |
| Count number of invalid elements in an array. | |
| int * | cpl_array_get_data_int (const cpl_array *array) |
Get a pointer to integer array data. | |
| float * | cpl_array_get_data_float (const cpl_array *array) |
| Get a pointer to float array data. | |
| double * | cpl_array_get_data_double (const cpl_array *array) |
| Get a pointer to double array data. | |
| char ** | cpl_array_get_data_string (const cpl_array *array) |
| Get a pointer to string array data. | |
| double | cpl_array_get (const cpl_array *array, int indx, int *null) |
| Read a value from a numerical array. | |
| int | cpl_array_get_int (const cpl_array *array, int indx, int *null) |
| Read a value from an integer array. | |
| float | cpl_array_get_float (const cpl_array *array, int indx, int *null) |
| Read a value from a float array. | |
| double | cpl_array_get_double (const cpl_array *array, int indx, int *null) |
| Read a value from a double array. | |
| const char * | cpl_array_get_string (const cpl_array *array, int indx) |
| Read a value from a string array. | |
| cpl_error_code | cpl_array_set (cpl_array *array, int indx, double value) |
| Write a value to a numerical array element. | |
| cpl_error_code | cpl_array_set_int (cpl_array *array, int indx, int value) |
| Write a value to an integer array element. | |
| cpl_error_code | cpl_array_set_float (cpl_array *array, int indx, float value) |
| Write a value to a float array element. | |
| cpl_error_code | cpl_array_set_double (cpl_array *array, int indx, double value) |
| Write a value to a double array element. | |
| cpl_error_code | cpl_array_set_string (cpl_array *array, int indx, const char *string) |
| Write a character string to a string array element. | |
| cpl_error_code | cpl_array_set_invalid (cpl_array *array, int indx) |
| Invalidate an array element. | |
| cpl_error_code | cpl_array_fill_window (cpl_array *array, int start, int count, double value) |
| Write the same value within a numerical array segment. | |
| cpl_error_code | cpl_array_fill_window_int (cpl_array *array, int start, int count, int value) |
| Write the same value within an integer array segment. | |
| cpl_error_code | cpl_array_fill_window_float (cpl_array *array, int start, int count, float value) |
| Write the same value within a float array segment. | |
| cpl_error_code | cpl_array_fill_window_double (cpl_array *array, int start, int count, double value) |
| Write the same value within a double array segment. | |
| cpl_error_code | cpl_array_fill_window_string (cpl_array *array, int start, int count, const char *value) |
| Write a string to a string array segment. | |
| cpl_error_code | cpl_array_fill_window_invalid (cpl_array *array, int start, int count) |
| Set an array segment to NULL. | |
| cpl_array * | cpl_array_duplicate (const cpl_array *array) |
| Make a copy of an array. | |
#include <cpl_array.h>
|
||||||||||||
|
Copy buffer of numerical data to a numerical array.
cpl_array_set_invalid(). If N is the length of the array, the first N values of the input data buffer would be copied to the column buffer. If the array had length zero, no values would be copied. |
|
||||||||||||
|
Copy existing data to a double array.
cpl_array_copy_data_int(). |
|
||||||||||||
|
Copy existing data to a float array.
cpl_array_copy_data_int(). |
|
||||||||||||
|
Copy existing data to an integer array.
cpl_array_set_invalid(). If N is the length of the array, the first N values of the input data buffer would be copied to the array buffer. If the array had length zero, no values would be copied. |
|
||||||||||||
|
Copy existing data to a string array.
cpl_array_copy_data_int().The input data are copied into the specified array. The size of the input buffer is not checked in any way. The strings pointed by the input buffer are all duplicated, while the strings contained in the array are released before being overwritten. |
|
|
Count number of invalid elements in an array.
NULL pointer, an error CPL_ERROR_NULL_INPUT is set. |
|
|
Delete an array.
NULL, nothing is done, and no error is set. |
|
|
Make a copy of an array.
NULL pointer, a CPL_ERROR_NULL_INPUT is returned. Copy is "in depth": in the case of a string array, also the string elements are duplicated. |
|
||||||||||||||||||||
|
Write the same value within a numerical array segment.
cpl_array_fill_window_invalid(). |
|
||||||||||||||||||||
|
Write the same value within a double array segment.
cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be written just up to the end of the array. If count is zero, the array is not modified and no error is set. |
|
||||||||||||||||||||
|
Write the same value within a float array segment.
cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be written just up to the end of the array. If count is zero, the array is not modified and no error is set. |
|
||||||||||||||||||||
|
Write the same value within an integer array segment.
cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be written just up to the end of the array. If count is zero, the array is not modified and no error is set. |
|
||||||||||||||||
|
Set an array segment to NULL.
NULL; for other data types, the corresponding elements are flagged as invalid. |
|
||||||||||||||||||||
|
Write a string to a string array segment.
NULL pointer, it is duplicated for each accessed array element. If the input string is NULL, this call is equivalent to cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be copied just up to the end of the array. If count is zero, the array is not modified and no error is set. |
|
||||||||||||||||
|
Read a value from a numerical array.
CPL_ERROR_NULL_INPUT is set in case array is a NULL pointer. A CPL_ERROR_INVALID_TYPE is set in case a non-numerical array is accessed. CPL_ERROR_ACCESS_OUT_OF_RANGE is set if the indx is outside the array range. Indexes are counted starting from 0. If the input array has length zero, CPL_ERROR_ACCESS_OUT_OF_RANGE is always set. The null flag is used to indicate whether the accessed array element is valid (0) or invalid (1). The null flag also signals an error condition (-1). The null argument can be left to NULL. |
|
|
Get a pointer to double array data.
CPL_TYPE_DOUBLE, a CPL_ERROR_TYPE_MISMATCH is set.See documentation of function cpl_array_get_data_int(). |
|
|
Get a pointer to float array data.
CPL_TYPE_FLOAT, a CPL_ERROR_TYPE_MISMATCH is set.See documentation of function cpl_array_get_data_int(). |
|
|
Get a pointer to
CPL_TYPE_INT, a CPL_ERROR_TYPE_MISMATCH is set.
|
|
|
Get a pointer to string array data.
CPL_TYPE_STRING, a CPL_ERROR_TYPE_MISMATCH is set.See documentation of function cpl_array_get_data_int(). |
|
||||||||||||||||
|
Read a value from a double array.
CPL_TYPE_DOUBLE. See the documentation of the function cpl_array_get_int(). |
|
||||||||||||||||
|
Read a value from a float array.
CPL_TYPE_FLOAT. See the documentation of the function cpl_array_get_int(). |
|
||||||||||||||||
|
Read a value from an integer array.
CPL_TYPE_INT. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is set. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is set. Indexes are counted starting from 0. If the input array has length zero, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always set. If the null flag is a valid pointer, it is used to indicate whether the accessed array element is valid (0) or invalid (1). The null flag also signals an error condition (-1). |
|
|
Get the length of an array.
|
|
||||||||||||
|
Read a value from a string array.
CPL_TYPE_STRING. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is set. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is set. Indexes are counted starting from 0. If the input array has length zero, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always set.
|
|
|
Get the type of an array.
NULL, CPL_ERROR_NULL_INPUT is set. |
|
|
Check if an array contains at least one invalid element.
NULL pointer, a CPL_ERROR_NULL_INPUT is set. |
|
|
Check if an array contains at least one valid value.
NULL pointer, a CPL_ERROR_NULL_INPUT is set. |
|
||||||||||||
|
Create a new array of given type.
CPL_TYPE_INT, CPL_TYPE_FLOAT, CPL_TYPE_DOUBLE, and CPL_TYPE_STRING, are supported. An error CPL_ERROR_INVALID_TYPE is set in case other types are specified. All array elements are initially flagged as invalid. If a negative length is specified, an error CPL_ERROR_ILLEGAL_INPUT is set. Zero length arrays are allowed. |
|
||||||||||||||||
|
Write a value to a numerical array element.
cpl_array_set_invalid(). Array elements are counted starting from 0. |
|
||||||||||||||||
|
Write a value to a double array element.
cpl_array_set_invalid(). Array elements are counted starting from 0. |
|
||||||||||||||||
|
Write a value to a float array element.
cpl_array_set_invalid(). Array elements are counted starting from 0. |
|
||||||||||||||||
|
Write a value to an integer array element.
cpl_array_set_invalid(). Array elements are counted starting from 0. |
|
||||||||||||
|
Invalidate an array element.
NULL; for other data types, the corresponding element of the null flags buffer is flagged. Array elements are counted starting from zero. |
|
||||||||||||||||
|
Write a character string to a string array element.
NULL pointer. Note that the input character string is copied, therefore the original can be modified without affecting the column content. To "plug" a character string directly into an array element, use the function cpl_array_get_data_string(). Array elements are counted starting from zero. |
|
|
Delete an array, without losing the data buffer.
cpl_array_get_data_int(), cpl_array_get_data_float(), etc. If the input array is NULL, nothing is done, and no error is set. |
|
||||||||||||
|
Create a new double array from existing data.
cpl_array_wrap_int(). |
|
||||||||||||
|
Create a new float array from existing data.
cpl_array_wrap_int(). |
|
||||||||||||
|
Create a new integer array from existing data.
cpl_array_set_invalid() The data array is not copied, so it should never be deallocated: to deallocate it, the function cpl_array_delete() should be called instead. Alternatively, the function cpl_array_unwrap() might be used, and the data array deallocated afterwards. A zero or negative length is illegal, and would cause an error CPL_ERROR_ILLEGAL_INPUT to be set. An input NULL pointer would set an error CPL_ERROR_NULL_INPUT.
|
|
||||||||||||
|
Create a new character string array from existing data.
cpl_array_wrap_int(). |
1.3.9.1