FFValue

FFValue — Class for handling values.

Synopsis


#include <ff-value.h>


enum        FFValueType;
struct      FFDecimal;
struct      FFDate;
struct      FFTime;
struct      FFTimestamp;
struct      FFValue;

FFValue*    ff_value_new                    (void);
FFValue*    ff_value_new_string             (const gchar *val);
FFValue*    ff_value_new_int64              (gint64 val);
FFValue*    ff_value_new_integer            (gint val);
FFValue*    ff_value_new_smallint           (gshort val);
FFValue*    ff_value_new_double             (gdouble val);
FFValue*    ff_value_new_float              (gfloat val);
FFValue*    ff_value_new_decimal            (const FFDecimal *val);
FFValue*    ff_value_new_date               (const FFDate *val);
FFValue*    ff_value_new_time               (const FFTime *val);
FFValue*    ff_value_new_timestamp          (const FFTimestamp *val);
FFValue*    ff_value_new_blob_id            (const ISC_QUAD *val);
void        ff_value_free                   (FFValue *self);

const gchar* ff_value_get_name              (FFValue *self);
void        ff_value_set_name               (FFValue *self,
                                             const gchar *value_name);
const gchar* ff_value_get_table_name        (FFValue *self);
void        ff_value_set_table_name         (FFValue *self,
                                             const gchar *table_name);

const gchar* ff_value_get_string            (FFValue *self);
void        ff_value_set_string             (FFValue *self,
                                             const gchar *val);
gint64      ff_value_get_int64              (FFValue *self);
void        ff_value_set_int64              (FFValue *self,
                                             gint64 val);
gint        ff_value_get_integer            (FFValue *self);
void        ff_value_set_integer            (FFValue *self,
                                             gint val);
gshort      ff_value_get_smallint           (FFValue *self);
void        ff_value_set_smallint           (FFValue *self,
                                             gshort val);
FFDecimal*  ff_value_get_decimal            (FFValue *self);
void        ff_value_set_decimal            (FFValue *self,
                                             const FFDecimal *val);
gdouble     ff_value_get_double             (FFValue *self);
void        ff_value_set_double             (FFValue *self,
                                             gdouble val);
gfloat      ff_value_get_float              (FFValue *self);
void        ff_value_set_float              (FFValue *self,
                                             gfloat val);
FFDate*     ff_value_get_date               (FFValue *self);
void        ff_value_set_date               (FFValue *self,
                                             const FFDate *val);
FFTime*     ff_value_get_time               (FFValue *self);
void        ff_value_set_time               (FFValue *self,
                                             const FFTime *val);
FFTimestamp* ff_value_get_timestamp         (FFValue *self);
void        ff_value_set_timestamp          (FFValue *self,
                                             const FFTimestamp *val);
ISC_QUAD*   ff_value_get_blob_id            (FFValue *self);
void        ff_value_set_blob_id            (FFValue *self,
                                             const ISC_QUAD *val);

FFValueType ff_value_get_value_type         (FFValue *self);
gchar*      ff_value_get_type_name          (FFValue *self);
gboolean    ff_value_is_null                (FFValue *self);
gboolean    ff_value_nullable               (FFValue *self);
void        ff_value_set_nullable           (FFValue *self,
                                             gboolean nullable);
FFValue*    ff_value_clone                  (FFValue *self);

FFDecimal*  ff_decimal_new                  (void);
void        ff_decimal_free                 (FFDecimal *self);

gfloat      ff_decimal_get_value_float      (FFDecimal *self);
void        ff_decimal_set_value_float      (FFDecimal *self,
                                             gfloat val,
                                             gint precision);
gdouble     ff_decimal_get_value_double     (FFDecimal *self);
void        ff_decimal_set_value_double     (FFDecimal *self,
                                             gdouble val,
                                             gint precision);
void        ff_decimal_set_value            (FFDecimal *self,
                                             const gchar *val,
                                             gint precision);

FFDate*     ff_date_new                     (void);
FFTime*     ff_time_new                     (void);
FFTimestamp* ff_timestamp_new               (void);

Description

Values are used to store statements field values.

Details

enum FFValueType

typedef enum {
	FF_VALUE_TYPE_STRING = 0,
	FF_VALUE_TYPE_INT64,
	FF_VALUE_TYPE_INTEGER,
	FF_VALUE_TYPE_SMALLINT,
	FF_VALUE_TYPE_DOUBLE,
	FF_VALUE_TYPE_FLOAT,
	FF_VALUE_TYPE_DECIMAL,
	FF_VALUE_TYPE_DATE,
	FF_VALUE_TYPE_TIME,
	FF_VALUE_TYPE_TIMESTAMP,
	FF_VALUE_TYPE_BLOB,
	FF_VALUE_TYPE_NULL,
	FF_VALUE_TYPE_UNKNOWN
} FFValueType;


struct FFDecimal

struct FFDecimal {

	gpointer value;
	glong precision;
};


struct FFDate

struct FFDate {

	gushort day;
	gushort month;
	gshort year;
};


struct FFTime

struct FFTime {

	gushort hour;
	gushort minute;
	gushort second;
};


struct FFTimestamp

struct FFTimestamp {

	gushort day;
	gushort month;
	gshort year;
	gushort hour;
	gushort minute;
	gushort second;
};


struct FFValue

struct FFValue;


ff_value_new ()

FFValue*    ff_value_new                    (void);

Create a new empty (null type) value.

Returns : A new FFValue.

ff_value_new_string ()

FFValue*    ff_value_new_string             (const gchar *val);

Create a new string value.

val : A string value.
Returns : A new FFValue.

ff_value_new_int64 ()

FFValue*    ff_value_new_int64              (gint64 val);

Create a new int64 value.

val : An int64.
Returns : A new FFValue.

ff_value_new_integer ()

FFValue*    ff_value_new_integer            (gint val);

Create a new integer value.

val : An integer.
Returns : A new FFValue.

ff_value_new_smallint ()

FFValue*    ff_value_new_smallint           (gshort val);

Create a new smallint value.

val : A smallint.
Returns : A new FFValue.

ff_value_new_double ()

FFValue*    ff_value_new_double             (gdouble val);

Create a new double value.

val : A double.
Returns : A new FFValue.

ff_value_new_float ()

FFValue*    ff_value_new_float              (gfloat val);

Create a new float value.

val : A float.
Returns : A new FFValue.

ff_value_new_decimal ()

FFValue*    ff_value_new_decimal            (const FFDecimal *val);

Create a new decimal/numeric value.

val : A FFDecimal.
Returns : A new FFValue.

ff_value_new_date ()

FFValue*    ff_value_new_date               (const FFDate *val);

Create a new date value.

val : A FFDate.
Returns : A new FFValue.

ff_value_new_time ()

FFValue*    ff_value_new_time               (const FFTime *val);

Create a new time value.

val : A FFTime.
Returns : A new FFValue.

ff_value_new_timestamp ()

FFValue*    ff_value_new_timestamp          (const FFTimestamp *val);

Create a new timestamp value.

val : A FFTimestamp.
Returns : A new FFValue.

ff_value_new_blob_id ()

FFValue*    ff_value_new_blob_id            (const ISC_QUAD *val);

Create a new blob id value.

val : An ISC_QUAD.
Returns : A new FFValue.

ff_value_free ()

void        ff_value_free                   (FFValue *self);

Free self.

self : A FFValue.

ff_value_get_name ()

const gchar* ff_value_get_name              (FFValue *self);

Get the name of self.

self : A FFValue.
Returns : A string containing the name of self.

ff_value_set_name ()

void        ff_value_set_name               (FFValue *self,
                                             const gchar *value_name);

Set the name of self.

self : A FFValue.
value_name : A string containing value name.

ff_value_get_table_name ()

const gchar* ff_value_get_table_name        (FFValue *self);

Get the table name of self.

self : A FFValue.
Returns : A string containing the table name of self.

ff_value_set_table_name ()

void        ff_value_set_table_name         (FFValue *self,
                                             const gchar *table_name);

Set the table name of self.

self : A FFValue.
table_name : A string containing name of table.

ff_value_get_string ()

const gchar* ff_value_get_string            (FFValue *self);

Get string from value.

self : A FFValue.
Returns : A string.

ff_value_set_string ()

void        ff_value_set_string             (FFValue *self,
                                             const gchar *val);

Set string value.

self : A FFValue.
val : A string.

ff_value_get_int64 ()

gint64      ff_value_get_int64              (FFValue *self);

Get int64 from value.

self : A FFValue.
Returns : An int64.

ff_value_set_int64 ()

void        ff_value_set_int64              (FFValue *self,
                                             gint64 val);

Set int64 value.

self : A FFValue.
val : An int64.

ff_value_get_integer ()

gint        ff_value_get_integer            (FFValue *self);

Get integer from value.

self : A FFValue.
Returns : An integer.

ff_value_set_integer ()

void        ff_value_set_integer            (FFValue *self,
                                             gint val);

Set integer value.

self : A FFValue.
val : An integer.

ff_value_get_smallint ()

gshort      ff_value_get_smallint           (FFValue *self);

Get smallint from value.

self : A FFValue.
Returns : A smallint.

ff_value_set_smallint ()

void        ff_value_set_smallint           (FFValue *self,
                                             gshort val);

Set smallint value.

self : A FFValue.
val : A short.

ff_value_get_decimal ()

FFDecimal*  ff_value_get_decimal            (FFValue *self);

Get decimal/numeric from value.

self : A FFValue.
Returns : A new FFDecimal copy of self value.

ff_value_set_decimal ()

void        ff_value_set_decimal            (FFValue *self,
                                             const FFDecimal *val);

Set decimal/numeric value.

self : A FFValue.
val : A FFDecimal.

ff_value_get_double ()

gdouble     ff_value_get_double             (FFValue *self);

Get double precision from value.

self : A FFValue.
Returns : A double.

ff_value_set_double ()

void        ff_value_set_double             (FFValue *self,
                                             gdouble val);

Set double precision value.

self : A FFValue.
val : A double.

ff_value_get_float ()

gfloat      ff_value_get_float              (FFValue *self);

Get float from value.

self : A FFValue.
Returns : A float.

ff_value_set_float ()

void        ff_value_set_float              (FFValue *self,
                                             gfloat val);

Set float value.

self : A FFValue.
val : A float.

ff_value_get_date ()

FFDate*     ff_value_get_date               (FFValue *self);

Get date from value.

self : A FFValue.
Returns : A new FFDdate copy of self value.

ff_value_set_date ()

void        ff_value_set_date               (FFValue *self,
                                             const FFDate *val);

Set date value..

self : A FFValue.
val : A FFDate.

ff_value_get_time ()

FFTime*     ff_value_get_time               (FFValue *self);

Get time from value.

self : A FFValue.
Returns : A new FFTime copy of self value.

ff_value_set_time ()

void        ff_value_set_time               (FFValue *self,
                                             const FFTime *val);

Set time value.

self : A FFValue.
val : A FFTime.

ff_value_get_timestamp ()

FFTimestamp* ff_value_get_timestamp         (FFValue *self);

Get timestamp from value.

self : A FFValue.
Returns : A new FFTimestamp copy of self value.

ff_value_set_timestamp ()

void        ff_value_set_timestamp          (FFValue *self,
                                             const FFTimestamp *val);

Set timestamp value.

self : A FFValue.
val : A FFTimestamp.

ff_value_get_blob_id ()

ISC_QUAD*   ff_value_get_blob_id            (FFValue *self);

Get blob id from value.

self : A FFValue.
Returns : A new ISC_QUAD.

ff_value_set_blob_id ()

void        ff_value_set_blob_id            (FFValue *self,
                                             const ISC_QUAD *val);

Set blob id value.

self : A FFValue.
val : A ISC_QUAD.

ff_value_get_value_type ()

FFValueType ff_value_get_value_type         (FFValue *self);

Get the type of value.

self : A FFValue.
Returns : A FFValueType.

ff_value_get_type_name ()

gchar*      ff_value_get_type_name          (FFValue *self);

Get a string representation of the current type.

self : A FFValue.
Returns : A string containing type name.

ff_value_is_null ()

gboolean    ff_value_is_null                (FFValue *self);

Get NULL status from value.

self : A FFValue.
Returns : TRUE if content of self value is null, of FALSE otherwise.

ff_value_nullable ()

gboolean    ff_value_nullable               (FFValue *self);

Get value nullable status.

self : A FFValue.
Returns : TRUE if value can be null, or FALSE if not.

ff_value_set_nullable ()

void        ff_value_set_nullable           (FFValue *self,
                                             gboolean nullable);

Set value nullable status.

self : A FFValue.
nullable : A boolean flag.

ff_value_clone ()

FFValue*    ff_value_clone                  (FFValue *self);

Clone self value.

self : A FFValue.
Returns : A new FFValue copy of self.

ff_decimal_new ()

FFDecimal*  ff_decimal_new                  (void);

Create a new empty decimal value.

Returns : A new FFDecimal.

ff_decimal_free ()

void        ff_decimal_free                 (FFDecimal *self);

Free decimal value.

self : A FFDecimal.

ff_decimal_get_value_float ()

gfloat      ff_decimal_get_value_float      (FFDecimal *self);

Get self content as float.

self : A FFDecimal.
Returns : self content as float, or 0 otherwise.

ff_decimal_set_value_float ()

void        ff_decimal_set_value_float      (FFDecimal *self,
                                             gfloat val,
                                             gint precision);

Set decimal value from a float.

self : A FFDecimal.
val : A float value for self.
precision : val precision.

ff_decimal_get_value_double ()

gdouble     ff_decimal_get_value_double     (FFDecimal *self);

Get self content as double.

self : A FFDecimal.
Returns : self content as double, or 0 otherwise.

ff_decimal_set_value_double ()

void        ff_decimal_set_value_double     (FFDecimal *self,
                                             gdouble val,
                                             gint precision);

Set decimal value from a double.

self : A FFDecimal.
val : A double value for self.
precision : val precision.

ff_decimal_set_value ()

void        ff_decimal_set_value            (FFDecimal *self,
                                             const gchar *val,
                                             gint precision);

Set decimal value from a string.

self : A FFDecimal.
val : A string value for self.
precision : val precision.

ff_date_new ()

FFDate*     ff_date_new                     (void);

Create a new FFDate with current locale date.

Returns : A new FFDate.

ff_time_new ()

FFTime*     ff_time_new                     (void);

Create a new FFTime with current locale time.

Returns : A new FFTime.

ff_timestamp_new ()

FFTimestamp* ff_timestamp_new               (void);

Create a new FFTimestamp with current locale timestamp.

Returns : A new FFTimestamp.