RAVE
|
Data value abstraction. More...
#include "rave_value.h"
#include "rave_debug.h"
#include "rave_alloc.h"
#include <string.h>
#include "rave_object.h"
#include "rave_data2d.h"
#include <errno.h>
#include <stdio.h>
Classes | |
struct | _RaveValue_t |
Represents one scan in a volume. More... | |
Functions | |
RaveValue_Type | RaveValue_type (RaveValue_t *self) |
Returns the format for this attribute. | |
void | RaveValue_reset (RaveValue_t *self) |
Resets the value object. | |
RaveValue_t * | RaveValue_createString (const char *value) |
Creates a string rave value. | |
int | RaveValue_setString (RaveValue_t *self, const char *value) |
Sets a string value in self. | |
int | RaveValue_getString (RaveValue_t *self, char **value) |
Returns the value as a string. | |
const char * | RaveValue_toString (RaveValue_t *self) |
Returns the string value. | |
RaveValue_t * | RaveValue_createLong (long value) |
Creates a long rave value. | |
void | RaveValue_setLong (RaveValue_t *self, long value) |
Sets the value as a long. | |
int | RaveValue_getLong (RaveValue_t *self, long *value) |
Returns the value as a long. | |
long | RaveValue_toLong (RaveValue_t *self) |
Returns the long value. | |
RaveValue_t * | RaveValue_createDouble (double value) |
Creates a double rave value. | |
void | RaveValue_setDouble (RaveValue_t *self, double value) |
Sets the value as a double. | |
int | RaveValue_getDouble (RaveValue_t *self, double *value) |
Returns the value as a double. | |
double | RaveValue_toDouble (RaveValue_t *self) |
Returns the double value. | |
RaveValue_t * | RaveValue_createStringArray (const char **value, int len) |
Creates a string array rave value. | |
int | RaveValue_setStringArray (RaveValue_t *self, const char **value, int len) |
Sets the value as a simple 1-dimensional double array. | |
int | RaveValue_getStringArray (RaveValue_t *self, char ***value, int *len) |
Returns the value as a string array. | |
RaveValue_t * | RaveValue_createLongArray (long *value, int len) |
Creates a long array rave value. | |
int | RaveValue_setLongArray (RaveValue_t *self, long *value, int len) |
Sets the value as a simple 1-dimensional long array. | |
int | RaveValue_getLongArray (RaveValue_t *self, long **value, int *len) |
Returns the value as a long array. | |
RaveValue_t * | RaveValue_createDoubleArray (double *value, int len) |
Creates a double array rave value. | |
int | RaveValue_setDoubleArray (RaveValue_t *self, double *value, int len) |
Sets the value as a simple 1-dimensional double array. | |
int | RaveValue_getDoubleArray (RaveValue_t *self, double **value, int *len) |
Returns the value as a double array. | |
int | RaveValue_setHashTable (RaveValue_t *self, RaveObjectHashTable_t *table) |
Sets the value as a hash table. | |
int | RaveValue_getHashTable (RaveValue_t *self, RaveObjectHashTable_t **table) |
Returns the hash table if possible. | |
RaveObjectHashTable_t * | RaveValue_toHashTable (RaveValue_t *self) |
NOTE! | |
Variables | |
RaveCoreObjectType | RaveValue_TYPE |
Type definition to use when creating a rave object. | |
Data value abstraction.
RaveValue_t * RaveValue_createDouble | ( | double | value | ) |
Creates a double rave value.
[in] | value | - the double |
RaveValue_t * RaveValue_createDoubleArray | ( | double * | value, |
int | len ) |
Creates a double array rave value.
[in] | value | - the double array |
[in] | len | - the length of the array |
RaveValue_t * RaveValue_createLong | ( | long | value | ) |
Creates a long rave value.
[in] | value | - the long |
RaveValue_t * RaveValue_createLongArray | ( | long * | value, |
int | len ) |
Creates a long array rave value.
[in] | value | - the long array |
[in] | len | - the length of the array |
RaveValue_t * RaveValue_createString | ( | const char * | value | ) |
Creates a string rave value.
[in] | value | - the string |
RaveValue_t * RaveValue_createStringArray | ( | const char ** | value, |
int | len ) |
Creates a string array rave value.
[in] | value | - the string array |
[in] | len | - the length of the array |
int RaveValue_getDouble | ( | RaveValue_t * | self, |
double * | value ) |
Returns the value as a double.
[in] | self | - self |
[out] | value | - the double value |
int RaveValue_getDoubleArray | ( | RaveValue_t * | self, |
double ** | value, | ||
int * | len ) |
Returns the value as a double array.
[in] | self | - self |
[out] | value | - the internal double array, DO NOT RELEASE memory |
[out] | len | - the number of values in the array |
int RaveValue_getHashTable | ( | RaveValue_t * | self, |
RaveObjectHashTable_t ** | table ) |
Returns the hash table if possible.
[in] | self | |
[out] | table | - a reference to the hash table |
int RaveValue_getLong | ( | RaveValue_t * | self, |
long * | value ) |
Returns the value as a long.
[in] | self | - self |
[out] | value | - the long value |
int RaveValue_getLongArray | ( | RaveValue_t * | self, |
long ** | value, | ||
int * | len ) |
Returns the value as a long array.
[in] | self | - self |
[out] | value | - the internal long array, DO NOT RELEASE memory |
[out] | len | - the number of values in the array |
int RaveValue_getString | ( | RaveValue_t * | self, |
char ** | value ) |
Returns the value as a string.
[in] | self | - self |
[out] | value | - the internal 0-terminated string, DO NOT RELEASE memory |
int RaveValue_getStringArray | ( | RaveValue_t * | self, |
char *** | value, | ||
int * | len ) |
Returns the value as a string array.
[in] | self | - self |
[out] | value | - the internal string array, DO NOT RELEASE memory |
[out] | len | - the number of values in the array |
void RaveValue_reset | ( | RaveValue_t * | self | ) |
Resets the value object.
[in] | self | - self |
void RaveValue_setDouble | ( | RaveValue_t * | self, |
double | value ) |
Sets the value as a double.
[in] | self | - self |
[in] | value | - the value |
int RaveValue_setDoubleArray | ( | RaveValue_t * | self, |
double * | value, | ||
int | len ) |
Sets the value as a simple 1-dimensional double array.
[in] | self | - self |
[in] | value | - the value |
[in] | len | - the number of doubles in the array |
int RaveValue_setHashTable | ( | RaveValue_t * | self, |
RaveObjectHashTable_t * | table ) |
Sets the value as a hash table.
[in] | self | - self |
[in] | table | - the object hash table. |
void RaveValue_setLong | ( | RaveValue_t * | self, |
long | value ) |
Sets the value as a long.
[in] | self | - self |
[in] | value | - the value |
int RaveValue_setLongArray | ( | RaveValue_t * | self, |
long * | value, | ||
int | len ) |
Sets the value as a simple 1-dimensional long array.
[in] | self | - self |
[in] | value | - the value |
[in] | len | - the number of longs in the array |
int RaveValue_setString | ( | RaveValue_t * | self, |
const char * | value ) |
Sets a string value in self.
[in] | self | - self |
[in] | value | - the value |
int RaveValue_setStringArray | ( | RaveValue_t * | self, |
const char ** | value, | ||
int | len ) |
Sets the value as a simple 1-dimensional double array.
[in] | self | - self |
[in] | value | - the value |
[in] | len | - the number of doubles in the array |
double RaveValue_toDouble | ( | RaveValue_t * | self | ) |
Returns the double value.
NOTE! It up to user to ensure that value actually is a double otherwise behavior will be undefined.
[in] | self | - self |
RaveObjectHashTable_t * RaveValue_toHashTable | ( | RaveValue_t * | self | ) |
NOTE!
It up to user to ensure that value actually is a hash table otherwise behavior will be undefined.
[in] | self | - self |
long RaveValue_toLong | ( | RaveValue_t * | self | ) |
Returns the long value.
NOTE! It up to user to ensure that value actually is a long otherwise behavior will be undefined.
[in] | self | - self |
const char * RaveValue_toString | ( | RaveValue_t * | self | ) |
Returns the string value.
NOTE! It up to user to ensure that value actually is a string otherwise behavior will be undefined.
[in] | self | - self |
RaveValue_Type RaveValue_type | ( | RaveValue_t * | self | ) |
Returns the format for this attribute.
[in] | self | - self |
RaveCoreObjectType RaveValue_TYPE |
Type definition to use when creating a rave object.