list_extract_uris


Description:

[ Version ( since = "2.6" ) ]
[ CCode ( array_length = false , array_null_terminated = true ) ]
public static string[] list_extract_uris (string uri_list)

Splits an URI list conforming to the text/uri-list mime type defined in RFC 2483 into individual URIs, discarding any comments.

The URIs are not validated.

Example: Split an URI list:

public static int main (string[] args) {
string uri_list = """# comment
http://example.org/absolute/URI/absolute/path/to/resource1.txt
http://example.org/absolute/URI/absolute/path/to/resource2.txt

http://example.org/absolute/URI/absolute/path/to/resource3.txt
"""
;


// Output:
// ``Uri: http://example.org/absolute/URI/absolute/path/to/resource1.txt``
// ``Uri: http://example.org/absolute/URI/absolute/path/to/resource2.txt``
// ``Uri: http://example.org/absolute/URI/absolute/path/to/resource3.txt``
string[] uris = Uri.list_extract_uris (uri_list);
foreach (string uri in uris) {
print ("Uri: %s\n", uri);
}

return 0;
}

valac --pkg glib-2.0 GLib.Uri.list_extract_uris.vala

Parameters:

uri_list

an URI list

Returns:

a newly allocated null-terminated list of strings holding the individual URIs. The array should be freed with strfreev.