CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
System::Uri Class Reference

Unified resource identifier. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...

#include <uri.h>

Inherits System::Object.

Public Member Functions

String get_AbsolutePath () const
 Returns the absolute path of the URI. More...
 
String get_AbsoluteUri () const
 Returns the absolute URI. More...
 
String get_LocalPath () const
 Returns the operating system representation of the file name referenced by the URI represented by the current object. More...
 
String get_Authority () const
 Returns the host name and the port number for a server. More...
 
UriHostNameType get_HostNameType () const
 Returns the host name type. More...
 
bool get_IsDefaultPort () const
 Determines if the URI represented by the current object has default port for the URI's scheme. More...
 
bool get_IsFile () const
 Determines if the URI represented by the current object is a file. More...
 
bool get_IsLoopback () const
 Determines if the URI represented by the current object references a local host. More...
 
String get_PathAndQuery () const
 Returns the absolute path and query components of the URI represented by the current object separated by a question mark (?). More...
 
ArrayPtr< Stringget_Segments () const
 Returns an array of strings containing the path segments of the URI represented by the current object. More...
 
bool get_IsUnc () const
 Determines if the URI represented by the current object is a UNC path. More...
 
String get_Host () const
 Returns the host name. More...
 
int32_t get_Port () const
 Returns the port number of the URI represented by the current object. More...
 
String get_Query () const
 Returns the query information included in the URI represented by the current object. More...
 
String get_Fragment () const
 Returns the escaped URI fragment. More...
 
String get_Scheme () const
 Returns the scheme of the URI represented by the current object. More...
 
String get_OriginalString () const
 Returns the URI string that was passed to the constructor when current object was constructed. More...
 
String get_DnsSafeHost () const
 Returns an unescaped host name. More...
 
String get_IdnHost () const
 Returns an International Domain Name of the host. More...
 
bool get_IsAbsoluteUri () const
 Determines if the URI represented by the current object is absolute. More...
 
bool get_UserEscaped () const
 Determines if the URI string passed to the constructor of the current object was fully escaped. More...
 
String get_UserInfo () const
 Returns a uer name, password and other user information associated with the URI represented by the current object. More...
 
 Uri (const String &uriString)
 Constructs a Uri object that represents the specified URI. More...
 
 Uri (const String &uriString, bool dontEscape)
 Constructs a Uri object that represents the specified URI; an argument specifies if the URI should be escaped. More...
 
 Uri (const SharedPtr< Uri > &baseUri, const String &relativeUri, bool dontEscape)
 Constructs an Uri abject from the specified Uri object representing the base URI and the string representation of relative URI; an argument specifies if the URI should be escaped. More...
 
 Uri (const String &uriString, UriKind uriKind)
 Constructs a Uri object that represents the specified URI; an argument specifies the URI kind. More...
 
 Uri (const SharedPtr< Uri > &baseUri, const String &relativeUri)
 Constructs an Uri abject from the specified base and relative URIs. More...
 
 Uri (const SharedPtr< Uri > &baseUri, const SharedPtr< Uri > &relativeUri)
 Constructs an Uri abject from the specified base and relative URIs. More...
 
String GetLeftPart (UriPartial part)
 Returns the specified portion of the URI represented by the current object. More...
 
virtual int32_t GetHashCode () const override
 Gets the hash code for the URI. More...
 
virtual String ToString () const override
 Returns the string representation of the URI represented by the current object. More...
 
virtual bool Equals (SharedPtr< Object > comparand) override
 Determines if the URIs represented by the current and specified objects are equal. More...
 
SharedPtr< UriMakeRelativeUri (const SharedPtr< Uri > &uri)
 Determines the difference between URIs represented by the current and the specified Uri objects. More...
 
String MakeRelative (const SharedPtr< Uri > &toUri)
 Determines the difference between two Uri instances. More...
 
String GetComponents (UriComponents components, UriFormat format) const
 Returns the specified components of the URI represented by the current object using the specified escaping. More...
 
bool IsWellFormedOriginalString () const
 Indicates whether the string used to construct this Uri was well-formed and is not required to be further escaped. More...
 
bool IsBaseOf (const SharedPtr< Uri > &uri) const
 Determines of the URI represented by the current Uri object is a base of URI represented by the specified Uri object. More...
 
- Public Member Functions inherited from System::Object
 Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ~Object ()
 Destroys object. Frees all internal data structures. More...
 
 Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Static Public Member Functions

static UriHostNameType CheckHostName (String name)
 Determines the type of the specified host name. More...
 
static String HexEscape (char16_t character)
 Returns a hexadecimal equivalent of the specified character. More...
 
static char16_t HexUnescape (const String &pattern, int32_t &index)
 Converts the specified hexadecimal representation of a character to a character. More...
 
static bool IsHexEncoding (const String &pattern, int32_t index)
 Determines if a character in the specified string at the specified position is hexadecimal encoded. More...
 
static bool CheckSchemeName (const String &schemeName)
 Determines if the specified scheme is valid. More...
 
static bool IsHexDigit (char16_t character)
 Determines if the specified character represents a valid hexadecimal digit. More...
 
static int32_t FromHex (char16_t digit)
 Gets the decimal value of a hexadecimal digit. More...
 
static bool TryCreate (const String &uriString, UriKind uriKind, SharedPtr< Uri > &result)
 Constructs a Uri object that represents the specified URI; an argument specifies the URI kind. More...
 
static bool TryCreate (const SharedPtr< Uri > &baseUri, const String &relativeUri, SharedPtr< Uri > &result)
 Constructs an Uri abject from the specified Uri object representing the base URI and the string representation of relative URI. More...
 
static bool TryCreate (const SharedPtr< Uri > &baseUri, const SharedPtr< Uri > &relativeUri, SharedPtr< Uri > &result)
 Constructs an Uri abject from the specified base and relative URIs. More...
 
static int32_t Compare (const SharedPtr< Uri > &uri1, const SharedPtr< Uri > &uri2, UriComponents partsToCompare, UriFormat compareFormat, StringComparison comparisonType)
 Compares the specified Uri objects using the specified comparison rules. More...
 
static bool IsWellFormedUriString (const String &uriString, UriKind uriKind)
 Determines if the specified string is a well-formed URI. More...
 
static String UnescapeDataString (const String &stringToUnescape)
 Unescapes the specified escaped string. More...
 
static String EscapeUriString (const String &stringToEscape)
 Converts a URI string to its escaped representation. More...
 
static String EscapeDataString (const String &stringToEscape)
 Converts a string to its escaped representation. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 

Static Public Attributes

static const String UriSchemeFile
 Specifies that the Uri is a pointer to a file. More...
 
static const String UriSchemeFtp
 Specifies that the Uri is accessed through the File Transfer Protocol. More...
 
static const String UriSchemeGopher
 Specifies that the Uri is accessed through the Gopher protocol. More...
 
static const String UriSchemeHttp
 Specifies that the Uri is accessed through the Hypertext Transfer Protocol. More...
 
static const String UriSchemeHttps
 Specifies that the Uri is accessed through the Secure Hypertext Transfer Protocol. More...
 
static const String UriSchemeMailto
 Specifies that the Uri is an email address and is accessed through the Simple Mail Transport Protocol. More...
 
static const String UriSchemeNews
 Specifies that the Uri is an Internet news group and is accessed through the Network News Transport Protocol. More...
 
static const String UriSchemeNntp
 Specifies that the Uri is an Internet news group and is accessed through the Network News Transport Protocol. More...
 
static const String UriSchemeNetTcp
 Specifies that the Uri is accessed through the NetTcp scheme used by Windows Communication Foundation. More...
 
static const String UriSchemeNetPipe
 Specifies that the Uri is accessed through the NetPipe scheme used by Windows Communication Foundation. More...
 
static const String SchemeDelimiter
 Specifies the characters that separate the communication protocol scheme from the address portion of the Uri. More...
 

Protected Member Functions

virtual void Parse ()
 Obsolete method. More...
 
virtual void Canonicalize ()
 Obsolete method. More...
 
virtual void Escape ()
 Obsolete method. More...
 
virtual String Unescape (const String &path)
 Obsolete method. More...
 
virtual void CheckSecurity ()
 Obsolete method. More...
 
virtual bool IsReservedCharacter (char16_t character)
 Obsolete method. More...
 
virtual bool IsBadFileSystemCharacter (char16_t character)
 Obsolete method. More...
 

Static Protected Member Functions

static String EscapeString (const String &str)
 Obsolete method. More...
 
static bool IsExcludedCharacter (char16_t character)
 Obsolete method. More...
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 

Detailed Description

Unified resource identifier. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

