⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 value_arrays.sgml

📁 GLib是GTK+和GNOME工程的基础底层核心程序库
💻 SGML
📖 第 1 页 / 共 2 页
字号:
<programlisting><link linkend="GValueArray">GValueArray</link>* g_value_array_append           (<link linkend="GValueArray">GValueArray</link> *value_array,                                             const <link linkend="GValue">GValue</link> *value);</programlisting><para>Insert a copy of <parameter>value</parameter> as last element of <parameter>value_array</parameter>.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>value_array</parameter>&nbsp;:</entry><entry><link linkend="GValueArray">GValueArray</link> to add an element to</entry></row><row><entry align="right"><parameter>value</parameter>&nbsp;:</entry><entry>      <link linkend="GValue">GValue</link> to copy into <link linkend="GValueArray">GValueArray</link></entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>    the <link linkend="GValueArray">GValueArray</link> passed in as <parameter>value_array</parameter></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-value-array-prepend">g_value_array_prepend ()</title><programlisting><link linkend="GValueArray">GValueArray</link>* g_value_array_prepend          (<link linkend="GValueArray">GValueArray</link> *value_array,                                             const <link linkend="GValue">GValue</link> *value);</programlisting><para>Insert a copy of <parameter>value</parameter> as first element of <parameter>value_array</parameter>.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>value_array</parameter>&nbsp;:</entry><entry><link linkend="GValueArray">GValueArray</link> to add an element to</entry></row><row><entry align="right"><parameter>value</parameter>&nbsp;:</entry><entry>      <link linkend="GValue">GValue</link> to copy into <link linkend="GValueArray">GValueArray</link></entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>    the <link linkend="GValueArray">GValueArray</link> passed in as <parameter>value_array</parameter></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-value-array-insert">g_value_array_insert ()</title><programlisting><link linkend="GValueArray">GValueArray</link>* g_value_array_insert           (<link linkend="GValueArray">GValueArray</link> *value_array,                                             <link linkend="guint">guint</link> index,                                             const <link linkend="GValue">GValue</link> *value);</programlisting><para>Insert a copy of <parameter>value</parameter> at specified position into <parameter>value_array</parameter>.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>value_array</parameter>&nbsp;:</entry><entry><link linkend="GValueArray">GValueArray</link> to add an element to</entry></row><row><entry align="right"><parameter>index</parameter>&nbsp;:</entry><entry>      insertion position, must be <= value_array->n_values</entry></row><row><entry align="right"><parameter>value</parameter>&nbsp;:</entry><entry>      <link linkend="GValue">GValue</link> to copy into <link linkend="GValueArray">GValueArray</link></entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>    the <link linkend="GValueArray">GValueArray</link> passed in as <parameter>value_array</parameter></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-value-array-remove">g_value_array_remove ()</title><programlisting><link linkend="GValueArray">GValueArray</link>* g_value_array_remove           (<link linkend="GValueArray">GValueArray</link> *value_array,                                             <link linkend="guint">guint</link> index);</programlisting><para>Remove the value at position <parameter>index</parameter> from <parameter>value_array</parameter>.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>value_array</parameter>&nbsp;:</entry><entry><link linkend="GValueArray">GValueArray</link> to remove an element from</entry></row><row><entry align="right"><parameter>index</parameter>&nbsp;:</entry><entry>      position of value to remove, must be < value_array->n_values</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>    the <link linkend="GValueArray">GValueArray</link> passed in as <parameter>value_array</parameter></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-value-array-sort">g_value_array_sort ()</title><programlisting><link linkend="GValueArray">GValueArray</link>* g_value_array_sort             (<link linkend="GValueArray">GValueArray</link> *value_array,                                             <link linkend="GCompareFunc">GCompareFunc</link> compare_func);</programlisting><para>Sort <parameter>value_array</parameter> using <parameter>compare_func</parameter> to compare the elements accoring tothe semantics of <link linkend="GCompareFunc">GCompareFunc</link>.</para><para>The current implementation uses Quick-Sort as sorting algorithm.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>value_array</parameter>&nbsp;:</entry><entry> <link linkend="GValueArray">GValueArray</link> to sort</entry></row><row><entry align="right"><parameter>compare_func</parameter>&nbsp;:</entry><entry>function to compare elements</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>     the <link linkend="GValueArray">GValueArray</link> passed in as <parameter>value_array</parameter></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-value-array-sort-with-data">g_value_array_sort_with_data ()</title><programlisting><link linkend="GValueArray">GValueArray</link>* g_value_array_sort_with_data   (<link linkend="GValueArray">GValueArray</link> *value_array,                                             <link linkend="GCompareDataFunc">GCompareDataFunc</link> compare_func,                                             <link linkend="gpointer">gpointer</link> user_data);</programlisting><para>Sort <parameter>value_array</parameter> using <parameter>compare_func</parameter> to compare the elements accoringto the semantics of <link linkend="GCompareDataFunc">GCompareDataFunc</link>.</para><para>The current implementation uses Quick-Sort as sorting algorithm.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>value_array</parameter>&nbsp;:</entry><entry>  <link linkend="GValueArray">GValueArray</link> to sort</entry></row><row><entry align="right"><parameter>compare_func</parameter>&nbsp;:</entry><entry> function to compare elements</entry></row><row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry><entry>    extra data argument provided for <parameter>compare_func</parameter></entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>      the <link linkend="GValueArray">GValueArray</link> passed in as <parameter>value_array</parameter></entry></row></tbody></tgroup></informaltable></refsect2></refsect1><refsect1><title>See Also</title><para><link linkend="GValue">GValue</link>, <link linkend="GParamSpecValueArray">GParamSpecValueArray</link>, <link linkend="g-param-spec-value-array">g_param_spec_value_array</link>()</para></refsect1></refentry>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -