本文整理匯總了C++中G_IS_VALUE函數的典型用法代碼示例。如果您正苦於以下問題:C++ G_IS_VALUE函數的具體用法?C++ G_IS_VALUE怎麽用?C++ G_IS_VALUE使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了G_IS_VALUE函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}