![]() |
![]() |
![]() |
GObject Introspection Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
typedef GIFieldInfo; enum GIFieldInfoFlags; GIFieldInfoFlags g_field_info_get_flags (GIFieldInfo *info
); gint g_field_info_get_size (GIFieldInfo *info
); gint g_field_info_get_offset (GIFieldInfo *info
); GITypeInfo * g_field_info_get_type (GIFieldInfo *info
); gboolean g_field_info_get_field (GIFieldInfo *field_info
,gpointer mem
,GArgument *value
); gboolean g_field_info_set_field (GIFieldInfo *field_info
,gpointer mem
,const GArgument *value
);
A GIFieldInfo struct represents a field of a struct (see GIStructInfo),
union (see GIUnionInfo) or an object (see GIObjectInfo). The GIFieldInfo
is fetched by calling g_struct_info_get_field()
, g_union_info_get_field()
or g_object_info_get_value()
.
A field has a size, type and a struct offset asssociated and a set of flags,
which is currently GI_FIELD_IS_READABLE or GI_FIELD_IS_WRITABLE.
typedef enum { GI_FIELD_IS_READABLE = 1 << 0, GI_FIELD_IS_WRITABLE = 1 << 1 } GIFieldInfoFlags;
Flags for a GIFieldInfo.
GIFieldInfoFlags g_field_info_get_flags (GIFieldInfo *info
);
|
|
Returns : |
gboolean g_field_info_get_field (GIFieldInfo *field_info
,gpointer mem
,GArgument *value
);
Reads a field identified by a GFieldInfo from a C structure or union. This only handles fields of simple C types. It will fail for a field of a composite type like a nested structure or union even if that is actually readable.
|
a GIFieldInfo |
|
pointer to a block of memory representing a C structure or union |
|
a GArgument into which to store the value retrieved |
Returns : |
TRUE if reading the field succeeded, otherwise FALSE
|
gboolean g_field_info_set_field (GIFieldInfo *field_info
,gpointer mem
,const GArgument *value
);
Writes a field identified by a GFieldInfo to a C structure or union. This only handles fields of simple C types. It will fail for a field of a composite type like a nested structure or union even if that is actually writable. Note also that that it will refuse to write fields where memory management would by required. A field with a type such as 'char *' must be set with a setter function.
|
a GIFieldInfo |
|
pointer to a block of memory representing a C structure or union |
|
a GArgument holding the value to store |
Returns : |
TRUE if writing the field succeeded, otherwise FALSE
|