#include "system/smart_ptr.h"
#include "system/uri.h"
#include <iostream>
int main()
{
const auto uri = System::MakeObject<System::Uri>(u"https://docs.codeporting.com/translator/cs2cpp/release-notes/2021/codeporting-translator-cs2cpp-21-9/");
std::cout <<
"AbsolutePath: " << uri->get_AbsolutePath() << std::endl <<
"AbsoluteUri: " << uri->get_AbsoluteUri() << std::endl <<
"Authority: " << uri->get_Authority() << std::endl <<
"DnsSafeHost: " << uri->get_DnsSafeHost() << std::endl <<
"Fragment: " << uri->get_Fragment() << std::endl <<
"Host: " << uri->get_Host() << std::endl <<
"IdnHost: " << uri->get_IdnHost() << std::endl <<
"LocalPath: " << uri->get_LocalPath() << std::endl <<
"OriginalString: " << uri->get_OriginalString() << std::endl <<
"PathAndQuery: " << uri->get_PathAndQuery() << std::endl <<
"Port: " << uri->get_Port() << std::endl <<
"Query: " << uri->get_Query() << std::endl <<
"Scheme: " << uri->get_Scheme() << std::endl;
return 0;
}
/*
This code example produces the following output:
AbsolutePath: /translator/cs2cpp/release-notes/2021/codeporting-translator-cs2cpp-21-9/
AbsoluteUri: https://docs.codeporting.com/translator/cs2cpp/release-notes/2021/codeporting-translator-cs2cpp-21-9/
Authority: docs.codeporting.com
DnsSafeHost: docs.codeporting.com
Fragment:
Host: docs.codeporting.com
IdnHost: docs.codeporting.com
LocalPath: /translator/cs2cpp/release-notes/2021/codeporting-translator-cs2cpp-21-9/
OriginalString: https://docs.codeporting.com/translator/cs2cpp/release-notes/2021/codeporting-translator-cs2cpp-21-9/
PathAndQuery: /translator/cs2cpp/release-notes/2021/codeporting-translator-cs2cpp-21-9/
Port: 443
Query:
Scheme: https
*/

Constructor & Destructor Documentation

◆ Uri() [1/6]

System::Uri::Uri ( const String uriString)

Constructs a Uri object that represents the specified URI.

Parameters
uriStringThe string URI to be represented by the object being constructed

◆ Uri() [2/6]

System::Uri::Uri ( const String uriString,
bool  dontEscape 
)

Constructs a Uri object that represents the specified URI; an argument specifies if the URI should be escaped.

Parameters
uriStringThe string URI to be represented by the object being constructed
dontEscapeSpecifies if the URI should not be escaped

◆ Uri() [3/6]

System::Uri::Uri ( const SharedPtr< Uri > &  baseUri,
const String relativeUri,
bool  dontEscape 
)

Constructs an Uri abject from the specified Uri object representing the base URI and the string representation of relative URI; an argument specifies if the URI should be escaped.

Parameters
baseUriThe base URI
relativeUriThe relative URI that is added to the base URI
dontEscapeSpecifies if the URI should not be escaped

◆ Uri() [4/6]

System::Uri::Uri ( const String uriString,
UriKind  uriKind 
)

Constructs a Uri object that represents the specified URI; an argument specifies the URI kind.

Parameters
uriStringThe string URI to be represented by the object being constructed
uriKindSpecifies the URI kind

◆ Uri() [5/6]

System::Uri::Uri ( const SharedPtr< Uri > &  baseUri,
const String relativeUri 
)

Constructs an Uri abject from the specified base and relative URIs.

Parameters
baseUriThe base URI
relativeUriThe relative URI that is added to the base URI

◆ Uri() [6/6]

System::Uri::Uri ( const SharedPtr< Uri > &  baseUri,
const SharedPtr< Uri > &  relativeUri 
)

Constructs an Uri abject from the specified base and relative URIs.

Parameters
baseUriThe base URI
relativeUriThe relative URI that is added to the base URI

Member Function Documentation

◆ Canonicalize()

virtual void System::Uri::Canonicalize ( )
protectedvirtual

Obsolete method.

◆ CheckHostName()

static UriHostNameType System::Uri::CheckHostName ( String  name)
static

Determines the type of the specified host name.

Parameters
nameThe host name to test
Returns
The type of the specified host name

◆ CheckSchemeName()

static bool System::Uri::CheckSchemeName ( const String schemeName)
static

Determines if the specified scheme is valid.

Parameters
schemeNameThe name of the scheme to test
Returns
True if the specified string is a valid scheme, otherwise - false

