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
30namespace Gnome
31{
32
33namespace Vfs
34{
35
44
50Glib::ustring escape_string(const Glib::ustring& unescaped_string);
51
58Glib::ustring escape_path_string(const Glib::ustring& path);
59
66Glib::ustring escape_host_and_path_string(const Glib::ustring& path);
67
74Glib::ustring escape_slashes(const Glib::ustring& unescaped_string);
75
86Glib::ustring unescape_string(const Glib::ustring& escaped_string, const Glib::ustring& illegal_characters = Glib::ustring());
87
102Glib::ustring unescape_string_for_display(const Glib::ustring& escaped_string);
103
113Glib::ustring make_uri_canonical(const Glib::ustring& uri);
114
115Glib::ustring make_path_name_canonical(const Glib::ustring& path);
116
124Glib::ustring expand_initial_tilde(const Glib::ustring& path);
125
126
134Glib::ustring get_local_path_from_uri(const Glib::ustring& uri);
135
141Glib::ustring get_uri_from_local_path(const Glib::ustring& local_full_path);
142
149bool is_executable_command_string(const Glib::ustring& command_string);
150
151Glib::ustring icon_path_from_filename(const Glib::ustring& filename);
152
153#ifdef GLIBMM_EXCEPTIONS_ENABLED
154void url_show (const Glib::ustring& url) throw(exception);
155#else
156void 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
Definition exception.h:34
Glib::ustring icon_path_from_filename(const Glib::ustring &filename)
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 '/'...
Glib::ustring make_path_name_canonical(const Glib::ustring &path)
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...
GnomeVFSFileSize FileSize
Definition types.h:29
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.
Glib::ustring get_uri_from_local_path(const Glib::ustring &local_full_path)
Returns a file:/// URI for the local path @local_full_path.
Glib::ustring get_local_path_from_uri(const Glib::ustring &uri)
Create a local path for a file:/// URI.
Glib::ustring unescape_string(const Glib::ustring &escaped_string, const Glib::ustring &illegal_characters=Glib::ustring())
Decodes escaped characters (i.e.
Glib::ustring escape_path_string(const Glib::ustring &path)
Escapes @path, replacing only special characters that would not be found in paths (so '/',...
void url_show(const Glib::ustring &url)
Glib::ustring escape_slashes(const Glib::ustring &unescaped_string)
Escapes only '/' and '' characters in @string, replacing them with their escape sequence equivalents.
Glib::ustring escape_string(const Glib::ustring &unescaped_string)
Escapes @unescaped_string, replacing any and all special characters with equivalent escape sequences.
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 expand_initial_tilde(const Glib::ustring &path)
If path starts with a ~, representing the user'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: @path: a file path, relative or absolute
Definition address.h:37