Added method g_network_address_parse_uri()

This method allow creating a network address from a URI. If no port is
found in the URI, the default_port parameter will be used. Note that new
property scheme is there for future TLS implementation.

Reviewed-by: Dan Winship <danw@gnome.org>
This commit is contained in:
Nicolas Dufresne
2010-08-10 15:23:37 -04:00
parent 466111c960
commit 63105d1074
4 changed files with 304 additions and 0 deletions

View File

@@ -60,8 +60,12 @@ GSocketConnectable *g_network_address_new (const gchar *hostname,
GSocketConnectable *g_network_address_parse (const gchar *host_and_port,
guint16 default_port,
GError **error);
GSocketConnectable *g_network_address_parse_uri (const gchar *uri,
guint16 default_port,
GError **error);
const gchar *g_network_address_get_hostname (GNetworkAddress *addr);
guint16 g_network_address_get_port (GNetworkAddress *addr);
const gchar *g_network_address_get_scheme (GNetworkAddress *addr);
G_END_DECLS