xtd 0.2.0
Loading...
Searching...
No Matches

◆ get_components()

xtd::string xtd::uri::get_components ( xtd::uri_components  components,
xtd::uri_format  format 
) const

Gets the specified components of the current instance using the specified escaping for special characters.

Parameters
componentsA bitwise combination of the xtd::uri_components values that specifies which parts of the current instance to return to the caller.
formatOne of the xtd::uri_format values that controls how special characters are escaped.
Returns
string A string that contains the components.
Exceptions
xtd::invalid_operation_exceptionThis instance represents a relative URI, and this property is valid only for absolute URIs.
Remarks
When query or fragment is specified alone, the return value includes the delimiter. The scheme, user_info, host, port, and Path components do not include the delimiter. For all other xtd::uri_components values, and combinations of values, the delimiters are included in the returned value.
The components are returned in the order that they appear in the URI. For example, if scheme is specified, it appears first.
When International Resource Identifier (URI) and Internationalized Domain Name (IDN) support are enabled, the number of characters returned in the string increases. Punycode names used to support URI contain only ASCII characters and always start with the xn– prefix. When URI and IDN are enabled, Unicode surrogate characters are handled correctly by the get_components method.
For more information on URI support, see the Remarks section for the xtd::uri class.