1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY! 2 #ifndef _GLIBMM_URIUTILS_H 3 #define _GLIBMM_URIUTILS_H 4 5 6 /* Copyright (C) 2002 The gtkmm Development Team 7 * 8 * This library is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public 10 * License as published by the Free Software Foundation; either 11 * version 2.1 of the License, or (at your option) any later version. 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 20 */ 21 22 23 #include <glibmmconfig.h> 24 #include <string> 25 26 namespace Glib 27 { 28 29 /** @defgroup UriUtils URI Utilities 30 * Various uri-related functions. 31 */ 32 33 //Note that the illegal_characters and reserved_chars_allowed parameters are bytes and may not be UTF-8 34 //so they are not Glib::ustring. See http://bugzilla.gnome.org/show_bug.cgi?id=508773 35 36 /** Unescapes a whole escaped string. 37 * If any of the characters in @a illegal_characters or the character zero appears 38 * as an escaped character in @a escaped_string then that is an error and an empty string 39 * will be returned. This is useful it you want to avoid, for instance, having a 40 * slash being expanded in an escaped path element, which might confuse pathname 41 * handling. 42 * 43 * @param escaped_string An escaped string to be unescaped. 44 * @param illegal_characters An optional string of illegal characters not to be allowed. 45 * @result An unescaped version of @a escaped_string. 46 * 47 * @ingroup UriUtils 48 * @newin{2,16} 49 */ 50 GLIBMM_API 51 std::string uri_unescape_string(const std::string& escaped_string, const std::string& illegal_characters = std::string()); 52 53 //TODO: Use iterator? 54 //char * g_uri_unescape_segment (const char *escaped_string, 55 // const char *escaped_string_end, 56 // const char *illegal_characters); 57 58 /** Gets the scheme portion of a URI. RFC 3986 decodes the scheme as: 59 * @code 60 * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] 61 * @endcode 62 * Common schemes include "file", "http", "svn+ssh", etc. 63 * 64 * @param uri 65 * @result The "Scheme" component of the URI, or an empty string on error. 66 * 67 * @ingroup UriUtils 68 * @newin{2,16} 69 */ 70 GLIBMM_API 71 std::string uri_parse_scheme(const std::string& uri); 72 73 /** Escapes a string for use in a URI. 74 * 75 * Normally all characters that are not "unreserved" (i.e. ASCII alphanumerical 76 * characters plus dash, dot, underscore and tilde) are escaped. 77 * But if you specify characters in @a reserved_chars_allowed they are not 78 * escaped. This is useful for the "reserved" characters in the URI 79 * specification, since those are allowed unescaped in some portions of 80 * a URI. 81 * 82 * @param unescaped The unescaped input string. 83 * @param reserved_chars_allowed A string of reserved characters that are allowed to be used. 84 * @param allow_utf8 true if the result can include UTF-8 characters. 85 * @result An escaped version of @a unescaped. 86 * 87 * @ingroup UriUtils 88 * @newin{2,16} 89 */ 90 GLIBMM_API 91 std::string uri_escape_string(const std::string& unescaped, const std::string& reserved_chars_allowed = std::string(), bool allow_utf8 = true); 92 93 } // namespace Glib 94 95 96 #endif /* _GLIBMM_URIUTILS_H */ 97 98