DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
Uri.h
Go to the documentation of this file.
1
5
6#pragma once
7#include "Common.h"
8#include "System/Object.h"
9#include "System/String.h"
10
11namespace DotNetDupe {
12 namespace System {
13
21 class Uri : public Object {
22 public:
25 DOTNETDUPE_API Uri(const String& uriString);
26
30
34
38
42
45 DOTNETDUPE_API int GetPort() const;
46
50
54
58
62
66
70
73 DOTNETDUPE_API bool IsDefaultPort() const;
74
77 DOTNETDUPE_API bool IsFile() const;
78
81 DOTNETDUPE_API bool IsLoopback() const;
82
86 DOTNETDUPE_API static String EscapeDataString(const String& stringToEscape);
87
91 DOTNETDUPE_API static String UnescapeDataString(const String& stringToUnescape);
92
93 private:
94 void ParseUri();
95
96 String _uriString;
97 String _scheme;
98 String _authority;
99 String _host;
100 int _port;
101 String _path;
102 String _query;
103 String _fragment;
104 String _userInfo;
105 };
106
107 }
108}
Defines common cross-platform macros, export decorators, and fundamental types.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition Common.h:20
Base object class for DotNetDupe mirroring .NET System.Object.
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
Supports all classes in the DotNetDupe class hierarchy.
Definition Object.h:18
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74
String GetHost() const
Gets the host component of this instance.
Definition Uri.cpp:105
String GetFragment() const
Gets the escaped URI fragment.
Definition Uri.cpp:109
String GetOriginalString() const
Gets the original URI string passed to the constructor.
Definition Uri.cpp:111
bool IsFile() const
Determines whether the specified Uri is a file URI.
Definition Uri.cpp:125
int GetPort() const
Gets the port number of this URI.
Definition Uri.cpp:106
String GetUserInfo() const
Gets the user name, password, or other user-specific information associated with the specified URI.
Definition Uri.cpp:110
bool IsLoopback() const
Determines whether the specified Uri references the local host.
Definition Uri.cpp:130
String GetScheme() const
Gets the scheme name for this URI.
Definition Uri.cpp:102
Uri(const String &uriString)
Initializes a new instance of the Uri class with the specified URI string.
Definition Uri.cpp:9
static String UnescapeDataString(const String &stringToUnescape)
Converts a string to its unescaped representation according to RFC 3986.
Definition Uri.cpp:166
String GetQuery() const
Gets any query information included in the specified URI.
Definition Uri.cpp:108
bool IsDefaultPort() const
Determines whether the port value of the URI is the default for this scheme.
Definition Uri.cpp:118
String GetAbsoluteUri() const
Gets the absolute URI string representation.
Definition Uri.cpp:103
String GetAuthority() const
Gets the authority (host, optional port, and optional user information).
Definition Uri.cpp:104
String ToString() const
Gets the canonical string representation for the specified Uri instance.
Definition Uri.cpp:113
String GetAbsolutePath() const
Gets the absolute path of the URI.
Definition Uri.cpp:107
static String EscapeDataString(const String &stringToEscape)
Converts a string to its escaped representation according to RFC 3986.
Definition Uri.cpp:135