DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
DotNetDupe::System::UriParser Class Reference

Parses a new URI scheme and provides scheme-specific component extraction. More...

#include <UriParser.h>

Inheritance diagram for DotNetDupe::System::UriParser:

Public Member Functions

 UriParser ()
 Constructs a default instance of UriParser.
virtual String GetComponents (const Uri &uri, UriComponents components, UriFormat format)
 Gets the components from a URI formatted as specified.
Public Member Functions inherited from DotNetDupe::System::Object
virtual ~Object ()=default
 Virtual destructor ensuring polymorphic cleanup.
virtual bool Equals (const Object &obj) const
 Determines whether the specified Object is equal to the current Object.
virtual int GetHashCode () const
 Serves as the default hash function.
bool operator== (const Object &obj) const
 Determines reference equality between two objects.
char * ToStringA () const
 Returns narrow-character string representation.
wchar_t * ToStringW () const
 Returns wide-character string representation.

Static Public Member Functions

static UriParserGetParser (const String &schemeName)
 Retrieves the registered parser associated with a scheme.
static bool IsKnownScheme (const String &schemeName)
 Indicates whether the parser for a scheme is registered.
static void Register (UriParser *uriParser, const String &schemeName, int defaultPort)
 Registers a custom parser and default port for a specific URI scheme.
Static Public Member Functions inherited from DotNetDupe::System::Object
static bool Equals (const Object &obj1, const Object &obj2)
 Static helper determining whether two object instances are equal.

Detailed Description

Parses a new URI scheme and provides scheme-specific component extraction.

Modeled after .NET System.UriParser. Manages registered scheme parsers and handles custom parsing behaviors for standard and application-defined protocol schemes.

Definition at line 23 of file UriParser.h.

Constructor & Destructor Documentation

◆ UriParser()

DotNetDupe::System::UriParser::UriParser ( )

Constructs a default instance of UriParser.

Default initialization of base URI parser.

Definition at line 12 of file UriParser.cpp.

Referenced by DotNetDupe::System::GenericUriParser::GenericUriParser(), GetParser(), and Register().

Member Function Documentation

◆ GetComponents()

String DotNetDupe::System::UriParser::GetComponents ( const Uri & uri,
UriComponents components,
UriFormat format )
virtual

Gets the components from a URI formatted as specified.

Parameters
uriThe source Uri to extract components from.
componentsBitwise combination of UriComponents to extract.
formatThe escaping format specification.
Returns
Extracted component string.

Base implementation: return absolute URI string.

Definition at line 35 of file UriParser.cpp.

References DotNetDupe::System::Uri::GetAbsoluteUri().

◆ GetParser()

UriParser * DotNetDupe::System::UriParser::GetParser ( const String & schemeName)
static

Retrieves the registered parser associated with a scheme.

Parameters
schemeNameThe scheme name to look up.
Returns
Pointer to the registered UriParser, or nullptr if not found.

Step: Search for registered parser matching scheme name.

Definition at line 26 of file UriParser.cpp.

References UriParser().

◆ IsKnownScheme()

bool DotNetDupe::System::UriParser::IsKnownScheme ( const String & schemeName)
static

Indicates whether the parser for a scheme is registered.

Parameters
schemeNameThe scheme name to check.
Returns
True if scheme is registered; otherwise false.

Check if scheme is registered in parser map.

Definition at line 21 of file UriParser.cpp.

◆ Register()

void DotNetDupe::System::UriParser::Register ( UriParser * uriParser,
const String & schemeName,
int defaultPort )
static

Registers a custom parser and default port for a specific URI scheme.

Parameters
uriParserPointer to the parser instance to register.
schemeNameThe protocol scheme name (e.g. "http", "custom").
defaultPortThe default TCP/UDP port associated with the scheme.

Associate parser instance and default port with given scheme name.

Definition at line 16 of file UriParser.cpp.

References UriParser().


The documentation for this class was generated from the following files: