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

◆ is_well_formed_uri_string()

static bool xtd::uri::is_well_formed_uri_string ( const xtd::string uri_string,
xtd::uri_kind  uri_kind 
)
static

Indicates whether the string is well-formed by attempting to construct a URI with the string and ensures that the string does not require further escaping.

Parameters
uri_stringThe string used to attempt to construct a xtd::uri.
uri_kindThe type of the xtd::uri in uri_string.
Returns
bool A bool value that is true if the string was well-formed; else false.
Remarks
By default, the string is considered well-formed in accordance with RFC 2396 and RFC 2732. If International Resource Identifiers (IRIs) or Internationalized Domain Name (IDN) parsing is enabled, the string is considered well-formed in accordance with RFC 3986 and RFC 3987.
The string is considered poorly formed, causing the method to return false, if any of the following conditions occur
Error Example
The string is not correctly escaped. http://www.contoso.com/path???/file name
The string is an absolute xtd::uri that represents an implicit file xtd::uri. c:\directory\filename
The string is an absolute URI that is missing a slash before the path. file://c:/directory/filename
The string contains unescaped backslashes even if they are treated as forward slashes. http:\host/path/file
The string represents a hierarchical absolute xtd::uri and does not contain "://". www.contoso.com/path/file
The parser for the xtd::uri.scheme indicates that the original string was not well-formed. The example depends on the scheme of the URI.
For more information on URI support, see the Remarks section for the xtd::uri class.