A Uri object can be used to parse and split a URI string into its constituent parts.
Two Uri objects can be joined to make a new Uri using the algorithm described in
RFC3986.
- public unowned Uri @ref ()
Add a reference to this Uri object.
- public bool append_path (string relative_path)
Append a path onto the end of the path in the URI.
- public bool append_path_segment (string path_segment)
Append a single path segment onto the end of the URI path.
- public Uri copy ()
Create a new Uri object with the same data
as this Uri object.
- public bool equal (Uri second)
Compares two Uri objects to see if they
represent the same normalized URI.
- public Uri from_string_with_base (string uri)
- public unowned string? get_fragment ()
Get the fragment name from the URI or null
if it doesn't
exist.
- public unowned string? get_host ()
Get the host name from the URI or null
if it doesn't
exist.
- public HashTable<string,string>? get_media_fragment_table ()
Get the media fragment table from the URI, as defined by "Media
Fragments URI 1.0".
- public string? get_path ()
Extract the path string from the URI object.
- public List<string> get_path_segments ()
Get a list of path segments from the URI.
- public string? get_path_string ()
Extract the path string from the URI object as a percent encoded URI
path.
- public uint get_port ()
Get the port number from the URI or
URI_NO_PORT if it doesn't exist.
- public List<unowned string> get_query_keys ()
Get a list of the query keys from the URI.
- public string? get_query_string ()
Get a percent encoded URI query string from the
this.
- public HashTable<string,string>? get_query_table ()
Get the query table from the URI.
- public unowned string? get_query_value (string query_key)
Get the value associated with the query_key
key.
- public unowned string? get_scheme ()
Get the scheme name from the URI or null
if it doesn't
exist.
- public unowned string? get_userinfo ()
Get the userinfo (usually in the form "username:password") from the
URI or null
if it doesn't exist.
- public bool is_normalized ()
Tests the this to see if it is
normalized.
- public bool is_writable ()
Check if it is safe to write to this Uri.
- public Uri? join (Uri? ref_uri)
Join a reference URI onto a base URI using the method from RFC 3986.
- public Uri make_writable ()
Make the Uri writable.
- public Uri new_with_base (string? scheme, string? userinfo, string? host, uint port, string? path, string? query, string? fragment)
Like Uri, but
joins the new URI onto a base URI.
- public bool normalize ()
Normalization will remove extra path segments (".
- public bool query_has_key (string query_key)
Check if there is a query table entry for the query_key
key.
- public bool remove_query_key (string query_key)
Remove an entry from the query table by key.
- public bool set_fragment (string? fragment)
Sets the fragment string in the URI.
- public bool set_host (string host)
Set or unset the host for the URI.
- public bool set_path (string path)
Sets or unsets the path in the URI.
- public bool set_path_segments (owned List<string>? path_segments)
Replace the path segments list in the URI.
- public bool set_path_string (string path)
Sets or unsets the path in the URI.
- public bool set_port (uint port)
Set or unset the port number for the URI.
- public bool set_query_string (string query)
Sets or unsets the query table in the URI.
- public bool set_query_table (HashTable<string,string>? query_table)
Set the query table to use in the URI.
- public bool set_query_value (string query_key, string? query_value)
This inserts or replaces a key in the query table.
- public bool set_scheme (string scheme)
Set or unset the scheme for the URI.
- public bool set_userinfo (string userinfo)
Set or unset the user information for the URI.
- public string to_string ()
Convert the URI to a string.
- public void unref ()
Decrement the reference count to this Uri
object.