Typedefs | |
typedef _cpl_property_ | cpl_property |
The opaque property data type. | |
Functions | |
cpl_property * | cpl_property_new (const char *name, cpl_type type) |
Create an empty property of a given type. | |
cpl_property * | cpl_property_new_array (const char *name, cpl_type type, int size) |
Create an empty property of a given type and size. | |
cpl_property * | cpl_property_duplicate (const cpl_property *other) |
Create a copy of a property. | |
void | cpl_property_delete (cpl_property *self) |
Destroy a property. | |
long | cpl_property_get_size (const cpl_property *self) |
Get the current number of elements a property contains. | |
cpl_type | cpl_property_get_type (const cpl_property *self) |
Get the type of a property. | |
cpl_error_code | cpl_property_set_name (cpl_property *self, const char *name) |
Modify the name of a property. | |
cpl_error_code | cpl_property_set_comment (cpl_property *self, const char *comment) |
Modify a property's comment. | |
cpl_error_code | cpl_property_set_char (cpl_property *self, char value) |
Set the value of a character property. | |
cpl_error_code | cpl_property_set_bool (cpl_property *self, int value) |
Set the value of a boolean property. | |
cpl_error_code | cpl_property_set_int (cpl_property *self, int value) |
Set the value of an integer property. | |
cpl_error_code | cpl_property_set_long (cpl_property *self, long value) |
Set the value of a long property. | |
cpl_error_code | cpl_property_set_float (cpl_property *self, float value) |
Set the value of a float property. | |
cpl_error_code | cpl_property_set_double (cpl_property *self, double value) |
Set the value of a double property. | |
cpl_error_code | cpl_property_set_string (cpl_property *self, const char *value) |
Set the value of a string property. | |
const char * | cpl_property_get_name (const cpl_property *self) |
Get the property name. | |
const char * | cpl_property_get_comment (const cpl_property *self) |
Get the property comment. | |
char | cpl_property_get_char (const cpl_property *self) |
Get the value of a character property. | |
int | cpl_property_get_bool (const cpl_property *self) |
Get the value of a boolean property. | |
int | cpl_property_get_int (const cpl_property *self) |
Get the value of an integer property. | |
long | cpl_property_get_long (const cpl_property *self) |
Get the value of a long property. | |
float | cpl_property_get_float (const cpl_property *self) |
Get the value of a float property. | |
double | cpl_property_get_double (const cpl_property *self) |
Get the value of a double property. | |
const char * | cpl_property_get_string (const cpl_property *self) |
Get the value of a string property. |
cpl_property
is basically a variable container which consists of a name, a type identifier and a specific value of that type. The type identifier always determines the type of the associated value. A property is similar to an ordinary variable and its current value can be set or retrieved through its name. In addition a property may have a descriptive comment associated. A property can be created for the basic types char, bool (int), int, long, float and double. Also C strings are supported. Support for arrays in general is currently not available.
#include <cpl_property.h>
|
The opaque property data type.
|
|
Destroy a property.
|
|
Create a copy of a property.
The function returns a copy of the property self. The copy is a deep copy, i.e. all property members are copied. |
|
Get the value of a boolean property.
The function retrieves the boolean value currently stored in the property self. |
|
Get the value of a character property.
The function retrieves the character value currently stored in the property self. |
|
Get the property comment.
The function returns a handle for the comment string of self. |
|
Get the value of a double property.
The function retrieves the double value currently stored in the property self. |
|
Get the value of a float property.
The function retrieves the float value currently stored in the property self. |
|
Get the value of an integer property.
The function retrieves the integer value currently stored in the property self. |
|
Get the value of a long property.
The function retrieves the long value currently stored in the property self. |
|
Get the property name.
The function returns a handle for the identifier string of self. |
|
Get the current number of elements a property contains.
The function returns the current number of elements the property self contains. This is the array size of the property's value and in particular, for a property of the type |
|
Get the value of a string property.
The function retrieves the string value currently stored in the property self. |
|
Get the type of a property.
This function returns the type of the data value stored in the property self. |
|
Create an empty property of a given type.
The function allocates memory for a property of type type and assigns the identifier string name to the newly created property. The returned property must be destroyed using the property destructor cpl_property_delete().
|
|
Create an empty property of a given type and size.
The function allocates memory for a property of type type and assigns the identifier string name to the newly created property. The property value is created such that size elements of type type can be stored. The returned property must be destroyed using the property destructor cpl_property_delete().
|
|
Set the value of a boolean property.
The function replaces the current boolean value of self with a a 0, if value is equal to 0. If value is different from 0 any previous value of self is replaced by a 1. |
|
Set the value of a character property.
The function replaces the current character value of self with a copy of the value value. |
|
Modify a property's comment.
The function replaces the current comment field of self with a copy of the string comment. The new comment may be |
|
Set the value of a double property.
The function replaces the current double value of self with a copy of the value value. |
|
Set the value of a float property.
The function replaces the current float value of self with a copy of the value value. |
|
Set the value of an integer property.
The function replaces the current integer value of self with a copy of the value value. |
|
Set the value of a long property.
The function replaces the current long value of self with a copy of the value value. |
|
Modify the name of a property.
The function replaces the current name of self with a copy of the string name. The function returns an error if name is |
|
Set the value of a string property.
The function replaces the current string value of self with a copy of the value value. |