feat: get host, and update url
This commit is contained in:
parent
956f51d38a
commit
c6081720e7
|
@ -113,6 +113,10 @@ DOS_API char * DOS_CALL dos_image_resizer(char* imagePath, int maxSize, char* tm
|
|||
|
||||
DOS_API char * DOS_CALL dos_qurl_fromUserInput(char* input);
|
||||
|
||||
DOS_API char * DOS_CALL dos_qurl_host(char* host);
|
||||
|
||||
DOS_API char * DOS_CALL dos_qurl_replaceHostAndAddPath(char* url, char* newScheme, char* newHost, char* pathPrefix);
|
||||
|
||||
/// \brief Sets the application icon
|
||||
DOS_API void DOS_CALL dos_qapplication_icon(const char *filename);
|
||||
|
||||
|
|
|
@ -1153,3 +1153,17 @@ char *dos_qurl_fromUserInput(char* input)
|
|||
{
|
||||
return convert_to_cstring(QUrl::fromUserInput(QString(input)).toString());
|
||||
}
|
||||
|
||||
char *dos_qurl_host(char* url)
|
||||
{
|
||||
return convert_to_cstring(QUrl(QString(url)).host());
|
||||
}
|
||||
|
||||
char *dos_qurl_replaceHostAndAddPath(char* url, char* newScheme, char* newHost, char* pathPrefix)
|
||||
{
|
||||
auto newQurl = QUrl(QString(url));
|
||||
newQurl.setScheme(newScheme);
|
||||
newQurl.setHost(newHost);
|
||||
newQurl.setPath(QString(pathPrefix) + newQurl.path());
|
||||
return convert_to_cstring(newQurl.toString());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue