?? glib-miscellaneous-utility-functions.html
字號:
<td> the current user's home directory</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3071577"></a><h3><a name="g-get-tmp-dir"></a>g_get_tmp_dir ()</h3><a class="indexterm" name="id3071590"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* g_get_tmp_dir (void);</pre><p>Gets the directory to use for temporary files. This is found from inspecting the environment variables <code class="envar">TMPDIR</code>, <code class="envar">TMP</code>, and <code class="envar">TEMP</code> in that order. If none of those are defined "/tmp" is returned on UNIX and "C:\" on Windows. The encoding of the returned string is system-defined. On Windows, it is always UTF-8. The return value is never <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the directory to use for temporary files.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3071657"></a><h3><a name="g-get-current-dir"></a>g_get_current_dir ()</h3><a class="indexterm" name="id3071671"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* g_get_current_dir (void);</pre><p>Gets the current directory.The returned string should be freed when no longer needed. The encoding of the returned string is system defined. On Windows, it is always UTF-8.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the current directory.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3071713"></a><h3><a name="g-basename"></a>g_basename ()</h3><a class="indexterm" name="id3071728"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* g_basename (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *file_name);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">g_basename</code> has been deprecated since version 2.2 and should not be used in newly-written code. Use <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-path-get-basename"><code class="function">g_path_get_basename()</code></a> instead, but notice that<a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-path-get-basename"><code class="function">g_path_get_basename()</code></a> allocates new memory for the returned string, unlikethis function which returns a pointer into the argument.</p></div><p>Gets the name of the file without any leading directory components. It returns a pointer into the given file name string.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>file_name</code></em> :</span></p></td><td> the name of the file.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the name of the file without any leading directory components.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3071827"></a><h3><a name="g-dirname"></a>g_dirname</h3><a class="indexterm" name="id3071842"></a><pre class="programlisting">#define g_dirname</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">g_dirname</code> is deprecated and should not be used in newly-written code.</p></div><p>This function is deprecated and will be removed in the next majorrelease of GLib. Use <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-path-get-dirname"><code class="function">g_path_get_dirname()</code></a> instead.</p><p>Gets the directory components of a file name.If the file name has no directory components "." is returned.The returned string should be freed when no longer needed.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the directory components of the file.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3071904"></a><h3><a name="g-path-is-absolute"></a>g_path_is_absolute ()</h3><a class="indexterm" name="id3071916"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> g_path_is_absolute (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *file_name);</pre><p>Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the given <em class="parameter"><code>file_name</code></em> is an absolute file name,i.e. it contains a full path from the root directory such as "/usr/local"on UNIX or "C:\windows" on Windows systems.</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>file_name</code></em> :</span></p></td><td> a file name.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>file_name</code></em> is an absolute path. </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3072011"></a><h3><a name="g-path-skip-root"></a>g_path_skip_root ()</h3><a class="indexterm" name="id3072024"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* g_path_skip_root (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *file_name);</pre><p>Returns a pointer into <em class="parameter"><code>file_name</code></em> after the root component, i.e. afterthe "/" in UNIX or "C:\" under Windows. If <em class="parameter"><code>file_name</code></em> is not an absolutepath it returns <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</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>file_name</code></em> :</span></p></td><td> a file name.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a pointer into <em class="parameter"><code>file_name</code></em> after the root component.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3072116"></a><h3><a name="g-path-get-basename"></a>g_path_get_basename ()</h3><a class="indexterm" name="id3072129"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* g_path_get_basename (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *file_name);</pre><p>Gets the last component of the filename. If <em class="parameter"><code>file_name</code></em> ends with a directory separator it gets the component before the last slash. If <em class="parameter"><code>file_name</code></em> consists only of directory separators (and on Windows, possibly a drive letter), a single separator is returned. If<em class="parameter"><code>file_name</code></em> is empty, it gets ".".</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>file_name</code></em> :</span></p></td><td> the name of the file.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a newly allocated string containing the last component of the filename.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3072213"></a><h3><a name="g-path-get-dirname"></a>g_path_get_dirname ()</h3><a class="indexterm" name="id3072226"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* g_path_get_dirname (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *file_name);</pre><p>Gets the directory components of a file name. If the file name has nodirectory components "." is returned. The returned string should befreed when no longer needed.</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>file_name</code></em> :</span></p></td><td> the name of the file.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the directory components of the file.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3072290"></a><h3><a name="g-build-filename"></a>g_build_filename ()</h3><a class="indexterm" name="id3072302"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* g_build_filename (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *first_element, ...);</pre><p>Creates a filename from a series of elements using the correctseparator for filenames.</p><p>On Unix, this function behaves identically to <code class="literal">g_build_path(G_DIR_SEPARATOR_S, first_element, ....)</code>.</p><p>On Windows, it takes into account that either the backslash(<code class="literal">\</code> or slash (<code class="literal">/</code>) can be usedas separator in filenames, but otherwise behaves as on Unix. Whenfile pathname separators need to be inserted, the one that lastpreviously occurred in the parameters (reading from left to right)is used.</p><p>No attempt is made to force the resulting filename to be an absolutepath. If the first element is a relative path, the result willbe a relative path.</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>first_element</code></em> :</span></p></td><td> the first element in the path</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td> remaining elements in path, terminated by <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -