<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.5"/> <title>libgnomevfsmm: utils.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">libgnomevfsmm  <span id="projectnumber">2.26.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.5 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_7598c38c7918ec99052b2c305f69ea0f.html">libgnomevfs</a></li><li class="navelem"><a class="el" href="dir_6428cd5a50a531db9bfb758e33f1f87c.html">libgnomevfsmm</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">utils.h</div> </div> </div><!--header--> <div class="contents"> <a href="utils_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// -*- c++ -*-</span></div> <div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#ifndef _LIBGNOMEVFSMM_UTILS_H</span></div> <div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="preprocessor"></span><span class="preprocessor">#define _LIBGNOMEVFSMM_UTILS_H</span></div> <div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="preprocessor"></span><span class="comment">/* $Id: utils.h 2019 2009-01-27 08:29:42Z murrayc $ */</span></div> <div class="line"><a name="l00005"></a><span class="lineno"> 5</span> </div> <div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">/* utils.h</span></div> <div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> *</span></div> <div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * Copyright 2004 gnome-vfsmm development team.</span></div> <div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> *</span></div> <div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * This library is free software; you can redistribute it and/or</span></div> <div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span></div> <div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * License as published by the Free Software Foundation; either</span></div> <div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span></div> <div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> *</span></div> <div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * This library is distributed in the hope that it will be useful,</span></div> <div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div> <div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></div> <div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> * Lesser General Public License for more details.</span></div> <div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> *</span></div> <div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span></div> <div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> * License along with this library; if not, write to the Free</span></div> <div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span></div> <div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> */</span></div> <div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div> <div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <<a class="code" href="types_8h.html">libgnomevfsmm/types.h</a>></span></div> <div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <<a class="code" href="exception_8h.html">libgnomevfsmm/exception.h</a>></span></div> <div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <glibmm/ustring.h></span></div> <div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div> <div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div> <div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">namespace </span>Gnome</div> <div class="line"><a name="l00031"></a><span class="lineno"> 31</span> {</div> <div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div> <div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">namespace </span>Vfs</div> <div class="line"><a name="l00034"></a><span class="lineno"> 34</span> {</div> <div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div> <div class="line"><a name="l00043"></a><span class="lineno"> 43</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#a55c1e2883b6dc40cb2f5af0c11731c3a">format_file_size_for_display</a>(<a class="code" href="namespaceGnome_1_1Vfs.html#a46d71f215c684f228c1cd6b96145dbf3">FileSize</a> size);</div> <div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div> <div class="line"><a name="l00050"></a><span class="lineno"> 50</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#ae44f0604b15aebb45602e2ef9d885dad">escape_string</a>(<span class="keyword">const</span> Glib::ustring& unescaped_string);</div> <div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div> <div class="line"><a name="l00058"></a><span class="lineno"> 58</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#a98881499542ac4bc82fda362d2c35d35">escape_path_string</a>(<span class="keyword">const</span> Glib::ustring& path);</div> <div class="line"><a name="l00059"></a><span class="lineno"> 59</span> </div> <div class="line"><a name="l00066"></a><span class="lineno"> 66</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#a1a89ca226ab5b547bee54a69c2983b63">escape_host_and_path_string</a>(<span class="keyword">const</span> Glib::ustring& path);</div> <div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div> <div class="line"><a name="l00074"></a><span class="lineno"> 74</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#add0396d59f16dff6f416d34ad58fe2a2">escape_slashes</a>(<span class="keyword">const</span> Glib::ustring& unescaped_string);</div> <div class="line"><a name="l00075"></a><span class="lineno"> 75</span> </div> <div class="line"><a name="l00086"></a><span class="lineno"> 86</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#a95fa58a8551523a8bdb46856bb3a034a">unescape_string</a>(<span class="keyword">const</span> Glib::ustring& escaped_string, <span class="keyword">const</span> Glib::ustring& illegal_characters = Glib::ustring());</div> <div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div> <div class="line"><a name="l00102"></a><span class="lineno"> 102</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#a31f3e94c30295906c414965420567f3e">unescape_string_for_display</a>(<span class="keyword">const</span> Glib::ustring& escaped_string);</div> <div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div> <div class="line"><a name="l00113"></a><span class="lineno"> 113</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#afb0b1f2ddc9d0e3ef8aac84a3cb4ccb2">make_uri_canonical</a>(<span class="keyword">const</span> Glib::ustring& uri);</div> <div class="line"><a name="l00114"></a><span class="lineno"> 114</span> </div> <div class="line"><a name="l00115"></a><span class="lineno"> 115</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#a1ca6b2be79699486bf77a3ea296ce9e0">make_path_name_canonical</a>(<span class="keyword">const</span> Glib::ustring& path);</div> <div class="line"><a name="l00116"></a><span class="lineno"> 116</span> </div> <div class="line"><a name="l00124"></a><span class="lineno"> 124</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#afa5e0efd0c70eed75d866353059efe25">expand_initial_tilde</a>(<span class="keyword">const</span> Glib::ustring& path);</div> <div class="line"><a name="l00125"></a><span class="lineno"> 125</span> </div> <div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div> <div class="line"><a name="l00134"></a><span class="lineno"> 134</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#a92ec606549321a6bdacef83226439831">get_local_path_from_uri</a>(<span class="keyword">const</span> Glib::ustring& uri);</div> <div class="line"><a name="l00135"></a><span class="lineno"> 135</span> </div> <div class="line"><a name="l00141"></a><span class="lineno"> 141</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#a61570a7451880c56e8ca3d3d4e790b95">get_uri_from_local_path</a>(<span class="keyword">const</span> Glib::ustring& local_full_path);</div> <div class="line"><a name="l00142"></a><span class="lineno"> 142</span> </div> <div class="line"><a name="l00149"></a><span class="lineno"> 149</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceGnome_1_1Vfs.html#ae86c117cc685be64a4900bf9efe7955e">is_executable_command_string</a>(<span class="keyword">const</span> Glib::ustring& command_string);</div> <div class="line"><a name="l00150"></a><span class="lineno"> 150</span> </div> <div class="line"><a name="l00151"></a><span class="lineno"> 151</span> Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs.html#a007d2b16c5271afd625b7f65c903d2a3">icon_path_from_filename</a>(<span class="keyword">const</span> Glib::ustring& filename);</div> <div class="line"><a name="l00152"></a><span class="lineno"> 152</span> </div> <div class="line"><a name="l00153"></a><span class="lineno"> 153</span> <span class="preprocessor">#ifdef GLIBMM_EXCEPTIONS_ENABLED</span></div> <div class="line"><a name="l00154"></a><span class="lineno"> 154</span> <span class="preprocessor"></span><span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs.html#a9daf5ccd8059e7505c2138de22130dfa">url_show</a> (<span class="keyword">const</span> Glib::ustring& url) <span class="keywordflow">throw</span>(exception);</div> <div class="line"><a name="l00155"></a><span class="lineno"> 155</span> <span class="preprocessor">#else</span></div> <div class="line"><a name="l00156"></a><span class="lineno"> 156</span> <span class="preprocessor"></span><span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs.html#a9daf5ccd8059e7505c2138de22130dfa">url_show</a> (<span class="keyword">const</span> Glib::ustring& url, std::auto_ptr<Gnome::Vfs::exception>& error);</div> <div class="line"><a name="l00157"></a><span class="lineno"> 157</span> <span class="preprocessor">#endif //GLIBMM_EXCEPTIONS_ENABLED</span></div> <div class="line"><a name="l00158"></a><span class="lineno"> 158</span> <span class="preprocessor"></span></div> <div class="line"><a name="l00159"></a><span class="lineno"> 159</span> <span class="comment">//TODO: Where does this envp come from? It seems to be an input parameter.</span></div> <div class="line"><a name="l00160"></a><span class="lineno"> 160</span> <span class="comment">//void url_show (const Glib::ustring& url, char** envp) throw(exception);</span></div> <div class="line"><a name="l00161"></a><span class="lineno"> 161</span> </div> <div class="line"><a name="l00162"></a><span class="lineno"> 162</span> } <span class="comment">//namespace Vfs</span></div> <div class="line"><a name="l00163"></a><span class="lineno"> 163</span> } <span class="comment">//namespace Gnome</span></div> <div class="line"><a name="l00164"></a><span class="lineno"> 164</span> </div> <div class="line"><a name="l00165"></a><span class="lineno"> 165</span> <span class="preprocessor">#endif //_LIBGNOMEVFSMM_UTILS_H</span></div> <div class="line"><a name="l00166"></a><span class="lineno"> 166</span> <span class="preprocessor"></span></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_a61570a7451880c56e8ca3d3d4e790b95"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#a61570a7451880c56e8ca3d3d4e790b95">Gnome::Vfs::get_uri_from_local_path</a></div><div class="ttdeci">Glib::ustring get_uri_from_local_path(const Glib::ustring &local_full_path)</div><div class="ttdoc">Returns a file:/// URI for the local path . </div></div> <div class="ttc" id="types_8h_html"><div class="ttname"><a href="types_8h.html">types.h</a></div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_a95fa58a8551523a8bdb46856bb3a034a"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#a95fa58a8551523a8bdb46856bb3a034a">Gnome::Vfs::unescape_string</a></div><div class="ttdeci">Glib::ustring unescape_string(const Glib::ustring &escaped_string, const Glib::ustring &illegal_characters=Glib::ustring())</div><div class="ttdoc">Decodes escaped characters (i.e. </div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_a1ca6b2be79699486bf77a3ea296ce9e0"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#a1ca6b2be79699486bf77a3ea296ce9e0">Gnome::Vfs::make_path_name_canonical</a></div><div class="ttdeci">Glib::ustring make_path_name_canonical(const Glib::ustring &path)</div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_a1a89ca226ab5b547bee54a69c2983b63"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#a1a89ca226ab5b547bee54a69c2983b63">Gnome::Vfs::escape_host_and_path_string</a></div><div class="ttdeci">Glib::ustring escape_host_and_path_string(const Glib::ustring &path)</div><div class="ttdoc">Escapes path, replacing only special characters that would not be found in paths or host name (so &#39;/&#39;...</div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_a55c1e2883b6dc40cb2f5af0c11731c3a"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#a55c1e2883b6dc40cb2f5af0c11731c3a">Gnome::Vfs::format_file_size_for_display</a></div><div class="ttdeci">Glib::ustring format_file_size_for_display(FileSize size)</div><div class="ttdoc">Formats the file size passed in sizein a way that is easy for the user to read. </div></div> <div class="ttc" id="exception_8h_html"><div class="ttname"><a href="exception_8h.html">exception.h</a></div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_ae86c117cc685be64a4900bf9efe7955e"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#ae86c117cc685be64a4900bf9efe7955e">Gnome::Vfs::is_executable_command_string</a></div><div class="ttdeci">bool is_executable_command_string(const Glib::ustring &command_string)</div><div class="ttdoc">Checks if command_string starts with the full path of an executable file or an executable in $PATH...</div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_a007d2b16c5271afd625b7f65c903d2a3"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#a007d2b16c5271afd625b7f65c903d2a3">Gnome::Vfs::icon_path_from_filename</a></div><div class="ttdeci">Glib::ustring icon_path_from_filename(const Glib::ustring &filename)</div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_a92ec606549321a6bdacef83226439831"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#a92ec606549321a6bdacef83226439831">Gnome::Vfs::get_local_path_from_uri</a></div><div class="ttdeci">Glib::ustring get_local_path_from_uri(const Glib::ustring &uri)</div><div class="ttdoc">Create a local path for a file:/// URI. </div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_add0396d59f16dff6f416d34ad58fe2a2"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#add0396d59f16dff6f416d34ad58fe2a2">Gnome::Vfs::escape_slashes</a></div><div class="ttdeci">Glib::ustring escape_slashes(const Glib::ustring &unescaped_string)</div><div class="ttdoc">Escapes only &#39;/&#39; and &#39;&#39; characters in , replacing them with their escape sequence equivalents...</div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_a31f3e94c30295906c414965420567f3e"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#a31f3e94c30295906c414965420567f3e">Gnome::Vfs::unescape_string_for_display</a></div><div class="ttdeci">Glib::ustring unescape_string_for_display(const Glib::ustring &escaped_string)</div><div class="ttdoc">Similar to unescape_string(), but it returns something semi-intelligable to a user even upon receivin...</div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_ae44f0604b15aebb45602e2ef9d885dad"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#ae44f0604b15aebb45602e2ef9d885dad">Gnome::Vfs::escape_string</a></div><div class="ttdeci">Glib::ustring escape_string(const Glib::ustring &unescaped_string)</div><div class="ttdoc">Escapes , replacing any and all special characters with equivalent escape sequences. </div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_a46d71f215c684f228c1cd6b96145dbf3"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#a46d71f215c684f228c1cd6b96145dbf3">Gnome::Vfs::FileSize</a></div><div class="ttdeci">GnomeVFSFileSize FileSize</div><div class="ttdef"><b>Definition:</b> types.h:29</div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_a98881499542ac4bc82fda362d2c35d35"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#a98881499542ac4bc82fda362d2c35d35">Gnome::Vfs::escape_path_string</a></div><div class="ttdeci">Glib::ustring escape_path_string(const Glib::ustring &path)</div><div class="ttdoc">Escapes , replacing only special characters that would not be found in paths (so &#39;/&#39;, &#39;&amp;&#39;, &#39;=&#39;, and &#39;?&#39; will not be escaped by this function). </div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_afa5e0efd0c70eed75d866353059efe25"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#afa5e0efd0c70eed75d866353059efe25">Gnome::Vfs::expand_initial_tilde</a></div><div class="ttdeci">Glib::ustring expand_initial_tilde(const Glib::ustring &path)</div><div class="ttdoc">If path starts with a ~, representing the user&#39;s home directory, expand it to the actual path locatio...</div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_afb0b1f2ddc9d0e3ef8aac84a3cb4ccb2"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#afb0b1f2ddc9d0e3ef8aac84a3cb4ccb2">Gnome::Vfs::make_uri_canonical</a></div><div class="ttdeci">Glib::ustring make_uri_canonical(const Glib::ustring &uri)</div><div class="ttdoc">gnome_vfs_make_path_name_canonical: : a file path, relative or absolute </div></div> <div class="ttc" id="namespaceGnome_1_1Vfs_html_a9daf5ccd8059e7505c2138de22130dfa"><div class="ttname"><a href="namespaceGnome_1_1Vfs.html#a9daf5ccd8059e7505c2138de22130dfa">Gnome::Vfs::url_show</a></div><div class="ttdeci">void url_show(const Glib::ustring &url)</div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Fri Oct 18 2013 01:26:08 for libgnomevfsmm by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.5 </small></address> </body> </html>