Property Lists


Typedefs

typedef _cpl_propertylist_ cpl_propertylist
 The opaque property list data type.
typedef int(*) cpl_propertylist_compare_func (const cpl_property *first, const cpl_property *second)
 The property comparison function data type.

Functions

cpl_error_code cpl_propertylist_append (cpl_propertylist *self, const cpl_propertylist *other)
 Append a property list..
cpl_error_code cpl_propertylist_append_bool (cpl_propertylist *self, const char *name, int value)
 Append a boolean value to a property list.
cpl_error_code cpl_propertylist_append_char (cpl_propertylist *self, const char *name, char value)
 Append a character value to a property list.
cpl_error_code cpl_propertylist_append_double (cpl_propertylist *self, const char *name, double value)
 Append a double value to a property list.
cpl_error_code cpl_propertylist_append_float (cpl_propertylist *self, const char *name, float value)
 Append a float value to a property list.
cpl_error_code cpl_propertylist_append_int (cpl_propertylist *self, const char *name, int value)
 Append an integer value to a property list.
cpl_error_code cpl_propertylist_append_long (cpl_propertylist *self, const char *name, long value)
 Append a long value to a property list.
cpl_error_code cpl_propertylist_append_string (cpl_propertylist *self, const char *name, const char *value)
 Append a string value to a property list.
cpl_error_code cpl_propertylist_copy_property (cpl_propertylist *self, const cpl_propertylist *other, const char *name)
 Copy a property from another property list.
cpl_error_code cpl_propertylist_copy_property_regexp (cpl_propertylist *self, const cpl_propertylist *other, const char *regexp, int invert)
 Copy matching properties from another property list.
void cpl_propertylist_delete (cpl_propertylist *self)
 Destroy a property list.
void cpl_propertylist_dump (const cpl_propertylist *self, FILE *stream)
 Print a property list.
cpl_propertylistcpl_propertylist_duplicate (const cpl_propertylist *self)
 Create a copy of the given property list.
void cpl_propertylist_empty (cpl_propertylist *self)
 Remove all properties from a property list.
int cpl_propertylist_erase (cpl_propertylist *self, const char *name)
 Erase the given property from a property list.
int cpl_propertylist_erase_regexp (cpl_propertylist *self, const char *regexp, int invert)
 Erase all properties with name matching a given regular expression.
cpl_propertycpl_propertylist_get (cpl_propertylist *self, long position)
 Access property list elements by index.
int cpl_propertylist_get_bool (const cpl_propertylist *self, const char *name)
 Get the boolean value of the given property list entry.
char cpl_propertylist_get_char (const cpl_propertylist *self, const char *name)
 Get the character value of the given property list entry.
const char * cpl_propertylist_get_comment (const cpl_propertylist *self, const char *name)
 Get the comment of the given property list entry.
const cpl_propertycpl_propertylist_get_const (const cpl_propertylist *self, long position)
 Access property list elements by index.
double cpl_propertylist_get_double (const cpl_propertylist *self, const char *name)
 Get the double value of the given property list entry.
float cpl_propertylist_get_float (const cpl_propertylist *self, const char *name)
 Get the float value of the given property list entry.
int cpl_propertylist_get_int (const cpl_propertylist *self, const char *name)
 Get the integer value of the given property list entry.
long cpl_propertylist_get_long (const cpl_propertylist *self, const char *name)
 Get the long value of the given property list entry.
cpl_propertycpl_propertylist_get_property (cpl_propertylist *self, const char *name)
 Access property list elements by property name.
const cpl_propertycpl_propertylist_get_property_const (const cpl_propertylist *self, const char *name)
 Access property list elements by property name.
long cpl_propertylist_get_size (const cpl_propertylist *self)
 Get the current size of a property list.
const char * cpl_propertylist_get_string (const cpl_propertylist *self, const char *name)
 Get the string value of the given property list entry.
cpl_type cpl_propertylist_get_type (const cpl_propertylist *self, const char *name)
 Get the the type of a property list entry.
int cpl_propertylist_has (const cpl_propertylist *self, const char *name)
 Check whether a property is present in a property list.
cpl_error_code cpl_propertylist_insert_after_bool (cpl_propertylist *self, const char *after, const char *name, int value)
 Insert a boolean value into a property list after the given position.
cpl_error_code cpl_propertylist_insert_after_char (cpl_propertylist *self, const char *after, const char *name, char value)
 Insert a character value into a property list after the given position.
cpl_error_code cpl_propertylist_insert_after_double (cpl_propertylist *self, const char *after, const char *name, double value)
 Insert a double value into a property list after the given position.
cpl_error_code cpl_propertylist_insert_after_float (cpl_propertylist *self, const char *after, const char *name, float value)
 Insert a float value into a property list after the given position.
cpl_error_code cpl_propertylist_insert_after_int (cpl_propertylist *self, const char *after, const char *name, int value)
 Insert a integer value into a property list after the given position.
cpl_error_code cpl_propertylist_insert_after_long (cpl_propertylist *self, const char *after, const char *name, long value)
 Insert a long value into a property list after the given position.
cpl_error_code cpl_propertylist_insert_after_string (cpl_propertylist *self, const char *after, const char *name, const char *value)
 Insert a string value into a property list after the given position.
cpl_error_code cpl_propertylist_insert_bool (cpl_propertylist *self, const char *here, const char *name, int value)
 Insert a boolean value into a property list at the given position.
cpl_error_code cpl_propertylist_insert_char (cpl_propertylist *self, const char *here, const char *name, char value)
 Insert a character value into a property list at the given position.
cpl_error_code cpl_propertylist_insert_double (cpl_propertylist *self, const char *here, const char *name, double value)
 Insert a double value into a property list at the given position.
cpl_error_code cpl_propertylist_insert_float (cpl_propertylist *self, const char *here, const char *name, float value)
 Insert a float value into a property list at the given position.
cpl_error_code cpl_propertylist_insert_int (cpl_propertylist *self, const char *here, const char *name, int value)
 Insert a integer value into a property list at the given position.
cpl_error_code cpl_propertylist_insert_long (cpl_propertylist *self, const char *here, const char *name, long value)
 Insert a long value into a property list at the given position.
cpl_error_code cpl_propertylist_insert_string (cpl_propertylist *self, const char *here, const char *name, const char *value)
 Insert a string value into a property list at the given position.
int cpl_propertylist_is_empty (const cpl_propertylist *self)
 Check whether a property list is empty.
cpl_propertylistcpl_propertylist_load (const char *name, int position)
 Create a property list from a file.
cpl_propertylistcpl_propertylist_load_regexp (const char *name, int position, const char *regexp, int invert)
 Create a filtered property list from a file.
cpl_propertylistcpl_propertylist_new (void)
 Create an empty property list.
cpl_error_code cpl_propertylist_prepend_bool (cpl_propertylist *self, const char *name, int value)
 Prepend a boolean value to a property list.
cpl_error_code cpl_propertylist_prepend_char (cpl_propertylist *self, const char *name, char value)
 Prepend a character value to a property list.
cpl_error_code cpl_propertylist_prepend_double (cpl_propertylist *self, const char *name, double value)
 Prepend a double value to a property list.
cpl_error_code cpl_propertylist_prepend_float (cpl_propertylist *self, const char *name, float value)
 Prepend a float value to a property list.
cpl_error_code cpl_propertylist_prepend_int (cpl_propertylist *self, const char *name, int value)
 Prepend a integer value to a property list.
cpl_error_code cpl_propertylist_prepend_long (cpl_propertylist *self, const char *name, long value)
 Prepend a long value to a property list.
cpl_error_code cpl_propertylist_prepend_string (cpl_propertylist *self, const char *name, const char *value)
 Prepend a string value to a property list.
cpl_error_code cpl_propertylist_save (const cpl_propertylist *self, const char *filename, unsigned mode)
 Save a property list to a FITS file.
cpl_error_code cpl_propertylist_set_bool (cpl_propertylist *self, const char *name, int value)
 Set the value of the given boolean property list entry.
cpl_error_code cpl_propertylist_set_char (cpl_propertylist *self, const char *name, char value)
 Set the value of the given character property list entry.
cpl_error_code cpl_propertylist_set_comment (cpl_propertylist *self, const char *name, const char *comment)
 Modify the comment field of the given property list entry.
cpl_error_code cpl_propertylist_set_double (cpl_propertylist *self, const char *name, double value)
 Set the value of the given double property list entry.
cpl_error_code cpl_propertylist_set_float (cpl_propertylist *self, const char *name, float value)
 Set the value of the given float property list entry.
cpl_error_code cpl_propertylist_set_int (cpl_propertylist *self, const char *name, int value)
 Set the value of the given integer property list entry.
cpl_error_code cpl_propertylist_set_long (cpl_propertylist *self, const char *name, long value)
 Set the value of the given long property list entry.
cpl_error_code cpl_propertylist_set_string (cpl_propertylist *self, const char *name, const char *value)
 Set the value of the given string property list entry.
cpl_error_code cpl_propertylist_sort (cpl_propertylist *self, cpl_propertylist_compare_func compare)
 Sort a property list.
cpl_error_code cpl_propertylist_update_bool (cpl_propertylist *self, const char *name, int value)
 Update a property list with a boolean value.
cpl_error_code cpl_propertylist_update_char (cpl_propertylist *self, const char *name, char value)
 Update a property list with a character value.
cpl_error_code cpl_propertylist_update_double (cpl_propertylist *self, const char *name, double value)
 Update a property list with a double value.
cpl_error_code cpl_propertylist_update_float (cpl_propertylist *self, const char *name, float value)
 Update a property list with a float value.
cpl_error_code cpl_propertylist_update_int (cpl_propertylist *self, const char *name, int value)
 Update a property list with a integer value.
cpl_error_code cpl_propertylist_update_long (cpl_propertylist *self, const char *name, long value)
 Update a property list with a long value.
cpl_error_code cpl_propertylist_update_string (cpl_propertylist *self, const char *name, const char *value)
 Update a property list with a string value.

Detailed Description

This module implements a container for properties (see Properties) which can be used to store auxiliary values related to another data object, an image or a table for instance. The property values can be set and retrieved by their associated name and properties can be added and removed from the list. The property list container is an ordered sequence of properties.

Synopsis:
   #include <cpl_propertylist.h>

Typedef Documentation

typedef struct _cpl_propertylist_ cpl_propertylist

The opaque property list data type.

typedef int(*) cpl_propertylist_compare_func(const cpl_property *first, const cpl_property *second)

The property comparison function data type.


Function Documentation

cpl_error_code cpl_propertylist_append ( cpl_propertylist self,
const cpl_propertylist other 
)

Append a property list..

Parameters:
self A property list.
other The property to append.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function appends the property list other to the property list self.

cpl_error_code cpl_propertylist_append_bool ( cpl_propertylist self,
const char *  name,
int  value 
)

Append a boolean value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The boolean value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new boolean property with name name and value value. The property is appended to the property list self.

cpl_error_code cpl_propertylist_append_char ( cpl_propertylist self,
const char *  name,
char  value 
)

Append a character value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The character value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new character property with name name and value value. The property is appended to the property list self.

cpl_error_code cpl_propertylist_append_double ( cpl_propertylist self,
const char *  name,
double  value 
)

Append a double value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The double value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new double property with name name and value value. The property is appended to the property list self.

cpl_error_code cpl_propertylist_append_float ( cpl_propertylist self,
const char *  name,
float  value 
)

Append a float value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The float value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new float property with name name and value value. The property is appended to the property list self.

cpl_error_code cpl_propertylist_append_int ( cpl_propertylist self,
const char *  name,
int  value 
)

Append an integer value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The integer value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new integer property with name name and value value. The property is appended to the property list self.

cpl_error_code cpl_propertylist_append_long ( cpl_propertylist self,
const char *  name,
long  value 
)

Append a long value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The long value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new long property with name name and value value. The property is appended to the property list self.

cpl_error_code cpl_propertylist_append_string ( cpl_propertylist self,
const char *  name,
const char *  value 
)

Append a string value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The string value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new string property with name name and value value. The property is appended to the property list self.

cpl_error_code cpl_propertylist_copy_property ( cpl_propertylist self,
const cpl_propertylist other,
const char *  name 
)

Copy a property from another property list.

Parameters:
self A property list.
other The property list from which a property is copied.
name The name of the property to copy.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, other or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list other does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of the same type as the property which should be copied from other.

The function copies the property name from the property list other to the property list self. If the property list self does not already contain a property name the property is appended to self. If a property name exists already in self the function overwrites the contents of this property if and only if this property is of the same type as the property to be copied from other.

cpl_error_code cpl_propertylist_copy_property_regexp ( cpl_propertylist self,
const cpl_propertylist other,
const char *  regexp,
int  invert 
)

Copy matching properties from another property list.