◆ CheckSecurity()

virtual void System::Uri::CheckSecurity ( )
protectedvirtual

Obsolete method.

◆ Compare()

static int32_t System::Uri::Compare ( const SharedPtr< Uri > &  uri1,
const SharedPtr< Uri > &  uri2,
UriComponents  partsToCompare,
UriFormat  compareFormat,
StringComparison  comparisonType 
)
static

Compares the specified Uri objects using the specified comparison rules.

Parameters
uri1The first comparand
uri2The second comparand
partsToCompareSpecifies the parts of uri1 and uri2 to compare
compareFormatSpecifies the character escaping used when components of URIs are compared
comparisonTypeOne of the StringComparison values
Returns
A negative value if uri1 is less than uri2; 0 if uri1 and uri2 are equal; a positive value if uri1 is greater than uri2

◆ Equals()

virtual bool System::Uri::Equals ( SharedPtr< Object comparand)
overridevirtual

Determines if the URIs represented by the current and specified objects are equal.

Parameters
comparandThe Uri object to compare the current object with
Returns
True if URIs are equal, otherwise - false

◆ Escape()

virtual void System::Uri::Escape ( )
protectedvirtual

Obsolete method.

◆ EscapeDataString()

static String System::Uri::EscapeDataString ( const String stringToEscape)
static

Converts a string to its escaped representation.

Parameters
stringToEscapeThe string to escape
Returns
A new string containing the escaped representation of stringToEscape

◆ EscapeString()

static String System::Uri::EscapeString ( const String str)
staticprotected

Obsolete method.

◆ EscapeUriString()

static String System::Uri::EscapeUriString ( const String stringToEscape)
static

Converts a URI string to its escaped representation.

Parameters
stringToEscapeThe string to escape
Returns
A String that contains the escaped representation of stringToEscape

◆ FromHex()

static int32_t System::Uri::FromHex ( char16_t  digit)
static

Gets the decimal value of a hexadecimal digit.

Parameters
digitThe hexadecimal digit to convert
Returns
A value that contains a number that corresponds to the specified hexadecimal digit

◆ get_AbsolutePath()

String System::Uri::get_AbsolutePath ( ) const

Returns the absolute path of the URI.

◆ get_AbsoluteUri()

String System::Uri::get_AbsoluteUri ( ) const

Returns the absolute URI.

◆ get_Authority()

String System::Uri::get_Authority ( ) const

Returns the host name and the port number for a server.

◆ get_DnsSafeHost()

String System::Uri::get_DnsSafeHost ( ) const

Returns an unescaped host name.

◆ get_Fragment()

String System::Uri::get_Fragment ( ) const

Returns the escaped URI fragment.

◆ get_Host()

String System::Uri::get_Host ( ) const

Returns the host name.

◆ get_HostNameType()

UriHostNameType System::Uri::get_HostNameType ( ) const

Returns the host name type.

◆ get_IdnHost()

String System::Uri::get_IdnHost ( ) const

Returns an International Domain Name of the host.

◆ get_IsAbsoluteUri()

bool System::Uri::get_IsAbsoluteUri ( ) const

Determines if the URI represented by the current object is absolute.

◆ get_IsDefaultPort()

bool System::Uri::get_IsDefaultPort ( ) const

Determines if the URI represented by the current object has default port for the URI's scheme.

◆ get_IsFile()

bool System::Uri::get_IsFile ( ) const

Determines if the URI represented by the current object is a file.

◆ get_IsLoopback()

bool System::Uri::get_IsLoopback ( ) const

Determines if the URI represented by the current object references a local host.

◆ get_IsUnc()

bool System::Uri::get_IsUnc ( ) const

Determines if the URI represented by the current object is a UNC path.

◆ get_LocalPath()

String System::Uri::get_LocalPath ( ) const

Returns the operating system representation of the file name referenced by the URI represented by the current object.

◆ get_OriginalString()

String System::Uri::get_OriginalString ( ) const

Returns the URI string that was passed to the constructor when current object was constructed.

◆ get_PathAndQuery()

String System::Uri::get_PathAndQuery ( ) const

Returns the absolute path and query components of the URI represented by the current object separated by a question mark (?).

◆ get_Port()

int32_t System::Uri::get_Port ( ) const

Returns the port number of the URI represented by the current object.

◆ get_Query()

String System::Uri::get_Query ( ) const

Returns the query information included in the URI represented by the current object.

◆ get_Scheme()

String System::Uri::get_Scheme ( ) const

Returns the scheme of the URI represented by the current object.

◆ get_Segments()

ArrayPtr< String > System::Uri::get_Segments ( ) const

Returns an array of strings containing the path segments of the URI represented by the current object.

◆ get_UserEscaped()

bool System::Uri::get_UserEscaped ( ) const

Determines if the URI string passed to the constructor of the current object was fully escaped.

◆ get_UserInfo()

String System::Uri::get_UserInfo ( ) const

Returns a uer name, password and other user information associated with the URI represented by the current object.

◆ GetComponents()

String System::Uri::GetComponents ( UriComponents  components,
UriFormat  format 
) const

Returns the specified components of the URI represented by the current object using the specified escaping.

Parameters
componentsA bitwise combination of the UriComponents values that specifies which parts of URI to return
formatSpecifies how the special characters are escaped
Returns
The requested components

◆ GetHashCode()

virtual int32_t System::Uri::GetHashCode ( ) const
overridevirtual

Gets the hash code for the URI.

Returns
The hash value generated for this URI

Reimplemented from System::Object.

◆ GetLeftPart()

String System::Uri::GetLeftPart ( UriPartial  part)

Returns the specified portion of the URI represented by the current object.

Parameters
partSpecifies which portion of the URI to return
Returns
The specified part of the URI represented by the current object

◆ HexEscape()

static String System::Uri::HexEscape ( char16_t  character)
static

Returns a hexadecimal equivalent of the specified character.

Parameters
characterThe character to convert
Returns
The hexadecimal representation of the specified character

◆ HexUnescape()

static char16_t System::Uri::HexUnescape ( const String pattern,
int32_t &  index 
)
static

Converts the specified hexadecimal representation of a character to a character.

Parameters
patternA string containing the hexadecimal representation of a character
indexThe position in pattern where the hexadecimal representation of a character begins
Returns
The character represented by the hexadecimal encoding at position index. If the character at index is not hexadecimal encoded, the character at index is returned. The value of index is incremented to point to the character following the one returned.

◆ IsBadFileSystemCharacter()

virtual bool System::Uri::IsBadFileSystemCharacter ( char16_t  character)
protectedvirtual

Obsolete method.

◆ IsBaseOf()

bool System::Uri::IsBaseOf ( const SharedPtr< Uri > &  uri) const

Determines of the URI represented by the current Uri object is a base of URI represented by the specified Uri object.

Parameters
uriThe Uri object to test
Returns
True if the URI represented by the current Uri object is a base of URI represented by uri

◆ IsExcludedCharacter()

static bool System::Uri::IsExcludedCharacter ( char16_t  character)
staticprotected

Obsolete method.

◆ IsHexDigit()

static bool System::Uri::IsHexDigit ( char16_t  character)
static

Determines if the specified character represents a valid hexadecimal digit.

Parameters
characterThe character to check
Returns
True if the specified character is hexadecimal digit, otherwise - false

◆ IsHexEncoding()

static bool System::Uri::IsHexEncoding ( const String pattern,
int32_t  index 
)
static

Determines if a character in the specified string at the specified position is hexadecimal encoded.

Parameters
patternThe string to check
indexZero-based position of the character to test
Returns
True if the specified character is hexadecimal encoded, otherwise - false

◆ IsReservedCharacter()

virtual bool System::Uri::IsReservedCharacter ( char16_t  character)
protectedvirtual

Obsolete method.

◆ IsWellFormedOriginalString()

bool System::Uri::IsWellFormedOriginalString ( ) const

Indicates whether the string used to construct this Uri was well-formed and is not required to be further escaped.

◆ IsWellFormedUriString()

static bool System::Uri::IsWellFormedUriString ( const String uriString,
UriKind  uriKind 
)
static

Determines if the specified string is a well-formed URI.

Parameters
uriStringThe URI to test
uriKindThe type of the specified URI
Returns
True if the specified URI is well-formed, otherwise - false

◆ MakeRelative()

String System::Uri::MakeRelative ( const SharedPtr< Uri > &  toUri)

Determines the difference between two Uri instances.

Parameters
toUriThe URI to compare to the current URI
Returns
If the hostname and scheme of the URIs represented by the current object and toUri are the same, then this method returns a String that represents a relative Uri, when appended to the current URI instance, yields toUri. If the hostname or scheme is different, then this method returns a String that represents the uri parameter.

◆ MakeRelativeUri()

SharedPtr< Uri > System::Uri::MakeRelativeUri ( const SharedPtr< Uri > &  uri)

Determines the difference between URIs represented by the current and the specified Uri objects.

Parameters
uriThe comparand
Returns
If the hostname and scheme of the URIs represented by the current object and toUri are the same, then this method returns a relative Uri that, when appended to the current URI instance, yields toUri. If the hostname or scheme is different, then this method returns a Uri object that represents the uri parameter.

◆ Parse()

virtual void System::Uri::Parse ( )
protectedvirtual

Obsolete method.

◆ ToString()

virtual String System::Uri::ToString ( ) const
overridevirtual

Returns the string representation of the URI represented by the current object.

Reimplemented from System::Object.

◆ TryCreate() [1/3]

static bool System::Uri::TryCreate ( const SharedPtr< Uri > &  baseUri,
const SharedPtr< Uri > &  relativeUri,
SharedPtr< Uri > &  result 
)
static

Constructs an Uri abject from the specified base and relative URIs.

Parameters
baseUriThe base URI
relativeUriThe relative URI that is added to the base URI
resultThe output argument that, if the construction succeeds, points to the newly constructed Uri object on method return
Returns
True if the construction succeeded, otherwise - false

◆ TryCreate() [2/3]

static bool System::Uri::TryCreate ( const SharedPtr< Uri > &  baseUri,
const String relativeUri,
SharedPtr< Uri > &  result 
)
static

Constructs an Uri abject from the specified Uri object representing the base URI and the string representation of relative URI.

Parameters
baseUriThe base URI
relativeUriThe relative URI that is added to the base URI
resultThe output argument that, if the construction succeeds, points to the newly constructed Uri object on method return
Returns
True if the construction succeeded, otherwise - false

◆ TryCreate() [3/3]

static bool System::Uri::TryCreate ( const String uriString,
UriKind  uriKind,
SharedPtr< Uri > &  result 
)
static

Constructs a Uri object that represents the specified URI; an argument specifies the URI kind.

Parameters
uriStringThe string URI to be represented by the object being constructed
uriKindSpecifies the URI kind
resultThe output argument that, if the construction succeeds, points to the newly constructed Uri object on method return
Returns
True if the construction succeeded, otherwise - false

◆ Unescape()

virtual String System::Uri::Unescape ( const String path)
protectedvirtual

Obsolete method.

◆ UnescapeDataString()

static String System::Uri::UnescapeDataString ( const String stringToUnescape)
static

Unescapes the specified escaped string.

Parameters
stringToUnescapeThe string to unescape
Returns
A new string containing the unescaped representation of stringToUnescape

Member Data Documentation

◆ SchemeDelimiter

const String System::Uri::SchemeDelimiter
static

Specifies the characters that separate the communication protocol scheme from the address portion of the Uri.

◆ UriSchemeFile

const String System::Uri::UriSchemeFile
static

Specifies that the Uri is a pointer to a file.

◆ UriSchemeFtp

const String System::Uri::UriSchemeFtp
static

Specifies that the Uri is accessed through the File Transfer Protocol.

◆ UriSchemeGopher

const String System::Uri::UriSchemeGopher
static

Specifies that the Uri is accessed through the Gopher protocol.

◆ UriSchemeHttp

const String System::Uri::UriSchemeHttp
static

Specifies that the Uri is accessed through the Hypertext Transfer Protocol.

◆ UriSchemeHttps

const String System::Uri::UriSchemeHttps
static

Specifies that the Uri is accessed through the Secure Hypertext Transfer Protocol.

◆ UriSchemeMailto

const String System::Uri::UriSchemeMailto
static

Specifies that the Uri is an email address and is accessed through the Simple Mail Transport Protocol.

◆ UriSchemeNetPipe

const String System::Uri::UriSchemeNetPipe
static

Specifies that the Uri is accessed through the NetPipe scheme used by Windows Communication Foundation.

◆ UriSchemeNetTcp

const String System::Uri::UriSchemeNetTcp
static

Specifies that the Uri is accessed through the NetTcp scheme used by Windows Communication Foundation.

◆ UriSchemeNews

const String System::Uri::UriSchemeNews
static

Specifies that the Uri is an Internet news group and is accessed through the Network News Transport Protocol.

◆ UriSchemeNntp

const String System::Uri::UriSchemeNntp
static

Specifies that the Uri is an Internet news group and is accessed through the Network News Transport Protocol.