Fire Foot API Reference Manual |
---|
FFValue — Class for handling values.
#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);
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 FFTimestamp { gushort day; gushort month; gshort year; gushort hour; gushort minute; gushort second; };
FFValue* ff_value_new (void);
Create a new empty (null type) value.
Returns : | A new FFValue. |
FFValue* ff_value_new_string (const gchar *val);
Create a new string value.
val : | A string value. |
Returns : | A new FFValue. |
FFValue* ff_value_new_int64 (gint64 val);
Create a new int64 value.
val : | An int64. |
Returns : | A new FFValue. |
FFValue* ff_value_new_integer (gint val);
Create a new integer value.
val : | An integer. |
Returns : | A new FFValue. |
FFValue* ff_value_new_smallint (gshort val);
Create a new smallint value.
val : | A smallint. |
Returns : | A new FFValue. |
FFValue* ff_value_new_double (gdouble val);
Create a new double value.
val : | A double. |
Returns : | A new FFValue. |
FFValue* ff_value_new_float (gfloat val);
Create a new float value.
val : | A float. |
Returns : | A new FFValue. |
FFValue* ff_value_new_decimal (const FFDecimal *val);
Create a new decimal/numeric value.
FFValue* ff_value_new_timestamp (const FFTimestamp *val);
Create a new timestamp value.
val : | A FFTimestamp. |
Returns : | A new FFValue. |
FFValue* ff_value_new_blob_id (const ISC_QUAD *val);
Create a new blob id value.
val : | An ISC_QUAD. |
Returns : | A new FFValue. |
const gchar* ff_value_get_name (FFValue *self);
Get the name of self.
self : | A FFValue. |
Returns : | A string containing the name of self. |
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. |
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. |
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. |
const gchar* ff_value_get_string (FFValue *self);
Get string from value.
self : | A FFValue. |
Returns : | A string. |
void ff_value_set_string (FFValue *self, const gchar *val);
Set string value.
self : | A FFValue. |
val : | A string. |
gint64 ff_value_get_int64 (FFValue *self);
Get int64 from value.
self : | A FFValue. |
Returns : | An int64. |
void ff_value_set_int64 (FFValue *self, gint64 val);
Set int64 value.
self : | A FFValue. |
val : | An int64. |
gint ff_value_get_integer (FFValue *self);
Get integer from value.
self : | A FFValue. |
Returns : | An integer. |
void ff_value_set_integer (FFValue *self, gint val);
Set integer value.
self : | A FFValue. |
val : | An integer. |
gshort ff_value_get_smallint (FFValue *self);
Get smallint from value.
self : | A FFValue. |
Returns : | A smallint. |
void ff_value_set_smallint (FFValue *self, gshort val);
Set smallint value.
self : | A FFValue. |
val : | A short. |
FFDecimal* ff_value_get_decimal (FFValue *self);
Get decimal/numeric from value.
void ff_value_set_decimal (FFValue *self, const FFDecimal *val);
Set decimal/numeric value.
gdouble ff_value_get_double (FFValue *self);
Get double precision from value.
self : | A FFValue. |
Returns : | A double. |
void ff_value_set_double (FFValue *self, gdouble val);
Set double precision value.
self : | A FFValue. |
val : | A double. |
gfloat ff_value_get_float (FFValue *self);
Get float from value.
self : | A FFValue. |
Returns : | A float. |
void ff_value_set_float (FFValue *self, gfloat val);
Set float value.
self : | A FFValue. |
val : | A float. |
FFDate* ff_value_get_date (FFValue *self);
Get date from value.
self : | A FFValue. |
Returns : | A new FFDdate copy of self value. |
FFTimestamp* ff_value_get_timestamp (FFValue *self);
Get timestamp from value.
self : | A FFValue. |
Returns : | A new FFTimestamp copy of self value. |
void ff_value_set_timestamp (FFValue *self, const FFTimestamp *val);
Set timestamp value.
self : | A FFValue. |
val : | A FFTimestamp. |
ISC_QUAD* ff_value_get_blob_id (FFValue *self);
Get blob id from value.
self : | A FFValue. |
Returns : | A new ISC_QUAD. |
void ff_value_set_blob_id (FFValue *self, const ISC_QUAD *val);
Set blob id value.
self : | A FFValue. |
val : | A ISC_QUAD. |
FFValueType ff_value_get_value_type (FFValue *self);
Get the type of value.
self : | A FFValue. |
Returns : | A FFValueType. |
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. |
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. |
gboolean ff_value_nullable (FFValue *self);
Get value nullable status.
self : | A FFValue. |
Returns : | TRUE if value can be null, or FALSE if not. |
void ff_value_set_nullable (FFValue *self, gboolean nullable);
Set value nullable status.
self : | A FFValue. |
nullable : | A boolean flag. |
FFDecimal* ff_decimal_new (void);
Create a new empty decimal value.
Returns : | A new FFDecimal. |
gfloat ff_decimal_get_value_float (FFDecimal *self);
Get self content as float.
self : | A FFDecimal. |
Returns : | self content as float, or 0 otherwise. |
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. |
gdouble ff_decimal_get_value_double (FFDecimal *self);
Get self content as double.
self : | A FFDecimal. |
Returns : | self content as double, or 0 otherwise. |
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. |
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. |
FFDate* ff_date_new (void);
Create a new FFDate with current locale date.
Returns : | A new FFDate. |
FFTime* ff_time_new (void);
Create a new FFTime with current locale time.
Returns : | A new FFTime. |
FFTimestamp* ff_timestamp_new (void);
Create a new FFTimestamp with current locale timestamp.
Returns : | A new FFTimestamp. |
<< FFBlob | FFService >> |