Parameters:
self A property list.
other The property list from which a property is copied.
regexp The regular expression used to select properties.
invert Flag inverting the sense of matching.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, other or regexp is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter regexp is an invalid regular expression.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of the same type as the property which should be copied from other.

The function copies all properties with matching names from the property list other to the property list self. If the flag invert is zero, all properties whose names match the regular expression regexp are copied. If invert is set to a non-zero value, all properties with names not matching regexp are copied rather. The function expects POSIX 1003.2 compliant extended regular expressions.

If the property list self does not already contain one of the properties to be copied this property is appended to self. If a property to be copied exists already in self the function overwrites the contents of this property.

Before properties are copied from the property list other to self the types of the properties are checked and if any type mismatch is detected the function stops processing immediately. The property list self is not at all modified in this case.

See also:
cpl_propertylist_copy_property()

void cpl_propertylist_delete ( cpl_propertylist self  ) 

Destroy a property list.

Parameters:
self The property list to .
Returns:
Nothing.
The function destroys the property list self and its whole contents. If self is NULL, nothing is done and no error is set.

void cpl_propertylist_dump ( const cpl_propertylist self,
FILE *  stream 
)

Print a property list.

Parameters:
self Pointer to property list
stream The output stream
Returns:
Nothing.
This function is mainly intended for debug purposes. If the specified stream is NULL, it is set to stdout. The function used for printing is the standard C fprintf().

cpl_propertylist* cpl_propertylist_duplicate ( const cpl_propertylist self  ) 

Create a copy of the given property list.

Parameters:
self The property list to be copied.
Returns:
The created copy or NULL in case an error occurred.
Errors:
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function creates a deep copy of the given property list self, i.e the created copy and the original property list do not share any resources.

void cpl_propertylist_empty ( cpl_propertylist self  ) 

Remove all properties from a property list.

Parameters:
self A property list.
Returns:
Nothing.
Errors:
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function removes all properties from self. Each property is properly deallocated. After calling this function self is empty.

int cpl_propertylist_erase ( cpl_propertylist self,
const char *  name 
)

Erase the given property from a property list.

Parameters:
self A property list.
name Name of the property to erase.
Returns:
On success the function returns the number of erased entries. If an error occurs the function returns 0 and an appropriate error code is set.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function searches the property with the name name in the property list self and removes it. The property is destroyed. If self contains multiple duplicates of a property named name, only the first one is erased.

int cpl_propertylist_erase_regexp ( cpl_propertylist self,
const char *  regexp,
int  invert 
)

Erase all properties with name matching a given regular expression.

Parameters:
self A property list.
regexp Regular expression.
invert Flag inverting the sense of matching.
Returns:
On success the function returns the number of erased entries or 0 if no entries are erase. If an error occurs the function returns -1 and an appropriate error code is set. In CPL versions earlier than 5.0, the return value in case of error is 0.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or regexp is a NULL pointer.

The function searches for all the properties matching in the list self and removes them. Whether a property matches or not depends on the given regular expression regexp, and the flag invert. If invert is 0, all properties matching regexp are removed from the list. If invert is set to a non-zero value, all properties which do not match regexp are erased. The removed properties are destroyed.

The function expects POSIX 1003.2 compliant extended regular expressions.

cpl_property* cpl_propertylist_get ( cpl_propertylist self,
long  position 
)

Access property list elements by index.

Parameters:
self The property list to query.
position Index of the element to retrieve.
Returns:
The function returns the property with index position, or NULL if position is out of range.
Errors:
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns a handle for the property list element, the property, with the index position. Numbering of property list elements extends from 0 to cpl_propertylist_get_size() - 1. If position is less than 0 or greater equal than cpl_propertylist_get_size() the function returns NULL.

int cpl_propertylist_get_bool ( const cpl_propertylist self,
const char *  name 
)

Get the boolean value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The integer representation of the boolean value stored in the list entry. TRUE is represented as non-zero value while 0 indicates FALSE. The function returns 0 if an error occurs and an appropriate error code is set.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_BOOL.

The function searches the property list self for a property named name. If it is present in the list, its boolean value is returned. If there is more than one property with the same name, it takes the first one from the list.

char cpl_propertylist_get_char ( const cpl_propertylist self,
const char *  name 
)

Get the character value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The character value stored in the list entry. The function returns '\0' if an error occurs and an appropriate error code is set.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_CHAR.

