Package ch.bailu.gtk.gst
Klasse Uri
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gst.Uri
- Alle implementierten Schnittstellen:
PointerInterface
A #GstUri object can be used to parse and split a URI string into its
constituent parts. Two #GstUri objects can be joined to make a new #GstUri
using the algorithm described in RFC3986.
constituent parts. Two #GstUri objects can be joined to make a new #GstUri
using the algorithm described in RFC3986.
https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html
-
Feldübersicht
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
appendPath
(Str relative_path) Append a path onto the end of the path in the URI.boolean
appendPath
(String relative_path) Append a path onto the end of the path in the URI.boolean
appendPathSegment
(Str path_segment) Append a single path segment onto the end of the URI path.boolean
appendPathSegment
(String path_segment) Append a single path segment onto the end of the URI path.static Str
Veraltet.boolean
Compares two #GstUri objects to see if they represent the same normalized
URI.static Uri
fromString
(Str uri) Parses a URI string into a new #GstUri object.static Uri
fromStringEscaped
(Str uri) Parses a URI string into a new #GstUri object.fromStringWithBase
(Str uri) Like gst_uri_from_string() but also joins with a base URI.fromStringWithBase
(String uri) Like gst_uri_from_string() but also joins with a base URI.static ClassHandler
Get the fragment name from the URI or %NULL if it doesn't exist.getHost()
Get the host name from the URI or %NULL if it doesn't exist.static int
static Str
getLocation
(Str uri) Extracts the location out of a given valid URI, ie. the protocol and "://"
are stripped from the URI, which means that the location returned includes
the hostname if one is specified.Get the media fragment table from the URI, as defined by "Media Fragments URI 1.0".static long
static TypeSystem.TypeSize
getPath()
Extract the path string from the URI object.Get a list of path segments from the URI.Extract the path string from the URI object as a percent encoded URI path.int
getPort()
Get the port number from the URI or %GST_URI_NO_PORT if it doesn't exist.static Str
getProtocol
(Str uri) Extracts the protocol out of a given valid URI.Get a list of the query keys from the URI.Get a percent encoded URI query string from the @uri.getQueryStringOrdered
(List keys) Get a percent encoded URI query string from the @uri, with query parameters
in the order provided by the @keys list.Get the query table from the URI.getQueryValue
(Str query_key) Get the value associated with the @query_key key.getQueryValue
(String query_key) Get the value associated with the @query_key key.Get the scheme name from the URI or %NULL if it doesn't exist.static long
static TypeSystem.TypeSize
Get the userinfo (usually in the form "username:password") from the URI
or %NULL if it doesn't exist.static boolean
hasProtocol
(Str uri, Str protocol) Checks if the protocol of a given valid URI matches @protocol.boolean
Tests the @uri to see if it is normalized.static boolean
Tests if the given string is a valid URI identifier.boolean
Check if it is safe to write to this #GstUri.Join a reference URI onto a base URI using the method from RFC 3986.static Str
joinStrings
(Str base_uri, Str ref_uri) This is a convenience function to join two URI strings and return the result.Make the #GstUri writable.Like gst_uri_new(), but joins the new URI onto a base URI.newWithBase
(String scheme, String userinfo, String host, int port, String path, String query, String fragment) Like gst_uri_new(), but joins the new URI onto a base URI.boolean
Normalization will remove extra path segments ("." and "..") from the URI.static boolean
protocolIsSupported
(int type, Str protocol) Checks if an element exists that supports the given URI protocol.static boolean
protocolIsValid
(Str protocol) Tests if the given string is a valid protocol identifier.boolean
queryHasKey
(Str query_key) Check if there is a query table entry for the @query_key key.boolean
queryHasKey
(String query_key) Check if there is a query table entry for the @query_key key.boolean
removeQueryKey
(Str query_key) Remove an entry from the query table by key.boolean
removeQueryKey
(String query_key) Remove an entry from the query table by key.boolean
setFragment
(Str fragment) Sets the fragment string in the URI.boolean
setFragment
(String fragment) Sets the fragment string in the URI.boolean
Set or unset the host for the URI.boolean
Set or unset the host for the URI.boolean
Sets or unsets the path in the URI.boolean
Sets or unsets the path in the URI.boolean
setPathSegments
(List path_segments) Replace the path segments list in the URI.boolean
setPathString
(Str path) Sets or unsets the path in the URI.boolean
setPathString
(String path) Sets or unsets the path in the URI.boolean
setPort
(int port) Set or unset the port number for the URI.boolean
setQueryString
(Str query) Sets or unsets the query table in the URI.boolean
setQueryString
(String query) Sets or unsets the query table in the URI.boolean
setQueryTable
(HashTable query_table) Set the query table to use in the URI.boolean
setQueryValue
(Str query_key, Str query_value) This inserts or replaces a key in the query table.boolean
setQueryValue
(String query_key, String query_value) This inserts or replaces a key in the query table.boolean
Set or unset the scheme for the URI.boolean
Set or unset the scheme for the URI.boolean
setUserinfo
(Str userinfo) Set or unset the user information for the URI.boolean
setUserinfo
(String userinfo) Set or unset the user information for the URI.toStr()
Convert the URI to a string.toStringWithKeys
(List keys) Convert the URI to a string, with the query arguments in a specific order.Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
Uri
-
Uri
public Uri(@Nullable Str scheme, @Nullable Str userinfo, @Nullable Str host, int port, @Nullable Str path, @Nullable Str query, @Nullable Str fragment) Creates a new #GstUri object with the given URI parts. The path and query
strings will be broken down into their elements. All strings should not be
escaped except where indicated.- Parameter:
scheme
- The scheme for the new URI.userinfo
- The user-info for the new URI.host
- The host name for the new URI.port
- The port number for the new URI or %GST_URI_NO_PORT.path
- The path for the new URI with '/' separating path elements.query
- The query string for the new URI with '&' separating query elements. Elements containing '&' characters should encode them as "%26".fragment
- The fragment name for the new URI.
-
Uri
public Uri(String scheme, String userinfo, String host, int port, String path, String query, String fragment) Creates a new #GstUri object with the given URI parts. The path and query
strings will be broken down into their elements. All strings should not be
escaped except where indicated.- Parameter:
scheme
- The scheme for the new URI.userinfo
- The user-info for the new URI.host
- The host name for the new URI.port
- The port number for the new URI or %GST_URI_NO_PORT.path
- The path for the new URI with '/' separating path elements.query
- The query string for the new URI with '&' separating query elements. Elements containing '&' characters should encode them as "%26".fragment
- The fragment name for the new URI.
-
-
Methodendetails
-
getClassHandler
-
appendPath
Append a path onto the end of the path in the URI. The path is not
normalized, call #gst_uri_normalize() to normalize the path.- Parameter:
relative_path
- Relative path to append to the end of the current path.- Gibt zurück:
- %TRUE if the path was appended successfully.
-
appendPath
Append a path onto the end of the path in the URI. The path is not
normalized, call #gst_uri_normalize() to normalize the path.- Parameter:
relative_path
- Relative path to append to the end of the current path.- Gibt zurück:
- %TRUE if the path was appended successfully.
-
appendPathSegment
Append a single path segment onto the end of the URI path.- Parameter:
path_segment
- The path segment string to append to the URI path.- Gibt zurück:
- %TRUE if the path was appended successfully.
-
appendPathSegment
Append a single path segment onto the end of the URI path.- Parameter:
path_segment
- The path segment string to append to the URI path.- Gibt zurück:
- %TRUE if the path was appended successfully.
-
equal
Compares two #GstUri objects to see if they represent the same normalized
URI.- Parameter:
second
- Second #GstUri to compare.- Gibt zurück:
- %TRUE if the normalized versions of the two URI's would be equal.
-
fromStringWithBase
Like gst_uri_from_string() but also joins with a base URI.- Parameter:
uri
- The URI string to parse.- Gibt zurück:
- A new #GstUri object.
-
fromStringWithBase
Like gst_uri_from_string() but also joins with a base URI.- Parameter:
uri
- The URI string to parse.- Gibt zurück:
- A new #GstUri object.
-
getFragment
Get the fragment name from the URI or %NULL if it doesn't exist.
If @uri is %NULL then returns %NULL.- Gibt zurück:
- The host name from the #GstUri object or %NULL.
-
getHost
Get the host name from the URI or %NULL if it doesn't exist.
If @uri is %NULL then returns %NULL.- Gibt zurück:
- The host name from the #GstUri object or %NULL.
-
getMediaFragmentTable
Get the media fragment table from the URI, as defined by "Media Fragments URI 1.0".
Hash table returned by this API is a list of "key-value" pairs, and the each
pair is generated by splitting "URI fragment" per "&" sub-delims, then "key"
and "value" are split by "=" sub-delims. The "key" returned by this API may
be undefined keyword by standard.
A value may be %NULL to indicate that the key should appear in the fragment
string in the URI, but does not have a value. Free the returned #GHashTable
with #g_hash_table_unref() when it is no longer required.
Modifying this hash table does not affect the fragment in the URI.
See more about Media Fragments URI 1.0 (W3C) at https://www.w3.org/TR/media-frags/- Gibt zurück:
- The fragment hash table from the URI.
-
getPath
Extract the path string from the URI object.- Gibt zurück:
- The path from the URI. Once finished with the string should be g_free()'d.
-
getPathSegments
Get a list of path segments from the URI.- Gibt zurück:
- A #GList of path segment strings or %NULL if no path segments are available. Free the list when no longer needed with g_list_free_full(list, g_free).
-
getPathString
Extract the path string from the URI object as a percent encoded URI path.- Gibt zurück:
- The path from the URI. Once finished with the string should be g_free()'d.
-
getPort
public int getPort()Get the port number from the URI or %GST_URI_NO_PORT if it doesn't exist.
If @uri is %NULL then returns %GST_URI_NO_PORT.- Gibt zurück:
- The port number from the #GstUri object or %GST_URI_NO_PORT.
-
getQueryKeys
Get a list of the query keys from the URI.- Gibt zurück:
- A list of keys from the URI query. Free the list with g_list_free().
-
getQueryString
Get a percent encoded URI query string from the @uri.- Gibt zurück:
- A percent encoded query string. Use g_free() when no longer needed.
-
getQueryStringOrdered
Get a percent encoded URI query string from the @uri, with query parameters
in the order provided by the @keys list. Only parameter keys in the list will
be added to the resulting URI string. This method can be used by retrieving
the keys with gst_uri_get_query_keys() and then sorting the list, for
example.- Parameter:
keys
- A GList containing the query argument key strings.- Gibt zurück:
- A percent encoded query string. Use g_free() when no longer needed.
-
getQueryTable
Get the query table from the URI. Keys and values in the table are freed
with g_free when they are deleted. A value may be %NULL to indicate that
the key should appear in the query string in the URI, but does not have a
value. Free the returned #GHashTable with #g_hash_table_unref() when it is
no longer required. Modifying this hash table will modify the query in the
URI.- Gibt zurück:
- The query hash table from the URI.
-
getQueryValue
Get the value associated with the @query_key key. Will return %NULL if the
key has no value or if the key does not exist in the URI query table. Because
%NULL is returned for both missing keys and keys with no value, you should
use gst_uri_query_has_key() to determine if a key is present in the URI
query.- Parameter:
query_key
- The key to lookup.- Gibt zurück:
- The value for the given key, or %NULL if not found.
-
getQueryValue
Get the value associated with the @query_key key. Will return %NULL if the
key has no value or if the key does not exist in the URI query table. Because
%NULL is returned for both missing keys and keys with no value, you should
use gst_uri_query_has_key() to determine if a key is present in the URI
query.- Parameter:
query_key
- The key to lookup.- Gibt zurück:
- The value for the given key, or %NULL if not found.
-
getScheme
Get the scheme name from the URI or %NULL if it doesn't exist.
If @uri is %NULL then returns %NULL.- Gibt zurück:
- The scheme from the #GstUri object or %NULL.
-
getUserinfo
Get the userinfo (usually in the form "username:password") from the URI
or %NULL if it doesn't exist. If @uri is %NULL then returns %NULL.- Gibt zurück:
- The userinfo from the #GstUri object or %NULL.
-
isNormalized
public boolean isNormalized()Tests the @uri to see if it is normalized. A %NULL @uri is considered to be
normalized.- Gibt zurück:
- TRUE if the URI is normalized or is %NULL.
-
isWritable
public boolean isWritable()Check if it is safe to write to this #GstUri.
Check if the refcount of @uri is exactly 1, meaning that no other
reference exists to the #GstUri and that the #GstUri is therefore writable.
Modification of a #GstUri should only be done after verifying that it is
writable.- Gibt zurück:
- %TRUE if it is safe to write to the object.
-
join
Join a reference URI onto a base URI using the method from RFC 3986.
If either URI is %NULL then the other URI will be returned with the ref count
increased.- Parameter:
ref_uri
- The reference URI to join onto the base URI.- Gibt zurück:
- A #GstUri which represents the base with the reference URI joined on.
-
makeWritable
Make the #GstUri writable.
Checks if @uri is writable, and if so the original object is returned. If
not, then a writable copy is made and returned. This gives away the
reference to @uri and returns a reference to the new #GstUri.
If @uri is %NULL then %NULL is returned.- Gibt zurück:
- A writable version of @uri.
-
newWithBase
public Uri newWithBase(@Nullable Str scheme, @Nullable Str userinfo, @Nullable Str host, int port, @Nullable Str path, @Nullable Str query, @Nullable Str fragment) Like gst_uri_new(), but joins the new URI onto a base URI.- Parameter:
scheme
- The scheme for the new URI.userinfo
- The user-info for the new URI.host
- The host name for the new URI.port
- The port number for the new URI or %GST_URI_NO_PORT.path
- The path for the new URI with '/' separating path elements.query
- The query string for the new URI with '&' separating query elements. Elements containing '&' characters should encode them as "%26".fragment
- The fragment name for the new URI.- Gibt zurück:
- The new URI joined onto @base.
-
newWithBase
public Uri newWithBase(String scheme, String userinfo, String host, int port, String path, String query, String fragment) Like gst_uri_new(), but joins the new URI onto a base URI.- Parameter:
scheme
- The scheme for the new URI.userinfo
- The user-info for the new URI.host
- The host name for the new URI.port
- The port number for the new URI or %GST_URI_NO_PORT.path
- The path for the new URI with '/' separating path elements.query
- The query string for the new URI with '&' separating query elements. Elements containing '&' characters should encode them as "%26".fragment
- The fragment name for the new URI.- Gibt zurück:
- The new URI joined onto @base.
-
normalize
public boolean normalize()Normalization will remove extra path segments ("." and "..") from the URI. It
will also convert the scheme and host name to lower case and any
percent-encoded values to uppercase.
The #GstUri object must be writable. Check with gst_uri_is_writable() or use
gst_uri_make_writable() first.- Gibt zurück:
- TRUE if the URI was modified.
-
queryHasKey
Check if there is a query table entry for the @query_key key.- Parameter:
query_key
- The key to lookup.- Gibt zurück:
- %TRUE if @query_key exists in the URI query table.
-
queryHasKey
Check if there is a query table entry for the @query_key key.- Parameter:
query_key
- The key to lookup.- Gibt zurück:
- %TRUE if @query_key exists in the URI query table.
-
removeQueryKey
Remove an entry from the query table by key.- Parameter:
query_key
- The key to remove.- Gibt zurück:
- %TRUE if the key existed in the table and was removed.
-
removeQueryKey
Remove an entry from the query table by key.- Parameter:
query_key
- The key to remove.- Gibt zurück:
- %TRUE if the key existed in the table and was removed.
-
setFragment
Sets the fragment string in the URI. Use a value of %NULL in @fragment to
unset the fragment string.- Parameter:
fragment
- The fragment string to set.- Gibt zurück:
- %TRUE if the fragment was set/unset successfully.
-
setFragment
Sets the fragment string in the URI. Use a value of %NULL in @fragment to
unset the fragment string.- Parameter:
fragment
- The fragment string to set.- Gibt zurück:
- %TRUE if the fragment was set/unset successfully.
-
setHost
Set or unset the host for the URI.- Parameter:
host
- The new host string to set or %NULL to unset.- Gibt zurück:
- %TRUE if the host was set/unset successfully.
-
setHost
Set or unset the host for the URI.- Parameter:
host
- The new host string to set or %NULL to unset.- Gibt zurück:
- %TRUE if the host was set/unset successfully.
-
setPath
Sets or unsets the path in the URI.- Parameter:
path
- The new path to set with path segments separated by '/', or use %NULL to unset the path.- Gibt zurück:
- %TRUE if the path was set successfully.
-
setPath
Sets or unsets the path in the URI.- Parameter:
path
- The new path to set with path segments separated by '/', or use %NULL to unset the path.- Gibt zurück:
- %TRUE if the path was set successfully.
-
setPathSegments
Replace the path segments list in the URI.- Parameter:
path_segments
- The new path list to set.- Gibt zurück:
- %TRUE if the path segments were set successfully.
-
setPathString
Sets or unsets the path in the URI.- Parameter:
path
- The new percent encoded path to set with path segments separated by '/', or use %NULL to unset the path.- Gibt zurück:
- %TRUE if the path was set successfully.
-
setPathString
Sets or unsets the path in the URI.- Parameter:
path
- The new percent encoded path to set with path segments separated by '/', or use %NULL to unset the path.- Gibt zurück:
- %TRUE if the path was set successfully.
-
setPort
public boolean setPort(int port) Set or unset the port number for the URI.- Parameter:
port
- The new port number to set or %GST_URI_NO_PORT to unset.- Gibt zurück:
- %TRUE if the port number was set/unset successfully.
-
setQueryString
Sets or unsets the query table in the URI.- Parameter:
query
- The new percent encoded query string to use to populate the query table, or use %NULL to unset the query table.- Gibt zurück:
- %TRUE if the query table was set successfully.
-
setQueryString
Sets or unsets the query table in the URI.- Parameter:
query
- The new percent encoded query string to use to populate the query table, or use %NULL to unset the query table.- Gibt zurück:
- %TRUE if the query table was set successfully.
-
setQueryTable
Set the query table to use in the URI. The old table is unreferenced and a
reference to the new one is used instead. A value if %NULL for @query_table
will remove the query string from the URI.- Parameter:
query_table
- The new query table to use.- Gibt zurück:
- %TRUE if the new table was successfully used for the query table.
-
setQueryValue
This inserts or replaces a key in the query table. A @query_value of %NULL
indicates that the key has no associated value, but will still be present in
the query string.- Parameter:
query_key
- The key for the query entry.query_value
- The value for the key.- Gibt zurück:
- %TRUE if the query table was successfully updated.
-
setQueryValue
This inserts or replaces a key in the query table. A @query_value of %NULL
indicates that the key has no associated value, but will still be present in
the query string.- Parameter:
query_key
- The key for the query entry.query_value
- The value for the key.- Gibt zurück:
- %TRUE if the query table was successfully updated.
-
setScheme
Set or unset the scheme for the URI.- Parameter:
scheme
- The new scheme to set or %NULL to unset the scheme.- Gibt zurück:
- %TRUE if the scheme was set/unset successfully.
-
setScheme
Set or unset the scheme for the URI.- Parameter:
scheme
- The new scheme to set or %NULL to unset the scheme.- Gibt zurück:
- %TRUE if the scheme was set/unset successfully.
-
setUserinfo
Set or unset the user information for the URI.- Parameter:
userinfo
- The new user-information string to set or %NULL to unset.- Gibt zurück:
- %TRUE if the user information was set/unset successfully.
-
setUserinfo
Set or unset the user information for the URI.- Parameter:
userinfo
- The new user-information string to set or %NULL to unset.- Gibt zurück:
- %TRUE if the user information was set/unset successfully.
-
toStr
Convert the URI to a string.
Returns the URI as held in this object as a #gchar* nul-terminated string.
The caller should g_free() the string once they are finished with it.
The string is put together as described in RFC 3986.- Gibt zurück:
- The string version of the URI.
-
toStringWithKeys
Convert the URI to a string, with the query arguments in a specific order.
Only the keys in the @keys list will be added to the resulting string.
Returns the URI as held in this object as a #gchar* nul-terminated string.
The caller should g_free() the string once they are finished with it.
The string is put together as described in RFC 3986.- Parameter:
keys
- A GList containing the query argument key strings.- Gibt zurück:
- The string version of the URI.
-
construct
Veraltet.Constructs a URI for a given valid protocol and location.
Free-function: g_free- Parameter:
protocol
- Protocol for URIlocation
- Location for URI- Gibt zurück:
- a new string for this URI.
-
fromString
Parses a URI string into a new #GstUri object. Will return NULL if the URI
cannot be parsed.- Parameter:
uri
- The URI string to parse.- Gibt zurück:
- A new #GstUri object, or NULL.
-
fromStringEscaped
Parses a URI string into a new #GstUri object. Will return NULL if the URI
cannot be parsed. This is identical to gst_uri_from_string() except that
the userinfo and fragment components of the URI will not be unescaped while
parsing.
Use this when you need to extract a username and password from the userinfo
such as https://user:password@example.com since either may contain
a URI-escaped ':' character. gst_uri_from_string() will unescape the entire
userinfo component, which will make it impossible to know which ':'
delineates the username and password.
The same applies to the fragment component of the URI, such as
https://example.com/path#fragment which may contain a URI-escaped '#'.- Parameter:
uri
- The URI string to parse.- Gibt zurück:
- A new #GstUri object, or NULL.
-
getLocation
Extracts the location out of a given valid URI, ie. the protocol and "://"
are stripped from the URI, which means that the location returned includes
the hostname if one is specified. The returned string must be freed using
g_free().
Free-function: g_free- Parameter:
uri
- A URI string- Gibt zurück:
- the location for this URI. Returns %NULL if the URI isn't valid. If the URI does not contain a location, an empty string is returned.
-
getProtocol
Extracts the protocol out of a given valid URI. The returned string must be
freed using g_free().- Parameter:
uri
- A URI string- Gibt zurück:
- The protocol for this URI.
-
hasProtocol
Checks if the protocol of a given valid URI matches @protocol.- Parameter:
uri
- a URI stringprotocol
- a protocol string (e.g. "http")- Gibt zurück:
- %TRUE if the protocol matches.
-
isValid
Tests if the given string is a valid URI identifier. URIs start with a valid
scheme followed by ":" and maybe a string identifying the location.- Parameter:
uri
- A URI string- Gibt zurück:
- %TRUE if the string is a valid URI
-
joinStrings
This is a convenience function to join two URI strings and return the result.
The returned string should be g_free()'d after use.- Parameter:
base_uri
- The percent-encoded base URI.ref_uri
- The percent-encoded reference URI to join to the @base_uri.- Gibt zurück:
- A string representing the percent-encoded join of the two URIs.
-
protocolIsSupported
Checks if an element exists that supports the given URI protocol. Note
that a positive return value does not imply that a subsequent call to
gst_element_make_from_uri() is guaranteed to work.- Parameter:
type
- Whether to check for a source or a sinkprotocol
- Protocol that should be checked for (e.g. "http" or "smb")- Gibt zurück:
- %TRUE
-
protocolIsValid
Tests if the given string is a valid protocol identifier. Protocols
must consist of alphanumeric characters, '+', '-' and '.' and must
start with a alphabetic character. See RFC 3986 Section 3.1.- Parameter:
protocol
- A string- Gibt zurück:
- %TRUE if the string is a valid protocol identifier, %FALSE otherwise.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-