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...
|
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< String > | get_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< Uri > | MakeRelativeUri (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...
|
|
| 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...
|
|
Object & | operator= (Object const &x) |
| Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
|
|
Object * | SharedRefAdded () |
| 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 TypeInfo & | GetType () 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 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 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 TypeInfo & | Type () |
| 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...
|
|
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;
}