The function searches the property list self for a property named name. If it is present in the list, its character value is returned. If there is more than one property with the same name, it takes the first one from the list.

const char* cpl_propertylist_get_comment ( const cpl_propertylist self,
const char *  name 
)

Get the comment of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The comment of the property list entry, or NULL.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its comment string is returned. If an entry with the name name is not found, or if the entry has no comment the function returns NULL. If there is more than one property with the same name, it takes the first one from the list.

const cpl_property* cpl_propertylist_get_const ( const cpl_propertylist self,
long  position 
)

Access property list elements by index.

Parameters:
self The property list to query.
position Index of the element to retrieve.
Returns:
The function returns the property with index position, or NULL if position is out of range.
Errors:
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns a handle for the property list element, the property, with the index position. Numbering of property list elements extends from 0 to cpl_propertylist_get_size() - 1. If position is less than 0 or greater equal than cpl_propertylist_get_size() the function returns NULL.

double cpl_propertylist_get_double ( const cpl_propertylist self,
const char *  name 
)

Get the double value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The double value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_DOUBLE.

The function searches the property list self for a property named name. If it is present in the list, its double value is returned. If there is more than one property with the same name, it takes the first one from the list.

float cpl_propertylist_get_float ( const cpl_propertylist self,
const char *  name 
)

Get the float value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The float value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_FLOAT.

The function searches the property list self for a property named name. If it is present in the list, its float value is returned. If there is more than one property with the same name, it takes the first one from the list.

int cpl_propertylist_get_int ( const cpl_propertylist self,
const char *  name 
)

Get the integer value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The integer value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_INT.

The function searches the property list self for a property named name. If it is present in the list, its integer value is returned. If there is more than one property with the same name, it takes the first one from the list.

long cpl_propertylist_get_long ( const cpl_propertylist self,
const char *  name 
)

Get the long value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The long value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_LONG.

The function searches the property list self for a property named name. If it is present in the list, its long value is returned. If there is more than one property with the same name, it takes the first one from the list.

cpl_property* cpl_propertylist_get_property ( cpl_propertylist self,
const char *  name 
)

Access property list elements by property name.

Parameters:
self The property list to query.
name The name of the property to retrieve.
Returns:
The function returns the property with name name, or NULL if it does not exist.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or the name is a NULL pointer.

The function returns a handle to the property list element, the property, with the name name. If more than one property exist with the same name, then the first one found will be returned.

const cpl_property* cpl_propertylist_get_property_const ( const cpl_propertylist self,
const char *  name 
)

Access property list elements by property name.

Parameters:
self The property list to query.
name The name of the property to retrieve.
Returns:
The function returns the property with name name, or NULL if it does not exist.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or the name is a NULL pointer.

The function returns a handle to the property list element, the property, with the name name. If more than one property exist with the same name, then the first one found will be returned.

long cpl_propertylist_get_size ( const cpl_propertylist self  ) 

Get the current size of a property list.

Parameters:
self A property list.
Returns:
The property list's current size, or 0 if the list is empty. If an error occurs the function returns 0 and sets an appropriate error code.
Errors:
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function reports the current number of elements stored in the property list self.

const char* cpl_propertylist_get_string ( const cpl_propertylist self,
const char *  name 
)

Get the string value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
A handle to the string value stored in the list entry. The function returns NULL if an error occurs and an appropriate error code is set.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_STRING.

The function searches the property list self for a property named name. If it is present in the list, a handle to its string value is returned. If there is more than one property with the same name, it takes the first one from the list.

cpl_type cpl_propertylist_get_type ( const cpl_propertylist self,
const char *  name 
)

Get the the type of a property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The type of the stored value. If an error occurs the function returns CPL_TYPE_INVALID and sets an appropriate error code.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function returns the type of the value stored in self with the name name. If there is more than one property with the same name, it takes the first one from the list.

int cpl_propertylist_has ( const cpl_propertylist self,
const char *  name 
)

Check whether a property is present in a property list.

Parameters:
self A property list.
name The property name to look up.
Returns:
The function returns 1 if the property is present, or 0 otherwise. If an error occurs the function returns 0 and sets an appropriate error code.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function searches the property list self for a property with the name name and reports whether it was found or not.

cpl_error_code cpl_propertylist_insert_after_bool ( cpl_propertylist self,
const char *  after,
const char *  name,
int  value 
)

Insert a boolean value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The boolean value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new boolean property with name name and value value. The property is inserted into the property list self after the property named after.

cpl_error_code cpl_propertylist_insert_after_char ( cpl_propertylist self,
const char *  after,
const char *  name,
char  value 
)

Insert a character value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The character value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new character property with name name and value value. The property is inserted into the property list self after the property named after.

cpl_error_code cpl_propertylist_insert_after_double ( cpl_propertylist self,
const char *  after,
const char *  name,
double  value 
)

Insert a double value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The double value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new double property with name name and value value. The property is inserted into the property list self after the property named after.

cpl_error_code cpl_propertylist_insert_after_float ( cpl_propertylist self,
const char *  after,
const char *  name,
float  value 
)

Insert a float value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The float value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new float property with name name and value value. The property is inserted into the property list self after the property named after.

cpl_error_code cpl_propertylist_insert_after_int ( cpl_propertylist self,
const char *  after,
const char *  name,
int  value 
)

Insert a integer value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The integer value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new integer property with name name and value value. The property is inserted into the property list self after the property named after.

cpl_error_code cpl_propertylist_insert_after_long ( cpl_propertylist self,
const char *  after,
const char *  name,
long  value 
)

Insert a long value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The long value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new long property with name name and value value. The property is inserted into the property list self after the property named after.

cpl_error_code cpl_propertylist_insert_after_string ( cpl_propertylist self,
const char *  after,
const char *  name,
const char *  value 
)

Insert a string value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The string value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new string property with name name and value value. The property is inserted into the property list self after the property named after.

cpl_error_code cpl_propertylist_insert_bool ( cpl_propertylist self,
const char *  here,
const char *  name,
int  value 
)

Insert a boolean value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The boolean value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new boolean property with name name and value value. The property is inserted into the property list self at the position of the property named here.

cpl_error_code cpl_propertylist_insert_char ( cpl_propertylist self,
const char *  here,
const char *  name,
char  value 
)

Insert a character value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The character value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new character property with name name and value value. The property is inserted into the property list self at the position of the property named here.

cpl_error_code cpl_propertylist_insert_double ( cpl_propertylist self,
const char *  here,
const char *  name,
double  value 
)

Insert a double value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The double value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new double property with name name and value value. The property is inserted into the property list self at the position of the property named here.

cpl_error_code cpl_propertylist_insert_float ( cpl_propertylist self,
const char *  here,
const char *  name,
float  value 
)

Insert a float value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The float value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new float property with name name and value value. The property is inserted into the property list self at the position of the property named here.

cpl_error_code cpl_propertylist_insert_int ( cpl_propertylist self,
const char *  here,
const char *  name,
int  value 
)

Insert a integer value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The integer value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new integer property with name name and value value. The property is inserted into the property list self at the position of the property named here.

cpl_error_code cpl_propertylist_insert_long ( cpl_propertylist self,
const char *  here,
const char *  name,
long  value 
)

Insert a long value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The long value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new long property with name name and value value. The property is inserted into the property list self at the position of the property named here.

cpl_error_code cpl_propertylist_insert_string ( cpl_propertylist self,
const char *  here,
const char *  name,
const char *  value 
)

Insert a string value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The string value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new string property with name name and value value. The property is inserted into the property list self at the position of the property named here.

int cpl_propertylist_is_empty ( const cpl_propertylist self  ) 

Check whether a property list is empty.

Parameters:
self A property list.
Returns:
The function returns 1 if the list is empty, and 0 otherwise. In case an error occurs the function returns -1 and sets an appropriate error code.
Errors:
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function checks if self contains any properties.

cpl_propertylist* cpl_propertylist_load ( const char *  name,
int  position 
)

Create a property list from a file.

Parameters:
name Name of the input file.
position Index of the data set to read.
Returns:
The function returns the newly created property list or NULL if an error occurred.
Errors:
CPL_ERROR_NULL_INPUT The parameter name is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The position is less than 0 or the properties cannot be read from the file name.
CPL_ERROR_FILE_IO The file name does not exist.
CPL_ERROR_BAD_FILE_FORMAT The file name is not a valid FITS file.
CPL_ERROR_DATA_NOT_FOUND The requested data set at index position does not exist.

The function reads the properties of the data set with index position from the file name.

Currently only the FITS file format is supported. The property list is created by reading the FITS keywords from extension position. The numbering of the data sections starts from 0. When creating the property list from a FITS header, any keyword without a value like undefined keywords for instance are not transformed into a property.

