DataHandler

Members

Functions

acceptsGType
bool acceptsGType(gobject.types.GType type)

Checks wether the GdaDataHandler is able to handle the gda type given as argument.

getDescr
string getDescr()

Get a short description of the GdaDataHandler

getSaneInitValue
gobject.value.Value getSaneInitValue(gobject.types.GType type)

Creates a new GValue which holds a sane initial value to be used if no value is specifically provided. For example for a simple string, this would return a new value containing the "" string.

getSqlFromValue
string getSqlFromValue(gobject.value.Value value)

Creates a new string which is an SQL representation of the given value, the returned string can be used directly in an SQL statement. For example if value is a G_TYPE_STRING, then the returned string will be correctly quoted. Note however that it is a better practice to use variables in statements instead of value literals, see the <link linkend="GdaSqlParser.description">GdaSqlParser</link> for more information.

getStrFromValue
string getStrFromValue(gobject.value.Value value)

Creates a new string which is a "user friendly" representation of the given value (in the user's locale, specially for the dates). If the value is NULL or is of type GDA_TYPE_NULL, the returned string is a copy of "" (empty string).

getValueFromSql
gobject.value.Value getValueFromSql(string sql, gobject.types.GType type)

Creates a new GValue which represents the SQL value given as argument. This is the opposite of the function gda.data_handler.DataHandler.getSqlFromValue. The type argument is used to determine the real data type requested for the returned value.

getValueFromStr
gobject.value.Value getValueFromStr(string str, gobject.types.GType type)

Creates a new GValue which represents the str value given as argument. This is the opposite of the function gda.data_handler.DataHandler.getStrFromValue. The type argument is used to determine the real data type requested for the returned value.

Static functions

_getGType
GType _getGType()
getDefault
gda.data_handler.DataHandler getDefault(gobject.types.GType forType)

Obtain a pointer to a #GdaDataHandler which can manage #GValue values of type for_type. The returned data handler will be adapted to use the current locale information (for example dates will be formatted taking into account the locale).