1
0
mirror of https://gitlab.gnome.org/GNOME/glib.git synced 2025-07-26 20:07:51 +02:00
Files
debian
docs
reference
glib
gobject
tmpl
enumerations_flags.sgml
gboxed.sgml
gclosure.sgml
generic_values.sgml
gobject-unused.sgml
gparamspec.sgml
gtype.sgml
gtypemodule.sgml
gtypeplugin.sgml
objects.sgml
param_value_types.sgml
signals.sgml
value_arrays.sgml
value_collection.sgml
.cvsignore
Makefile.am
glib-genmarshal.1
glib-genmarshal.xml
glib-mkenums.1
glib-mkenums.xml
gobject-docs.sgml
gobject-overrides.txt
gobject-query.1
gobject-query.xml
gobject-sections.txt
gobject.cI
gobject.types
tut_gobject.xml
tut_gsignal.xml
tut_gtype.xml
tut_howto.xml
tut_intro.xml
tut_tools.xml
version.xml.in
.cvsignore
AUTHORS
COPYING
ChangeLog
Makefile.am
NEWS
README
README.cvs-commits
.cvsignore
Changes-2.0.txt
Makefile.am
debugging.txt
macros.txt
glib
gmodule
gobject
gthread
m4macros
po
tests
.cvsignore
AUTHORS
COPYING
ChangeLog
ChangeLog.pre-1-2
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
HACKING
INSTALL
INSTALL.in
Makefile.am
NEWS
NEWS.pre-1-3
README
README.in
README.win32
TODO.xml
acglib.m4
acinclude.m4
autogen.sh
config.h.win32.in
configure.in
glib-2.0-uninstalled.pc.in
glib-2.0.pc.in
glib-gettextize.in
glib-zip.in
glib.spec.in
glibconfig.h.win32.in
gmodule-2.0-uninstalled.pc.in
gmodule-2.0.pc.in
gmodule-no-export-2.0.pc.in
gobject-2.0-uninstalled.pc.in
gobject-2.0.pc.in
gthread-2.0-uninstalled.pc.in
gthread-2.0.pc.in
makefile.mingw
makefile.msc
msvc_recommended_pragmas.h
sanity_check
win32-fixup.pl
glib/docs/reference/gobject/tmpl/value_arrays.sgml

138 lines
3.8 KiB
Plaintext
Raw Normal View History

<!-- ##### SECTION Title ##### -->
Value arrays
<!-- ##### SECTION Short_Description ##### -->
2002-11-28 00:15:45 +00:00
A container structure to maintain an array of generic values
<!-- ##### SECTION Long_Description ##### -->
<para>
The prime purpose of a #GValueArray is for it to be used as an object property
that holds an array of values. A #GValueArray wraps an array of #GValue elements
in order for it to be used as a boxed type through %G_TYPE_VALUE_ARRAY.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
#GValue, #GParamSpecValueArray, g_param_spec_value_array()
</para>
<!-- ##### STRUCT GValueArray ##### -->
<para>
A #GValueArray contains an array of #GValue elements.
</para>
@n_values: number of values contained in the array
@values: array of values
<!-- ##### FUNCTION g_value_array_get_nth ##### -->
<para>
Return a pointer to the value at @index_ containd in @value_array.
</para>
@value_array: #GValueArray to get a value from
@index_: index of the value of interest
@Returns: pointer to a value at @index_ in @value_array
<!-- ##### FUNCTION g_value_array_new ##### -->
<para>
Allocate and initialize a new #GValueArray, optionally preserve space
for @n_prealloced elements. New arrays always contain 0 elements,
regardless of the value of @n_prealloced.
</para>
@n_prealloced: number of values to preallocate space for
@Returns: a newly allocated #GValueArray with 0 values
<!-- ##### FUNCTION g_value_array_copy ##### -->
<para>
Construct an exact copy of a #GValueArray by duplicating all its
contents.
</para>
@value_array: #GValueArray to copy
@Returns: Newly allocated copy of #GValueArray
<!-- ##### FUNCTION g_value_array_free ##### -->
<para>
Free a #GValueArray including its contents.
</para>
@value_array:
<!-- ##### FUNCTION g_value_array_append ##### -->
<para>
Insert a copy of @value as last element of @value_array.
</para>
@value_array: #GValueArray to add an element to
@value: #GValue to copy into #GValueArray
@Returns: the #GValueArray passed in as @value_array
<!-- ##### FUNCTION g_value_array_prepend ##### -->
<para>
Insert a copy of @value as first element of @value_array.
</para>
@value_array: #GValueArray to add an element to
@value: #GValue to copy into #GValueArray
@Returns: the #GValueArray passed in as @value_array
<!-- ##### FUNCTION g_value_array_insert ##### -->
<para>
Insert a copy of @value at specified position into @value_array.
</para>
@value_array: #GValueArray to add an element to
@index_: insertion position, must be &lt;= value_array-&gt;n_values
@value: #GValue to copy into #GValueArray
@Returns: the #GValueArray passed in as @value_array
<!-- ##### FUNCTION g_value_array_remove ##### -->
<para>
Remove the value at position @index_ from @value_array.
</para>
@value_array: #GValueArray to remove an element from
@index_: position of value to remove, must be &lt; value_array->n_values
@Returns: the #GValueArray passed in as @value_array
<!-- ##### FUNCTION g_value_array_sort ##### -->
<para>
Sort @value_array using @compare_func to compare the elements accoring to
the semantics of #GCompareFunc.
</para>
<para>
The current implementation uses Quick-Sort as sorting algorithm.
</para>
@value_array: #GValueArray to sort
@compare_func: function to compare elements
@Returns: the #GValueArray passed in as @value_array
<!-- ##### FUNCTION g_value_array_sort_with_data ##### -->
<para>
Sort @value_array using @compare_func to compare the elements accoring
to the semantics of #GCompareDataFunc.
</para>
<para>
The current implementation uses Quick-Sort as sorting algorithm.
</para>
@value_array: #GValueArray to sort
@compare_func: function to compare elements
@user_data: extra data argument provided for @compare_func
@Returns: the #GValueArray passed in as @value_array