RAVE
|
Contains various utility functions that makes life easier when working with the rave framework. More...
Go to the source code of this file.
Functions | |
int | RaveUtilities_addLongAttributeToList (RaveObjectList_t *l, const char *name, long value) |
Adds a long attribute to an object list. | |
int | RaveUtilities_addDoubleAttributeToList (RaveObjectList_t *l, const char *name, double value) |
Adds a double attribute to an object list. | |
int | RaveUtilities_addStringAttributeToList (RaveObjectList_t *l, const char *name, const char *value) |
Adds a string attribute to an object list. | |
int | RaveUtilities_replaceLongAttributeInList (RaveObjectList_t *l, const char *name, long value) |
Replaces the content of a attribute in the object list. | |
int | RaveUtilities_replaceDoubleAttributeInList (RaveObjectList_t *l, const char *name, double value) |
Replaces the content of a attribute in the object list. | |
int | RaveUtilities_replaceStringAttributeInList (RaveObjectList_t *l, const char *name, const char *value) |
Replaces the content of a attribute in the object list. | |
void | RaveUtilities_removeAttributeFromList (RaveObjectList_t *l, const char *name) |
Removes the rave attribute with specified name from the list. | |
int | RaveUtilities_getRaveAttributeDoubleFromHash (RaveObjectHashTable_t *h, const char *name, double *v) |
Gets the double value from a rave attribute that resides in a hash table. | |
int | RaveUtilities_iswhitespace (char c) |
Returns if the character is a whitespace character or not, i.e. | |
char * | RaveUtilities_trimText (const char *str, int len) |
Trims the text from all leading and trailing whitespaces. | |
RaveList_t * | RaveUtilities_getTrimmedTokens (const char *str, int c) |
Returns a list of tokens delimited by 'c'. | |
int | RaveUtilities_isXmlSupported (void) |
Returns if xml support is activated or not since expat support is optional and ought to be tested. | |
int | RaveUtilities_isCFConventionSupported (void) |
Returns if CF convention IO support is activated or not. | |
int | RaveUtilities_isLegacyProjEnabled (void) |
Returns if legacy PROJ (PROJ.4 and PROJ 5) is enabled or not. | |
char * | RaveUtilities_handleSourceVersion (const char *source, RaveIO_ODIM_Version version) |
Handles the source value according to version. | |
int | RaveUtilities_isSourceValid (const char *source, RaveIO_ODIM_Version version) |
Verifies if the source is valid according to ODIM version rules. | |
Contains various utility functions that makes life easier when working with the rave framework.
int RaveUtilities_addDoubleAttributeToList | ( | RaveObjectList_t * | l, |
const char * | name, | ||
double | value ) |
Adds a double attribute to an object list.
[in] | l | - the list |
[in] | name | - the name of the attribute |
[in] | value | - the double |
int RaveUtilities_addLongAttributeToList | ( | RaveObjectList_t * | l, |
const char * | name, | ||
long | value ) |
Adds a long attribute to an object list.
[in] | l | - the list |
[in] | name | - the name of the attribute |
[in] | value | - the long |
int RaveUtilities_addStringAttributeToList | ( | RaveObjectList_t * | l, |
const char * | name, | ||
const char * | value ) |
Adds a string attribute to an object list.
[in] | l | - the list |
[in] | name | - the name of the attribute |
[in] | value | - the string |
int RaveUtilities_getRaveAttributeDoubleFromHash | ( | RaveObjectHashTable_t * | h, |
const char * | name, | ||
double * | v ) |
Gets the double value from a rave attribute that resides in a hash table.
[in] | h | - the hash table |
[in] | name | - the name |
[in,out] | v | - the value |
RaveList_t * RaveUtilities_getTrimmedTokens | ( | const char * | str, |
int | c ) |
Returns a list of tokens delimited by 'c'.
The tokens will be trimmed from any leading and trailing whitespaces.
[in] | str | - the string to tokenize |
[in] | c | - the delimiter |
char * RaveUtilities_handleSourceVersion | ( | const char * | source, |
RaveIO_ODIM_Version | version ) |
Handles the source value according to version.
For example, if version < 2.3, then WIGOS will be removed.
[in] | source | - source to be verified |
[in] | version | - what version we want to validate against. |
int RaveUtilities_isCFConventionSupported | ( | void | ) |
Returns if CF convention IO support is activated or not.
int RaveUtilities_isLegacyProjEnabled | ( | void | ) |
Returns if legacy PROJ (PROJ.4 and PROJ 5) is enabled or not.
int RaveUtilities_isSourceValid | ( | const char * | source, |
RaveIO_ODIM_Version | version ) |
Verifies if the source is valid according to ODIM version rules.
Currently the only restriction is for version >= 2.4 which says that either NOD or ORG must exist in the file depending on object type. We will not care about object type and only check if one or both of NOD or ORG exists.
[in] | source | - the source to check |
[in] | version | - the version we are testing against. |
int RaveUtilities_iswhitespace | ( | char | c | ) |
Returns if the character is a whitespace character or not, i.e.
' ', '\t', '\r' or '
'
[in] | c | - the character to check |
int RaveUtilities_isXmlSupported | ( | void | ) |
Returns if xml support is activated or not since expat support is optional and ought to be tested.
void RaveUtilities_removeAttributeFromList | ( | RaveObjectList_t * | l, |
const char * | name ) |
Removes the rave attribute with specified name from the list.
[in] | l | - the list |
[in] | name | - the name |
int RaveUtilities_replaceDoubleAttributeInList | ( | RaveObjectList_t * | l, |
const char * | name, | ||
double | value ) |
Replaces the content of a attribute in the object list.
If the attribute does not exist a new one will be created.
[in] | l | - the list |
[in] | name | - the name of the attribute |
[in] | value | - the double |
int RaveUtilities_replaceLongAttributeInList | ( | RaveObjectList_t * | l, |
const char * | name, | ||
long | value ) |
Replaces the content of a attribute in the object list.
If the attribute does not exist a new one will be created.
[in] | l | - the list |
[in] | name | - the name of the attribute |
[in] | value | - the long |
int RaveUtilities_replaceStringAttributeInList | ( | RaveObjectList_t * | l, |
const char * | name, | ||
const char * | value ) |
Replaces the content of a attribute in the object list.
If the attribute does not exist a new one will be created.
[in] | l | - the list |
[in] | name | - the name of the attribute |
[in] | value | - the string |
char * RaveUtilities_trimText | ( | const char * | str, |
int | len ) |
Trims the text from all leading and trailing whitespaces.
[in] | str | - the string to trim |
[in] | len | - the length of the string to trim |