📄 glib-bookmark-file-parser.html
字号:
<div class="refsect2" lang="en"><a name="id3198772"></a><h3><a name="g-bookmark-file-free"></a>g_bookmark_file_free ()</h3><a class="indexterm" name="id3198788"></a><pre class="programlisting">void g_bookmark_file_free (<a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile">GBookmarkFile</a> *bookmark);</pre><p>Frees a <a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile"><span class="type">GBookmarkFile</span></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>bookmark</code></em> :</span></p></td><td> a <a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile"><span class="type">GBookmarkFile</span></a></td></tr></tbody></table></div><p class="since">Since 2.12</p></div><hr><div class="refsect2" lang="en"><a name="id3198861"></a><h3><a name="g-bookmark-file-load-from-file"></a>g_bookmark_file_load_from_file ()</h3><a class="indexterm" name="id3198877"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> g_bookmark_file_load_from_file (<a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile">GBookmarkFile</a> *bookmark, const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *filename, <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>Loads a desktop bookmark file into an empty <a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile"><span class="type">GBookmarkFile</span></a> structure.If the file could not be loaded then <em class="parameter"><code>error</code></em> is set to either a <a class="link" href="glib-File-Utilities.html#GFileError"><span class="type">GFileError</span></a>or <a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFileError"><span class="type">GBookmarkFileError</span></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>bookmark</code></em> :</span></p></td><td> an empty <a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile"><span class="type">GBookmarkFile</span></a> struct</td></tr><tr><td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td><td> the path of a filename to load, in the GLib file name encoding</td></tr><tr><td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td><td> return location for a <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</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"><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 a desktop bookmark file could be loaded</td></tr></tbody></table></div><p class="since">Since 2.12</p></div><hr><div class="refsect2" lang="en"><a name="id3199058"></a><h3><a name="g-bookmark-file-load-from-data"></a>g_bookmark_file_load_from_data ()</h3><a class="indexterm" name="id3199074"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> g_bookmark_file_load_from_data (<a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile">GBookmarkFile</a> *bookmark, const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *data, <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> length, <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>Loads a bookmark file from memory into an empty <a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile"><span class="type">GBookmarkFile</span></a>structure. If the object cannot be created then <em class="parameter"><code>error</code></em> is set to a<a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFileError"><span class="type">GBookmarkFileError</span></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>bookmark</code></em> :</span></p></td><td> an empty <a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile"><span class="type">GBookmarkFile</span></a> struct</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td><td> desktop bookmarks loaded in memory</td></tr><tr><td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td><td> the length of <em class="parameter"><code>data</code></em> in bytes</td></tr><tr><td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td><td> return location for a <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</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"><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 a desktop bookmark could be loaded.</td></tr></tbody></table></div><p class="since">Since 2.12</p></div><hr><div class="refsect2" lang="en"><a name="id3199275"></a><h3><a name="g-bookmark-file-load-from-data-dirs"></a>g_bookmark_file_load_from_data_dirs ()</h3><a class="indexterm" name="id3199291"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> g_bookmark_file_load_from_data_dirs (<a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile">GBookmarkFile</a> *bookmark, const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *file, <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **full_path, <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>This function looks for a desktop bookmark file named <em class="parameter"><code>file</code></em> in thepaths returned from <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-data-dir"><code class="function">g_get_user_data_dir()</code></a> and <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-system-data-dirs"><code class="function">g_get_system_data_dirs()</code></a>, loads the file into <em class="parameter"><code>bookmark</code></em> and returns the file's full path in <em class="parameter"><code>full_path</code></em>. If the file could not be loaded then an <code class="literal">error</code> isset to either a <a class="link" href="glib-File-Utilities.html#GFileError"><span class="type">GFileError</span></a> or <a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFileError"><span class="type">GBookmarkFileError</span></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>bookmark</code></em> :</span></p></td><td> a <a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile"><span class="type">GBookmarkFile</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td><td> a relative path to a filename to open and parse</td></tr><tr><td><p><span class="term"><em class="parameter"><code>full_path</code></em> :</span></p></td><td> return location for a string containing the full path of the file, 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>error</code></em> :</span></p></td><td> return location for a <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</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"><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 a key file could be loaded, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> othewise</td></tr></tbody></table></div><p class="since">Since 2.12</p></div><hr><div class="refsect2" lang="en"><a name="id3199551"></a><h3><a name="g-bookmark-file-to-data"></a>g_bookmark_file_to_data ()</h3><a class="indexterm" name="id3199566"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* g_bookmark_file_to_data (<a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile">GBookmarkFile</a> *bookmark, <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *length, <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>This function outputs <em class="parameter"><code>bookmark</code></em> as a string.</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>bookmark</code></em> :</span></p></td><td> a <a class="link" href="glib-Bookmark-file-parser.html#GBookmarkFile"><span class="type">GBookmarkFile</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td><td> return location for the length of the returned string, 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>error</code></em> :</span></p></td><td> return location for a <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -