Uri functions

Uri functions

Synopsis




#define             G_URI_RESERVED_CHARS_GENERIC_DELIMITERS
#define             G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS
#define             G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT
#define             G_URI_RESERVED_CHARS_ALLOWED_IN_PATH
#define             G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO
char*               g_uri_unescape_string               (const char *escaped_string,
                                                         const char *illegal_characters);
char*               g_uri_unescape_segment              (const char *escaped_string,
                                                         const char *escaped_string_end,
                                                         const char *illegal_characters);
char*               g_uri_get_scheme                    (const char *uri);
char*               g_uri_escape_string                 (const char *unescaped,
                                                         const char *reserved_chars_allowed,
                                                         gboolean allow_utf8);
GString*            g_string_append_uri_escaped         (GString *string,
                                                         const char *unescaped,
                                                         const char *reserved_chars_allowed,
                                                         gboolean allow_utf8);

Description

Details

G_URI_RESERVED_CHARS_GENERIC_DELIMITERS

#define G_URI_RESERVED_CHARS_GENERIC_DELIMITERS ":/?#[]@"


G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS

#define G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS "!$&'()*+,;="


G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT

#define G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":@"


G_URI_RESERVED_CHARS_ALLOWED_IN_PATH

#define G_URI_RESERVED_CHARS_ALLOWED_IN_PATH G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT "/"


G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO

#define G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":"


g_uri_unescape_string ()

char*               g_uri_unescape_string               (const char *escaped_string,
                                                         const char *illegal_characters);

escaped_string :

illegal_characters :

Returns :

an unescaped version of escaped_string. GIO does not own this string, so remember to g_free() it when finished.

g_uri_unescape_segment ()

char*               g_uri_unescape_segment              (const char *escaped_string,
                                                         const char *escaped_string_end,
                                                         const char *illegal_characters);

escaped_string :

escaped_string_end :

illegal_characters :

Returns :

an unescaped version of escaped_string or NULL on error. The library does not own this string, so remember to g_free() it when you have finished.

g_uri_get_scheme ()

char*               g_uri_get_scheme                    (const char *uri);

uri :

a valid URI.

Returns :

The "Scheme" component of the URI, or NULL on error. RFC 3986 decodes: URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] GIO does not own this string, so remember to g_free() it when finished.

g_uri_escape_string ()

char*               g_uri_escape_string                 (const char *unescaped,
                                                         const char *reserved_chars_allowed,
                                                         gboolean allow_utf8);

unescaped :

the unescaped input string.

reserved_chars_allowed :

allow_utf8 :

set to TRUE if string can include UTF8 characters.

Returns :

an escaped version of unescaped.

g_string_append_uri_escaped ()

GString*            g_string_append_uri_escaped         (GString *string,
                                                         const char *unescaped,
                                                         const char *reserved_chars_allowed,
                                                         gboolean allow_utf8);

string :

a GString to append to.

unescaped :

the input C string of unescaped URI data.

reserved_chars_allowed :

allow_utf8 :

set TRUE if the return value may include UTF8 characters.

Returns :

a GString with the escaped URI appended.