libgnomevfsmm  2.26.0
utils.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 #ifndef _LIBGNOMEVFSMM_UTILS_H
3 #define _LIBGNOMEVFSMM_UTILS_H
4 /* $Id: utils.h 2019 2009-01-27 08:29:42Z murrayc $ */
5 
6 /* utils.h
7  *
8  * Copyright 2004 gnome-vfsmm development team.
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free
22  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  */
24 
25 #include <libgnomevfsmm/types.h>
27 #include <glibmm/ustring.h>
28 
29 
30 namespace Gnome
31 {
32 
33 namespace Vfs
34 {
35 
43 Glib::ustring format_file_size_for_display(FileSize size);
44 
50 Glib::ustring escape_string(const Glib::ustring& unescaped_string);
51 
58 Glib::ustring escape_path_string(const Glib::ustring& path);
59 
66 Glib::ustring escape_host_and_path_string(const Glib::ustring& path);
67 
74 Glib::ustring escape_slashes(const Glib::ustring& unescaped_string);
75 
86 Glib::ustring unescape_string(const Glib::ustring& escaped_string, const Glib::ustring& illegal_characters = Glib::ustring());
87 
102 Glib::ustring unescape_string_for_display(const Glib::ustring& escaped_string);
103 
113 Glib::ustring make_uri_canonical(const Glib::ustring& uri);
114 
115 Glib::ustring make_path_name_canonical(const Glib::ustring& path);
116 
124 Glib::ustring expand_initial_tilde(const Glib::ustring& path);
125 
126 
134 Glib::ustring get_local_path_from_uri(const Glib::ustring& uri);
135 
141 Glib::ustring get_uri_from_local_path(const Glib::ustring& local_full_path);
142 
149 bool is_executable_command_string(const Glib::ustring& command_string);
150 
151 Glib::ustring icon_path_from_filename(const Glib::ustring& filename);
152 
153 #ifdef GLIBMM_EXCEPTIONS_ENABLED
154 void url_show (const Glib::ustring& url) throw(exception);
155 #else
156 void url_show (const Glib::ustring& url, std::auto_ptr<Gnome::Vfs::exception>& error);
157 #endif //GLIBMM_EXCEPTIONS_ENABLED
158 
159 //TODO: Where does this envp come from? It seems to be an input parameter.
160 //void url_show (const Glib::ustring& url, char** envp) throw(exception);
161 
162 } //namespace Vfs
163 } //namespace Gnome
164 
165 #endif //_LIBGNOMEVFSMM_UTILS_H
166 
Glib::ustring get_uri_from_local_path(const Glib::ustring &local_full_path)
Returns a file:/// URI for the local path .
Definition: address.h:36
Glib::ustring unescape_string(const Glib::ustring &escaped_string, const Glib::ustring &illegal_characters=Glib::ustring())
Decodes escaped characters (i.e.
Glib::ustring make_path_name_canonical(const Glib::ustring &path)
Glib::ustring escape_host_and_path_string(const Glib::ustring &path)
Escapes path, replacing only special characters that would not be found in paths or host name (so &#39;/&#39;...
Glib::ustring format_file_size_for_display(FileSize size)
Formats the file size passed in sizein a way that is easy for the user to read.
bool is_executable_command_string(const Glib::ustring &command_string)
Checks if command_string starts with the full path of an executable file or an executable in $PATH...
Glib::ustring icon_path_from_filename(const Glib::ustring &filename)
Glib::ustring get_local_path_from_uri(const Glib::ustring &uri)
Create a local path for a file:/// URI.
Glib::ustring escape_slashes(const Glib::ustring &unescaped_string)
Escapes only &#39;/&#39; and &#39;&#39; characters in , replacing them with their escape sequence equivalents...
Glib::ustring unescape_string_for_display(const Glib::ustring &escaped_string)
Similar to unescape_string(), but it returns something semi-intelligable to a user even upon receivin...
Glib::ustring escape_string(const Glib::ustring &unescaped_string)
Escapes , replacing any and all special characters with equivalent escape sequences.
GnomeVFSFileSize FileSize
Definition: types.h:29
Glib::ustring escape_path_string(const Glib::ustring &path)
Escapes , replacing only special characters that would not be found in paths (so &#39;/&#39;, &#39;&&#39;, &#39;=&#39;, and &#39;?&#39; will not be escaped by this function).
Glib::ustring expand_initial_tilde(const Glib::ustring &path)
If path starts with a ~, representing the user&#39;s home directory, expand it to the actual path locatio...
Glib::ustring make_uri_canonical(const Glib::ustring &uri)
gnome_vfs_make_path_name_canonical: : a file path, relative or absolute
void url_show(const Glib::ustring &url)