本文整理汇总了C++中G_IS_VALUE函数的典型用法代码示例。如果您正苦于以下问题:C++ G_IS_VALUE函数的具体用法?C++ G_IS_VALUE怎么用?C++ G_IS_VALUE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了G_IS_VALUE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: _midgard_dbobject_get_property
gboolean
_midgard_dbobject_get_property (MidgardDBObject *self, const gchar *name, GValue *value)
{
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (name != NULL, FALSE);
g_return_val_if_fail (G_IS_VALUE (value), FALSE);
if (!self->dbpriv->datamodel)
return FALSE;
GdaDataModel *model = GDA_DATA_MODEL (self->dbpriv->datamodel);
if (!model || (model && !GDA_IS_DATA_MODEL (model)))
return FALSE;
gint col_idx = gda_data_model_get_column_index (model, name);
if (col_idx == -1)
return FALSE;
const GValue *src_val = gda_data_model_get_value_at (model, col_idx, self->dbpriv->row, NULL);
if (!src_val)
return FALSE;
if (!G_IS_VALUE (src_val)
|| (G_IS_VALUE (src_val)
&& G_VALUE_TYPE (src_val) == GDA_TYPE_NULL)) {
/* NULL fetched from underlying field */
if (G_VALUE_HOLDS_STRING (value)) {
g_value_set_string (value, "");
return TRUE;
}
g_warning ("Can not find value for given '%s' property \n", name);
return FALSE;
}
if (G_VALUE_TYPE (src_val) != G_VALUE_TYPE (value))
g_value_transform (src_val, value);
else
g_value_copy (src_val, value);
if (G_VALUE_HOLDS_STRING (value) && g_value_get_string (value) == NULL)
g_value_set_string (value, "");
return TRUE;
}
开发者ID:William-Wai,项目名称:midgard-core,代码行数:44,代码来源:midgard_dbobject.c
示例2: destroy_gvalue
static void
destroy_gvalue(GValue *value)
{
if (value != NULL)
{
g_return_if_fail(G_IS_VALUE(value));
g_value_reset(value);
g_free(value);
}
}
开发者ID:ldotlopez,项目名称:eina,代码行数:10,代码来源:lomo-stream.c
示例3:
gchar *GstUtils::gvalue_serialize(const GValue *val) {
if (!G_IS_VALUE(val))
return nullptr;
gchar *val_str;
if (G_VALUE_TYPE(val) == G_TYPE_STRING)
val_str = g_strdup(g_value_get_string(val));
else
val_str = gst_value_serialize(val);
return val_str;
}
开发者ID:dulton,项目名称:switcher,代码行数:10,代码来源:gst-utils.cpp
示例4: coil_expandable_value_equals
coil_expandable_value_equals(const GValue *v1,
const GValue *v2,
GError **error) /* no need */
{
g_return_val_if_fail(G_IS_VALUE(v1), FALSE);
g_return_val_if_fail(G_IS_VALUE(v2), FALSE);
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
const CoilExpandable *x1, *x2;
if (!(G_VALUE_HOLDS(v1, COIL_TYPE_EXPANDABLE)
&& G_VALUE_HOLDS(v2, COIL_TYPE_EXPANDABLE)))
return FALSE;
x1 = COIL_EXPANDABLE(g_value_get_object(v1));
x2 = COIL_EXPANDABLE(g_value_get_object(v2));
return coil_expandable_equals(x1, x2, error);
}
开发者ID:jc0n,项目名称:coil,代码行数:19,代码来源:expandable.c
示例5: conting_attributes_get_string
const gchar *
conting_attributes_get_string(ContingAttributes *self, const gchar *name)
{
const GValue *value;
value = conting_attributes_get_value(self, name);
g_return_val_if_fail(value != NULL && G_IS_VALUE(value), NULL);
return g_value_get_string(value);
}
开发者ID:gcms,项目名称:gustavo,代码行数:11,代码来源:contingattributes.c
示例6: gst_lfo_control_source_reset
static void
gst_lfo_control_source_reset (GstLFOControlSource * self)
{
GstControlSource *csource = GST_CONTROL_SOURCE (self);
csource->get_value = NULL;
csource->get_value_array = NULL;
self->priv->type = self->priv->base = G_TYPE_INVALID;
if (G_IS_VALUE (&self->priv->minimum_value))
g_value_unset (&self->priv->minimum_value);
if (G_IS_VALUE (&self->priv->maximum_value))
g_value_unset (&self->priv->maximum_value);
if (G_IS_VALUE (&self->priv->amplitude))
g_value_unset (&self->priv->amplitude);
if (G_IS_VALUE (&self->priv->offset))
g_value_unset (&self->priv->offset);
}
开发者ID:WangCrystal,项目名称:gstreamer,代码行数:20,代码来源:gstlfocontrolsource.c
示例7: value_free
static void
value_free (GDataFreebaseTopicValue *value)
{
if (G_IS_VALUE (&value->value))
g_value_unset (&value->value);
g_free (value->text);
g_free (value->lang);
g_free (value->creator);
g_free (value->property);
g_slice_free (GDataFreebaseTopicValue, value);
}
开发者ID:Distrotech,项目名称:libgdata,代码行数:11,代码来源:gdata-freebase-topic-result.c
示例8: gobj_new_ensure
static VALUE
gobj_new_ensure(struct param_setup_arg* arg)
{
guint i;
g_type_class_unref(arg->gclass);
for (i = 0; i < arg->param_size; i++) {
if (G_IS_VALUE(&arg->params[i].value))
g_value_unset(&arg->params[i].value);
}
return Qnil;
}
开发者ID:geoffyoungs,项目名称:ruby-gnome2,代码行数:11,代码来源:rbgobj_object.c
示例9: g_value_fits_pointer
/**
* g_value_fits_pointer:
* @value: An initialized #GValue structure.
*
* Determines if @value will fit inside the size of a pointer value.
* This is an internal function introduced mainly for C marshallers.
*
* Returns: %TRUE if @value will fit inside a pointer value.
*/
gboolean
g_value_fits_pointer (const GValue *value)
{
GTypeValueTable *value_table;
g_return_val_if_fail (G_IS_VALUE (value), FALSE);
value_table = g_type_value_table_peek (G_VALUE_TYPE (value));
return value_table->value_peek_pointer != NULL;
}
开发者ID:n37r06u3,项目名称:SourceLearning,代码行数:20,代码来源:gvalue.c
示例10: property_context_from_gvalue
gboolean property_context_from_gvalue(PropertyContext * ctx, GValue * value)
{
if (ctx == NULL) {
return FALSE;
}
if (!G_IS_VALUE(value)) {
return FALSE;
}
g_value_copy(value, &(ctx->value));
return TRUE;
}
开发者ID:definite,项目名称:ibus-chewing,代码行数:11,代码来源:MakerDialogProperty.c
示例11: finalize
static void
finalize (GObject *object)
{
NMVPNPlugin *plugin = NM_VPN_PLUGIN (object);
NMVPNPluginPrivate *priv = NM_VPN_PLUGIN_GET_PRIVATE (plugin);
nm_vpn_plugin_set_connection (plugin, NULL);
g_free (priv->dbus_service_name);
if (G_IS_VALUE (&priv->banner))
g_value_unset (&priv->banner);
if (G_IS_VALUE (&priv->tundev))
g_value_unset (&priv->tundev);
if (G_IS_VALUE (&priv->gateway))
g_value_unset (&priv->gateway);
if (G_IS_VALUE (&priv->mtu))
g_value_unset (&priv->mtu);
G_OBJECT_CLASS (nm_vpn_plugin_parent_class)->finalize (object);
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:20,代码来源:nm-vpn-plugin.c
示例12: steadyflow_file_list_controller_file_from_iter
static SteadyflowCoreIDownloadFile* steadyflow_file_list_controller_file_from_iter (SteadyflowFileListController* self, GtkTreeIter* iter) {
SteadyflowCoreIDownloadFile* result = NULL;
GValue value = {0};
GtkListStore* _tmp0_;
GtkTreeIter _tmp1_;
GValue _tmp2_ = {0};
GObject* _tmp3_ = NULL;
SteadyflowCoreIDownloadFile* _tmp4_;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (iter != NULL, NULL);
_tmp0_ = self->priv->model;
_tmp1_ = *iter;
gtk_tree_model_get_value ((GtkTreeModel*) _tmp0_, &_tmp1_, 0, &_tmp2_);
G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
value = _tmp2_;
_tmp3_ = g_value_get_object (&value);
_tmp4_ = _g_object_ref0 (STEADYFLOW_CORE_IDOWNLOAD_FILE (_tmp3_));
result = _tmp4_;
G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
return result;
}
开发者ID:SICS-projects,项目名称:steadyflow,代码行数:21,代码来源:FileListController.c
示例13: test_gvalue_callback
static GValue *
test_gvalue_callback (GObject *object, const GValue *v)
{
GValue *ret = g_malloc0 (sizeof (GValue));
g_return_val_if_fail (G_IS_OBJECT (object), NULL);
g_return_val_if_fail (G_IS_VALUE (v), NULL);
g_value_init (ret, G_VALUE_TYPE (v));
g_value_copy (v, ret);
return ret;
}
开发者ID:GNOME,项目名称:pygobject,代码行数:12,代码来源:testhelpermodule.c
示例14: gnc_value_get_guid
/**
* gnc_value_get_guid
*
* @param value a @c GValue whose value we want to get.
*
* @return the value stored in @a value
*/
const GncGUID*
gnc_value_get_guid (const GValue *value)
{
GncGUID *val;
g_return_val_if_fail (value && G_IS_VALUE (value), NULL);
g_return_val_if_fail (GNC_VALUE_HOLDS_GUID (value), NULL);
val = (GncGUID*) g_value_get_boxed (value);
return val;
}
开发者ID:JohannesKlug,项目名称:gnucash,代码行数:19,代码来源:guid.cpp
示例15: GN_value_unset
gboolean GN_value_unset(int ARI, ei_x_buff *XBUF, char *B, int *I){
GValue* object;
/* no return value */
if ( ! gn_check_arity(XBUF, 1, ARI) ) return FALSE;
if ( ! gn_get_arg_struct(XBUF, B, I, "GValue", (void**)&object) ) return FALSE;
if ( G_IS_VALUE(object) ) g_value_unset(object);
gn_put_void(XBUF);
return TRUE;
}
开发者ID:charlesdaniel,项目名称:gtknode,代码行数:12,代码来源:gtknode_internal.c
示例16: rbgio_gasyncinitable_new_async_ensure
static VALUE
rbgio_gasyncinitable_new_async_ensure(struct rbgio_gasyncinitable_new_async_data *data)
{
guint i;
g_type_class_unref(data->gclass);
for (i = 0; i < data->n_parameters; i++)
if (G_IS_VALUE(&data->parameters[i].value))
g_value_unset(&data->parameters[i].value);
return Qnil;
}
开发者ID:geoffyoungs,项目名称:ruby-gnome2,代码行数:12,代码来源:gasyncinitable.c
示例17: update_type_list
static void
update_type_list (AnjutaShell *shell, IAnjutaIterable *iter, const gchar *name)
{
gchar *list = NULL;
GValue value = {0,};
if (iter)
{
ianjuta_iterable_first (iter, NULL);
if (ianjuta_iterable_get_length (iter, NULL) > 0)
{
GString *s = g_string_sized_new(ianjuta_iterable_get_length (iter, NULL) * 10);
do {
IAnjutaSymbol *symbol = IANJUTA_SYMBOL (iter);
const gchar *sname = ianjuta_symbol_get_string (symbol, IANJUTA_SYMBOL_FIELD_NAME, NULL);
g_string_append(s, sname);
g_string_append_c(s, ' ');
} while (ianjuta_iterable_next (iter, NULL));
list = g_string_free(s, FALSE);
}
}
anjuta_shell_get_value (shell, name, &value, NULL);
if (G_VALUE_HOLDS_STRING(&value))
{
const gchar *value_list = g_value_get_string (&value);
if (list == NULL)
{
anjuta_shell_remove_value (shell, name, NULL);
}
else if (strcmp (list, value_list) == 0)
{
g_free (list);
}
else
{
g_value_take_string (&value, list);
anjuta_shell_add_value (shell, name, &value, NULL);
}
}
else
{
if (list != NULL)
{
g_value_init (&value, G_TYPE_STRING);
g_value_take_string (&value, list);
anjuta_shell_add_value (shell, name, &value, NULL);
}
}
if (G_IS_VALUE (&value))
g_value_unset (&value);
}
开发者ID:GNOME,项目名称:anjuta-extras,代码行数:53,代码来源:plugin.c
示例18: _midgard_cr_core_query_value_finalize
static void
_midgard_cr_core_query_value_finalize (GObject *object)
{
MidgardCRCoreQueryValue *self = MIDGARD_CR_CORE_QUERY_VALUE (object);
if (G_IS_VALUE (&self->priv->value))
g_value_unset (&self->priv->value);
g_free (self->priv);
self->priv = NULL;
parent_class->finalize (object);
}
开发者ID:indeyets,项目名称:midgard-core,代码行数:13,代码来源:midgard_cr_core_query_value.c
示例19: g_value_unset
/**
* g_value_unset:
* @value: An initialized #GValue structure.
*
* Clears the current value in @value and "unsets" the type,
* this releases all resources associated with this GValue.
* An unset value is the same as an uninitialized (zero-filled)
* #GValue structure.
*/
void
g_value_unset (GValue *value)
{
GTypeValueTable *value_table;
g_return_if_fail (G_IS_VALUE (value));
value_table = g_type_value_table_peek (G_VALUE_TYPE (value));
if (value_table->value_free)
value_table->value_free (value);
memset (value, 0, sizeof (*value));
}
开发者ID:n37r06u3,项目名称:SourceLearning,代码行数:22,代码来源:gvalue.c
示例20: g_value_copy
/**
* g_value_copy:
* @src_value: An initialized #GValue structure.
* @dest_value: An initialized #GValue structure of the same type as @src_value.
*
* Copies the value of @src_value into @dest_value.
*/
void
g_value_copy (const GValue *src_value,
GValue *dest_value)
{
g_return_if_fail (G_IS_VALUE (src_value));
g_return_if_fail (G_IS_VALUE (dest_value));
g_return_if_fail (g_value_type_compatible (G_VALUE_TYPE (src_value), G_VALUE_TYPE (dest_value)));
if (src_value != dest_value)
{
GType dest_type = G_VALUE_TYPE (dest_value);
GTypeValueTable *value_table = g_type_value_table_peek (dest_type);
/* make sure dest_value's value is free()d */
if (value_table->value_free)
value_table->value_free (dest_value);
/* setup and copy */
value_meminit (dest_value, dest_type);
value_table->value_copy (src_value, dest_value);
}
}
开发者ID:n37r06u3,项目名称:SourceLearning,代码行数:29,代码来源:gvalue.c
注:本文中的G_IS_VALUE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论