From d84e3fd773e48f13dcfd594b5365fc93dbca93c9 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 11 Oct 2012 19:23:22 +0100 Subject: Add nsurl_replace_query. Add tests. Make tester itterate remaining lwc_strings. --- utils/nsurl.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'utils/nsurl.h') diff --git a/utils/nsurl.h b/utils/nsurl.h index 3b140e7ac..068d08b8d 100644 --- a/utils/nsurl.h +++ b/utils/nsurl.h @@ -242,6 +242,25 @@ nserror nsurl_defragment(const nsurl *url, nsurl **no_frag); nserror nsurl_refragment(const nsurl *url, lwc_string *frag, nsurl **new_url); +/** + * Create a NetSurf URL object, with query string replaced + * + * \param url NetSurf URL to create new NetSurf URL from + * \param query Query string to use + * \param new_url Returns new NetSurf URL with query string provided + * \return NSERROR_OK on success, appropriate error otherwise + * + * If return value != NSERROR_OK, nothing will be returned in new_url. + * + * It is up to the client to call nsurl_destroy when they are finished with + * the created object. + * + * Any query component in url is replaced with query in new_url. + */ +nserror nsurl_replace_query(const nsurl *url, const char *query, + nsurl **new_url); + + /** * Create a NetSurf URL object for URL with parent location of an existing URL. * -- cgit v1.2.3