See also:
cpl_propertylist_load_regexp()

cpl_propertylist* cpl_propertylist_load_regexp ( const char *  name,
int  position,
const char *  regexp,
int  invert 
)

Create a filtered property list from a file.

Parameters:
name Name of the input file.
position Index of the data set to read.
regexp Regular expression used to filter properties.
invert Flag inverting the sense of matching property names.
Returns:
The function returns the newly created property list or NULL if an error occurred.
Errors:
CPL_ERROR_NULL_INPUT The parameter name or the parameter regexp is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The position is less than 0, the properties cannot be read from the file name, or regexp is not a valid extended regular expression.
CPL_ERROR_FILE_IO The file name does not exist.
CPL_ERROR_BAD_FILE_FORMAT The file name is not a valid FITS file.
CPL_ERROR_DATA_NOT_FOUND The requested data set at index position does not exist.

The function reads all properties of the data set with index position with matching names from the file name. If the flag invert is zero, all properties whose names match the regular expression regexp are read. If invert is set to a non-zero value, all properties with names not matching regexp are read rather. The function expects POSIX 1003.2 compliant extended regular expressions.

Currently only the FITS file format is supported. The property list is created by reading the FITS keywords from extension position. The numbering of the data sections starts from 0.

When creating the property list from a FITS header, any keyword without a value like undefined keywords for instance are not transformed into a property. FITS format specific keyword prefixes (e.g. HIERARCH) must not be part of the given pattern string regexp, but only the actual FITS keyword name may be given.

See also:
cpl_propertylist_load()

cpl_propertylist* cpl_propertylist_new ( void   ) 

Create an empty property list.

Returns:
The newly created property list.
The function creates a new property list and returns a handle for it. To destroy the returned property list object use the property list destructor cpl_propertylist_delete().

See also:
cpl_propertylist_delete()

cpl_error_code cpl_propertylist_prepend_bool ( cpl_propertylist self,
const char *  name,
int  value 
)

Prepend a boolean value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The boolean value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new boolean property with name name and value value. The property is prepended to the property list self.

cpl_error_code cpl_propertylist_prepend_char ( cpl_propertylist self,
const char *  name,
char  value 
)

Prepend a character value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The character value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new character property with name name and value value. The property is prepended to the property list self.

cpl_error_code cpl_propertylist_prepend_double ( cpl_propertylist self,
const char *  name,
double  value 
)

Prepend a double value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The double value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new double property with name name and value value. The property is prepended to the property list self.

cpl_error_code cpl_propertylist_prepend_float ( cpl_propertylist self,
const char *  name,
float  value 
)

Prepend a float value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The float value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new float property with name name and value value. The property is prepended to the property list self.

cpl_error_code cpl_propertylist_prepend_int ( cpl_propertylist self,
const char *  name,
int  value 
)

Prepend a integer value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The integer value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new integer property with name name and value value. The property is prepended to the property list self.

cpl_error_code cpl_propertylist_prepend_long ( cpl_propertylist self,
const char *  name,
long  value 
)

Prepend a long value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The long value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new long property with name name and value value. The property is prepended to the property list self.

cpl_error_code cpl_propertylist_prepend_string ( cpl_propertylist self,
const char *  name,
const char *  value 
)

Prepend a string value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The string value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new string property with name name and value value. The property is prepended to the property list self.

cpl_error_code cpl_propertylist_save ( const cpl_propertylist self,
const char *  filename,
unsigned  mode 
)

Save a property list to a FITS file.

Parameters:
self The property list to save or NULL if empty
filename Name of the file to write
mode The desired output options (combined with bitwise or)
Returns:
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
Errors:
CPL_ERROR_NULL_INPUT The filename is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter mode is invalid.
CPL_ERROR_FILE_IO The file cannot be written or accessed.

This function saves a property list to a FITS file, using cfitsio. The data unit is empty.

Supported output modes are CPL_IO_CREATE (create a new file) and CPL_IO_EXTEND (append to an existing file)

cpl_error_code cpl_propertylist_set_bool ( cpl_propertylist self,
const char *  name,
int  value 
)

Set the value of the given boolean property list entry.

Parameters:
self A property list.
name The property name to look up.
value New boolean value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its boolean value is replaced with the boolean value. If there is more than one property with the same name, it takes the first one from the list.

