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...

Inherits System::Object.

Public Member Functions

ASPOSECPP_SHARED_API String get_AbsolutePath () const
 Returns the absolute path of the URI. More...
 
ASPOSECPP_SHARED_API String get_AbsoluteUri () const
 Returns the absolute URI. More...
 
ASPOSECPP_SHARED_API String get_LocalPath () const
 Returns the operating system representation of the file name referenced by the URI represented by the current object. More...
 
ASPOSECPP_SHARED_API String get_Authority () const
 Returns the host name and the port number for a server. More...
 
ASPOSECPP_SHARED_API UriHostNameType get_HostNameType () const
 Returns the host name type. More...
 
ASPOSECPP_SHARED_API bool get_IsDefaultPort () const
 Determines if the URI represented by the current object has default port for the URI's scheme. More...
 
ASPOSECPP_SHARED_API bool get_IsFile () const
 Determines if the URI represented by the current object is a file. More...
 
ASPOSECPP_SHARED_API bool get_IsLoopback () const
 Determines if the URI represented by the current object references a local host. More...
 
ASPOSECPP_SHARED_API 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...
 
ASPOSECPP_SHARED_API ArrayPtr< Stringget_Segments () const
 Returns an array of strings containing the path segments of the URI represented by the current object. More...
 
ASPOSECPP_SHARED_API bool get_IsUnc () const
 Determines if the URI represented by the current object is a UNC path. More...
 
ASPOSECPP_SHARED_API String get_Host () const
 Returns the host name. More...
 
ASPOSECPP_SHARED_API int32_t get_Port () const
 Returns the port number of the URI represented by the current object. More...
 
ASPOSECPP_SHARED_API String get_Query () const
 Returns the query information included in the URI represented by the current object. More...
 
ASPOSECPP_SHARED_API String get_Fragment () const
 Returns the escaped URI fragment. More...
 
ASPOSECPP_SHARED_API String get_Scheme () const
 Returns the scheme of the URI represented by the current object. More...
 
ASPOSECPP_SHARED_API String get_OriginalString () const
 Returns the URI string that was passed to the constructor when current object was constructed. More...
 
ASPOSECPP_SHARED_API String get_DnsSafeHost () const
 Returns an unescaped host name. More...
 
ASPOSECPP_SHARED_API String get_IdnHost () const
 Returns an International Domain Name of the host. More...
 
ASPOSECPP_SHARED_API bool get_IsAbsoluteUri () const
 Determines if the URI represented by the current object is absolute. More...
 
ASPOSECPP_SHARED_API bool get_UserEscaped () const
 Determines if the URI string passed to the constructor of the current object was fully escaped. More...
 
ASPOSECPP_SHARED_API String get_UserInfo () const
 Returns a uer name, password and other user information associated with the URI represented by the current object. More...
 
ASPOSECPP_SHARED_API Uri (const String &uriString)
 Constructs a Uri object that represents the specified URI. More...
 
ASPOSECPP_SHARED_API 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...
 
ASPOSECPP_SHARED_API 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...
 
ASPOSECPP_SHARED_API Uri (const String &uriString, UriKind uriKind)
 Constructs a Uri object that represents the specified URI; an argument specifies the URI kind. More...
 
ASPOSECPP_SHARED_API Uri (const SharedPtr< Uri > &baseUri, const String &relativeUri)
 Constructs an Uri abject from the specified base and relative URIs. More...
 
ASPOSECPP_SHARED_API Uri (const SharedPtr< Uri > &baseUri, const SharedPtr< Uri > &relativeUri)
 Constructs an Uri abject from the specified base and relative URIs. More...
 
ASPOSECPP_SHARED_API String GetLeftPart (UriPartial part)
 Returns the specified portion of the URI represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API int32_t GetHashCode () const override
 Gets the hash code for the URI. More...
 
virtual ASPOSECPP_SHARED_API String ToString () const override
 Returns the string representation of the URI represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (SharedPtr< Object > comparand) override
 Determines if the URIs represented by the current and specified objects are equal. More...
 
ASPOSECPP_SHARED_API SharedPtr< UriMakeRelativeUri (const SharedPtr< Uri > &uri)
 Determines the difference between URIs represented by the current and the specified Uri objects. More...
 
ASPOSECPP_SHARED_API String MakeRelative (const SharedPtr< Uri > &toUri)
 Determines the difference between two Uri instances. More...
 
ASPOSECPP_SHARED_API String GetComponents (UriComponents components, UriFormat format) const
 Returns the specified components of the URI represented by the current object using the specified escaping. More...
 
ASPOSECPP_SHARED_API bool IsWellFormedOriginalString () const
 Indicates whether the string used to construct this Uri was well-formed and is not required to be further escaped. More...
 
ASPOSECPP_SHARED_API 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
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API 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...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. 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...
 
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 ASPOSECPP_SHARED_API UriHostNameType CheckHostName (String name)
 Determines the type of the specified host name. More...
 
static ASPOSECPP_SHARED_API String HexEscape (char16_t character)
 Returns a hexadecimal equivalent of the specified character. More...
 
static ASPOSECPP_SHARED_API char16_t HexUnescape (const String &pattern, int32_t &index)
 Converts the specified hexadecimal representation of a character to a character. More...
 
static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API bool CheckSchemeName (const String &schemeName)
 Determines if the specified scheme is valid. More...
 
static ASPOSECPP_SHARED_API bool IsHexDigit (char16_t character)
 Determines if the specified character represents a valid hexadecimal digit. More...
 
static ASPOSECPP_SHARED_API int32_t FromHex (char16_t digit)
 Gets the decimal value of a hexadecimal digit. More...
 
static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API bool IsWellFormedUriString (const String &uriString, UriKind uriKind)
 Determines if the specified string is a well-formed URI. More...
 
static ASPOSECPP_SHARED_API String UnescapeDataString (const String &stringToUnescape)
 Unescapes the specified escaped string. More...
 
static ASPOSECPP_SHARED_API String EscapeUriString (const String &stringToEscape)
 Converts a URI string to its escaped representation. More...
 
static ASPOSECPP_SHARED_API 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...
 

Static Public Attributes

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

Protected Member Functions

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

Static Protected Member Functions

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

Friends

ASPOSECPP_SHARED_API bool operator== (const SharedPtr< Uri > &uri1, const SharedPtr< Uri > &uri2)
 Determines if the URIs represented by the current and specified objects are equal. More...
 
ASPOSECPP_SHARED_API bool operator!= (const SharedPtr< Uri > &uri1, const SharedPtr< Uri > &uri2)
 Determines if the URIs represented by the current and specified objects are not equal. 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]

ASPOSECPP_SHARED_API 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]

ASPOSECPP_SHARED_API 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]

ASPOSECPP_SHARED_API 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]

ASPOSECPP_SHARED_API 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]

ASPOSECPP_SHARED_API 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]

ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API void System::Uri::Canonicalize ( )
protectedvirtual

Obsolete method.

◆ CheckHostName()

static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API void System::Uri::CheckSecurity ( )
protectedvirtual

Obsolete method.

◆ Compare()

static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API void System::Uri::Escape ( )
protectedvirtual

Obsolete method.

◆ EscapeDataString()

static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API String System::Uri::EscapeString ( const String str)
staticprotected

Obsolete method.

◆ EscapeUriString()

static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API String System::Uri::get_AbsolutePath ( ) const

Returns the absolute path of the URI.

◆ get_AbsoluteUri()

ASPOSECPP_SHARED_API String System::Uri::get_AbsoluteUri ( ) const

Returns the absolute URI.

◆ get_Authority()

ASPOSECPP_SHARED_API String System::Uri::get_Authority ( ) const

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

◆ get_DnsSafeHost()

ASPOSECPP_SHARED_API String System::Uri::get_DnsSafeHost ( ) const

Returns an unescaped host name.

◆ get_Fragment()

ASPOSECPP_SHARED_API String System::Uri::get_Fragment ( ) const

Returns the escaped URI fragment.

◆ get_Host()

ASPOSECPP_SHARED_API String System::Uri::get_Host ( ) const

Returns the host name.

◆ get_HostNameType()

ASPOSECPP_SHARED_API UriHostNameType System::Uri::get_HostNameType ( ) const

Returns the host name type.

◆ get_IdnHost()

ASPOSECPP_SHARED_API String System::Uri::get_IdnHost ( ) const

Returns an International Domain Name of the host.

◆ get_IsAbsoluteUri()

ASPOSECPP_SHARED_API bool System::Uri::get_IsAbsoluteUri ( ) const

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

◆ get_IsDefaultPort()

ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API bool System::Uri::get_IsFile ( ) const

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

◆ get_IsLoopback()

ASPOSECPP_SHARED_API bool System::Uri::get_IsLoopback ( ) const

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

◆ get_IsUnc()

ASPOSECPP_SHARED_API bool System::Uri::get_IsUnc ( ) const

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

◆ get_LocalPath()

ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API String System::Uri::get_OriginalString ( ) const

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

◆ get_PathAndQuery()

ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API int32_t System::Uri::get_Port ( ) const

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

◆ get_Query()

ASPOSECPP_SHARED_API String System::Uri::get_Query ( ) const

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

◆ get_Scheme()

ASPOSECPP_SHARED_API String System::Uri::get_Scheme ( ) const

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

◆ get_Segments()

ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API bool System::Uri::get_UserEscaped ( ) const

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

◆ get_UserInfo()

ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API bool System::Uri::IsBadFileSystemCharacter ( char16_t  character)
protectedvirtual

Obsolete method.

◆ IsBaseOf()

ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API bool System::Uri::IsExcludedCharacter ( char16_t  character)
staticprotected

Obsolete method.

◆ IsHexDigit()

static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API bool System::Uri::IsReservedCharacter ( char16_t  character)
protectedvirtual

Obsolete method.

◆ IsWellFormedOriginalString()

ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API void System::Uri::Parse ( )
protectedvirtual

Obsolete method.

◆ ToString()

virtual ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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

◆ TryCreate() [2/3]

static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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

◆ Unescape()

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

Obsolete method.

◆ UnescapeDataString()

static ASPOSECPP_SHARED_API 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

Friends And Related Function Documentation

◆ operator!=

ASPOSECPP_SHARED_API bool operator!= ( const SharedPtr< Uri > &  uri1,
const SharedPtr< Uri > &  uri2 
)
friend

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

Parameters
uri1The first Uri object to compare
uri2The second Uri object to compare
Returns
True if URIs not equal, otherwise - false

◆ operator==

ASPOSECPP_SHARED_API bool operator== ( const SharedPtr< Uri > &  uri1,
const SharedPtr< Uri > &  uri2 
)
friend

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

Parameters
uri1The first Uri object to compare
uri2The second Uri object to compare
Returns
True if URIs are equal, otherwise - false

Member Data Documentation

◆ SchemeDelimiter

const ASPOSECPP_SHARED_API String System::Uri::SchemeDelimiter
static

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

◆ UriSchemeFile

const ASPOSECPP_SHARED_API String System::Uri::UriSchemeFile
static

Specifies that the Uri is a pointer to a file.

◆ UriSchemeFtp

const ASPOSECPP_SHARED_API String System::Uri::UriSchemeFtp
static

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

◆ UriSchemeGopher

const ASPOSECPP_SHARED_API String System::Uri::UriSchemeGopher
static

Specifies that the Uri is accessed through the Gopher protocol.

◆ UriSchemeHttp

const ASPOSECPP_SHARED_API String System::Uri::UriSchemeHttp
static

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

◆ UriSchemeHttps

const ASPOSECPP_SHARED_API String System::Uri::UriSchemeHttps
static

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

◆ UriSchemeMailto

const ASPOSECPP_SHARED_API String System::Uri::UriSchemeMailto
static

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

◆ UriSchemeNetPipe

const ASPOSECPP_SHARED_API String System::Uri::UriSchemeNetPipe
static

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

◆ UriSchemeNetTcp

const ASPOSECPP_SHARED_API String System::Uri::UriSchemeNetTcp
static

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

◆ UriSchemeNews

const ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API String System::Uri::UriSchemeNntp
static

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