![]() |
libgpac
Documentation of the core library of GPAC
|
URL manipulation tools. More...
Functions | |
Bool | gf_url_is_local (const char *url) |
URL local test. More... | |
char * | gf_url_get_absolute_path (const char *pathName, const char *parentPath) |
gets absolute file path More... | |
char * | gf_url_concatenate (const char *parentName, const char *pathName) |
URL concatenation. More... | |
char * | gf_url_concatenate_parent (const char *parentName, const char *pathName) |
URL concatenation. More... | |
char * | gf_url_percent_encode (const char *path) |
URL encoding. More... | |
char * | gf_url_percent_decode (const char *path) |
URL decoding. More... | |
void | gf_url_to_fs_path (char *url) |
URL to file system. More... | |
Bool | gf_url_is_relative (const char *url) |
check relative URL More... | |
char * | gf_url_colon_suffix (const char *URL, char assign_sep) |
get first after a filename/path More... | |
const char * | gf_url_get_resource_name (const char *url) |
Extract resource name from URL. More... | |
const char * | gf_url_get_path (const char *url) |
Gets resource path from URL. More... | |
URL manipulation tools.
Bool gf_url_is_local | ( | const char * | url | ) |
URL local test.
Tests whether a URL describes a local file or not
url | the url to analyze |
char* gf_url_get_absolute_path | ( | const char * | pathName, |
const char * | parentPath | ||
) |
gets absolute file path
Gets the absolute file path from a relative path and its parent absolute one. This can only be used with file paths.
pathName | the relative path name of a file |
parentPath | the absolute parent path name |
char* gf_url_concatenate | ( | const char * | parentName, |
const char * | pathName | ||
) |
URL concatenation.
Concatenates a relative URL with its parent URL
parentName | URL of the parent service |
pathName | URL of the service |
char* gf_url_concatenate_parent | ( | const char * | parentName, |
const char * | pathName | ||
) |
URL concatenation.
Same as gf_url_concatenate but if both paths are relative, resolved url is relative to parent path.
parentName | URL of the parent service |
pathName | URL of the service |
char* gf_url_percent_encode | ( | const char * | path | ) |
URL encoding.
Encodes URL by replacing special characters with their % encodings.
path | URL of the service |
char* gf_url_percent_decode | ( | const char * | path | ) |
URL decoding.
Decodes URL by % encodings with the special characters they correspond to
path | encoded URL of the service |
void gf_url_to_fs_path | ( | char * | url | ) |
URL to file system.
Converts a local URL to a file system value. Removes all white spaces and similar
url | url to convert |
Bool gf_url_is_relative | ( | const char * | url | ) |
check relative URL
Checks if given URL is absolute or relative
url | url to check |
char* gf_url_colon_suffix | ( | const char * | URL, |
char | assign_sep | ||
) |
get first after a filename/path
Returns a pointer to the first colon at the end of a filename or URL, if any.
If assign_sep is specified, for example '=', the function will make sure that the colon is after the file extension if found and that '=' is not present between colon and file ext. This is used to parse 'a:b.mp4:c' (expected result ':c...' and not ':b...') vs 'a:b=c.mp4' ' (expected result ':b')
URL | path or URL to inspect |
assign_sep | value of assignment operand character. If 0, only checks for colon, otherwise chec that no assign sep or colon is present before file extension, if present |
const char* gf_url_get_resource_name | ( | const char * | url | ) |
Extract resource name from URL.
Extracts the resource name from the URL
url | input url |
const char* gf_url_get_path | ( | const char * | url | ) |
Gets resource path from URL.
Gets the resource path and name from the URL, stripping scheme, server ID, port...
url | input url |