ScummVM API documentation
Networking::CurlURL Class Reference

Public Member Functions

bool parseURL (const Common::String &url)
 
Common::String getScheme ()
 
Common::String getHost ()
 
int getPort (bool returnDefault=false)
 

Member Function Documentation

◆ parseURL()

bool Networking::CurlURL::parseURL ( const Common::String url)

Parses an URL string by calling curl_url_set Must be used before using other methods.

Parameters
urlis a string containing the URL. e.g. "https://scummvm.org".
Return values
trueif successful.
falseon failure or if using an older version of libcurl.

◆ getScheme()

Common::String Networking::CurlURL::getScheme ( )

Extracts the scheme of an URL parsed previously by parseURL.

Return values
Stringof the URL's scheme. e.g. "https".
Emptystring on failure.

◆ getHost()

Common::String Networking::CurlURL::getHost ( )

Extracts the host name of an URL parsed previously by parseURL.

Return values
Stringof the URL's host name. e.g. "scummvm.org".
Emptystring on failure.

◆ getPort()

int Networking::CurlURL::getPort ( bool  returnDefault = false)

Extracts the port of an URL parsed previously by parseURL.

Parameters
returnDefaulttells libcurl to return the default port according to the URL's scheme if not explicitly defined
Return values
TheURL's port number if one exists.
0if no port found.
defaultport if returnDefault is true.
-1on failure.

The documentation for this class was generated from the following file: