?? glib-commandline-option-parser.html
字號:
<tr><td><p><span class="term"><em class="parameter"><code>summary</code></em> :</span></p></td><td> a string to be shown in <code class="option">--help</code> output before the list of options, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div><p class="since">Since 2.12</p></div><hr><div class="refsect2" lang="en"><a name="id3127638"></a><h3><a name="g-option-context-get-summary"></a>g_option_context_get_summary ()</h3><a class="indexterm" name="id3127654"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* g_option_context_get_summary (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);</pre><p>Returns the summary. See <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-summary"><code class="function">g_option_context_set_summary()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the summary</td></tr></tbody></table></div><p class="since">Since 2.12</p></div><hr><div class="refsect2" lang="en"><a name="id3127743"></a><h3><a name="g-option-context-set-description"></a>g_option_context_set_description ()</h3><a class="indexterm" name="id3127759"></a><pre class="programlisting">void g_option_context_set_description (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context, const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *description);</pre><p>Adds a string to be displayed in <code class="option">--help</code> outputafter the list of options. This text often includes a bug reportingaddress.</p><p>Note that the summary is translated (see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translate-func"><code class="function">g_option_context_set_translate_func()</code></a>).</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>description</code></em> :</span></p></td><td> a string to be shown in <code class="option">--help</code> output after the list of options, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div><p class="since">Since 2.12</p></div><hr><div class="refsect2" lang="en"><a name="id3127882"></a><h3><a name="g-option-context-get-description"></a>g_option_context_get_description ()</h3><a class="indexterm" name="id3127897"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* g_option_context_get_description (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);</pre><p>Returns the description. See <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-description"><code class="function">g_option_context_set_description()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the description</td></tr></tbody></table></div><p class="since">Since 2.12</p></div><hr><div class="refsect2" lang="en"><a name="id3127986"></a><h3><a name="GTranslateFunc"></a>GTranslateFunc ()</h3><a class="indexterm" name="id3127998"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* (*GTranslateFunc) (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *str, <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre><p>The type of functions which are used to translate user-visiblestrings, for <code class="option">--help</code> output.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td><td>the untranslated string</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td><td>user data specified when installing the function, e.g. in <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translate-func"><code class="function">g_option_group_set_translate_func()</code></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a translation of the string for the current locale. The returned string is owned by GLib and must not be freed.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3128097"></a><h3><a name="g-option-context-set-translate-func"></a>g_option_context_set_translate_func ()</h3><a class="indexterm" name="id3128114"></a><pre class="programlisting">void g_option_context_set_translate_func (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context, <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc">GTranslateFunc</a> func, <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data, <a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> destroy_notify);</pre><p>Sets the function which is used to translate the contexts user-visible strings, for <code class="option">--help</code> output. If <em class="parameter"><code>func</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, strings are not translated.</p><p>Note that option groups have their own translation functions, this function only affects the <em class="parameter"><code>parameter_string</code></em> (see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-new"><code class="function">g_option_context_new()</code></a>), the summary (see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-summary"><code class="function">g_option_context_set_summary()</code></a>) and the description (see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-description"><code class="function">g_option_context_set_description()</code></a>).</p><p>If you are using <code class="function">gettext()</code>, you only need to set the translationdomain, see <code class="function">g_context_group_set_translation_domain()</code>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td><td> the <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc"><span class="type">GTranslateFunc</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> </td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td><td> user data to pass to <em class="parameter"><code>func</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>destroy_notify</code></em> :</span></p></td><td> a function which gets called to free <em class="parameter"><code>data</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div><p class="since">Since 2.12</p></div><hr><div class="refsect2" lang="en"><a name="id3128390"></a><h3><a name="g-option-context-set-translation-domain"></a>g_option_context_set_translation_domain ()</h3><a class="indexterm" name="id3128406"></a><pre class="programlisting">void g_option_context_set_translation_domain (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context, const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *domain);</pre><p>A convenience function to use <code class="function">gettext()</code> for translatinguser-visible strings.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td><td> the domain to use</td></tr></tbody></table></div><p class="since">Since 2.12</p></div><hr><div class="refsect2" lang="en"><a name="id3128506"></a><h3>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -