Function

GLibUriis_valid

Declaration

gboolean
g_uri_is_valid (
  const gchar* uri_string,
  GUriFlags flags,
  GError** error
)

Description

Parses uri_string according to flags, to determine whether it is a valid [absolute URI][relative-absolute-uris], i.e. it does not need to be resolved relative to another URI using g_uri_parse_relative().

If it’s not a valid URI, an error is returned explaining how it’s invalid.

See g_uri_split(), and the definition of GUriFlags, for more information on the effect of flags.

Available since:2.66

Parameters

uri_string

Type: const gchar*

A string containing an absolute URI.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
flags

Type: GUriFlags

Flags for parsing uri_string.

error

Type: GError **

The return location for an error.

The argument can be NULL.
The argument will be set to NULL by the function if there are no errors.
In case of error, the argument will be set and the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

TRUE if uri_string is a valid absolute URI, FALSE on error.