cpl_error_code cpl_propertylist_set_char ( cpl_propertylist self,
const char *  name,
char  value 
)

Set the value of the given character property list entry.

Parameters:
self A property list.
name The property name to look up.
value New character value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its character value is replaced with the character value. If there is more than one property with the same name, it takes the first one from the list.

cpl_error_code cpl_propertylist_set_comment ( cpl_propertylist self,
const char *  name,
const char *  comment 
)

Modify the comment field of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
comment New comment string.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its comment is replaced by the string comment. The provided comment string may be NULL. In this case an already existing comment is deleted. If there is more than one property with the same name, it takes the first one from the list.

cpl_error_code cpl_propertylist_set_double ( cpl_propertylist self,
const char *  name,
double  value 
)

Set the value of the given double property list entry.

Parameters:
self A property list.
name The property name to look up.
value New double value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its double value is replaced with the double value. If there is more than one property with the same name, it takes the first one from the list.

cpl_error_code cpl_propertylist_set_float ( cpl_propertylist self,
const char *  name,
float  value 
)

Set the value of the given float property list entry.

Parameters:
self A property list.
name The property name to look up.
value New float value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its float value is replaced with the float value. If there is more than one property with the same name, it takes the first one from the list.

cpl_error_code cpl_propertylist_set_int ( cpl_propertylist self,
const char *  name,
int  value 
)

Set the value of the given integer property list entry.

Parameters:
self A property list.
name The property name to look up.
value New integer value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its integer value is replaced with the integer value. If there is more than one property with the same name, it takes the first one from the list.

cpl_error_code cpl_propertylist_set_long ( cpl_propertylist self,
const char *  name,
long  value 
)

Set the value of the given long property list entry.

Parameters:
self A property list.
name The property name to look up.
value New long value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its long value is replaced with the long value. If there is more than one property with the same name, it takes the first one from the list.

cpl_error_code cpl_propertylist_set_string ( cpl_propertylist self,
const char *  name,
const char *  value 
)

Set the value of the given string property list entry.

Parameters:
self A property list.
name The property name to look up.
value New string value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its string value is replaced with the string value. If there is more than one property with the same name, it takes the first one from the list.

cpl_error_code cpl_propertylist_sort ( cpl_propertylist self,
cpl_propertylist_compare_func  compare 
)

Sort a property list.

Parameters:
self The property list to sort.
compare The function used to compare two properties.
Returns:
The function returns CPL_ERROR_NONE on success, or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function sorts the property list self in place, using the function compare to determine whether a property is less, equal or greater than another one.

The function compare must be of the type cpl_propertylist_compare_func.

See also:
cpl_propertylist_compare_func

cpl_error_code cpl_propertylist_update_bool ( cpl_propertylist self,
const char *  name,
int  value 
)

Update a property list with a boolean value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The boolean value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_BOOL.

The function updates the property list self with the boolean value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_BOOL.

cpl_error_code cpl_propertylist_update_char ( cpl_propertylist self,
const char *  name,
char  value 
)

Update a property list with a character value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The character value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_CHAR.

The function updates the property list self with the character value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_CHAR.

cpl_error_code cpl_propertylist_update_double ( cpl_propertylist self,
const char *  name,
double  value 
)

Update a property list with a double value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The double value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_DOUBLE.

The function updates the property list self with the double value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_DOUBLE.

cpl_error_code cpl_propertylist_update_float ( cpl_propertylist self,
const char *  name,
float  value 
)

Update a property list with a float value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The float value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_FLOAT.

The function updates the property list self with the float value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_FLOAT.

cpl_error_code cpl_propertylist_update_int ( cpl_propertylist self,
const char *  name,
int  value 
)

Update a property list with a integer value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The integer value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_INT.

The function updates the property list self with the integer value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_INT.

cpl_error_code cpl_propertylist_update_long ( cpl_propertylist self,
const char *  name,
long  value 
)

Update a property list with a long value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The long value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_LONG.

The function updates the property list self with the long value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_LONG.

cpl_error_code cpl_propertylist_update_string ( cpl_propertylist self,
const char *  name,
const char *  value 
)

Update a property list with a string value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The string value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors:
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_STRING.

The function updates the property list self with the string value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_STRING.


Generated on Wed Mar 18 09:40:12 2009 for Common Pipeline Library Reference Manual by  doxygen 1.4.7