mscorlib(4.0.0.0) API with additions
System.UriParser Class Reference

Parses a new URI scheme. This is an abstract class. More...

Inheritance diagram for System.UriParser:
[legend]

Static Public Member Functions

static void Register (UriParser uriParser, string schemeName, int defaultPort)
 Associates a scheme and port number with a T:System.UriParser. More...
 
static bool IsKnownScheme (string schemeName)
 Indicates whether the parser for a scheme is registered. More...
 

Protected Member Functions

 UriParser ()
 Constructs a default URI parser. More...
 
virtual UriParser OnNewUri ()
 Invoked by a T:System.Uri constructor to get a T:System.UriParser instance More...
 
virtual void OnRegister (string schemeName, int defaultPort)
 Invoked by the Framework when a T:System.UriParser method is registered. More...
 
virtual void InitializeAndValidate (Uri uri, out UriFormatException parsingError)
 Initialize the state of the parser and validate the URI. More...
 
virtual string Resolve (Uri baseUri, Uri relativeUri, out UriFormatException parsingError)
 Called by T:System.Uri constructors and Overload:System.Uri.TryCreate to resolve a relative URI. More...
 
virtual bool IsBaseOf (Uri baseUri, Uri relativeUri)
 Determines whether baseUri is a base URI for relativeUri . More...
 
virtual string GetComponents (Uri uri, UriComponents components, UriFormat format)
 Gets the components from a URI. More...
 
virtual bool IsWellFormedOriginalString (Uri uri)
 Indicates whether a URI is well-formed. More...
 

Detailed Description

Parses a new URI scheme. This is an abstract class.

Definition at line 9 of file UriParser.cs.

Constructor & Destructor Documentation

◆ UriParser()

System.UriParser.UriParser ( )
protected

Constructs a default URI parser.

Definition at line 122 of file UriParser.cs.

Member Function Documentation

◆ GetComponents()

virtual string System.UriParser.GetComponents ( Uri  uri,
UriComponents  components,
UriFormat  format 
)
protectedvirtual

Gets the components from a URI.

Parameters
uriThe URI to parse.
componentsThe T:System.UriComponents to retrieve from uri .
formatOne of the T:System.UriFormat values that controls how special characters are escaped.
Returns
A string that contains the components.
Exceptions
T:System.ArgumentOutOfRangeExceptionuriFormat is invalid.- or - uriComponents is not a combination of valid T:System.UriComponents values.
T:System.InvalidOperationExceptionuri requires user-driven parsing- or - uri is not an absolute URI. Relative URIs cannot be used with this method.

Definition at line 202 of file UriParser.cs.

◆ InitializeAndValidate()

virtual void System.UriParser.InitializeAndValidate ( Uri  uri,
out UriFormatException  parsingError 
)
protectedvirtual

Initialize the state of the parser and validate the URI.

Parameters
uriThe T:System.Uri to validate.
parsingErrorValidation errors, if any.

Definition at line 144 of file UriParser.cs.

◆ IsBaseOf()

virtual bool System.UriParser.IsBaseOf ( Uri  baseUri,
Uri  relativeUri 
)
protectedvirtual

Determines whether baseUri is a base URI for relativeUri .

Parameters
baseUriThe base URI.
relativeUriThe URI to test.
Returns
true if baseUri is a base URI for relativeUri ; otherwise, false.

Definition at line 186 of file UriParser.cs.

◆ IsKnownScheme()

static bool System.UriParser.IsKnownScheme ( string  schemeName)
static

Indicates whether the parser for a scheme is registered.

Parameters
schemeNameThe scheme name to check.
Returns
true if schemeName has been registered; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionThe schemeName parameter is null.
T:System.ArgumentOutOfRangeExceptionThe schemeName parameter is not valid.

Definition at line 275 of file UriParser.cs.

◆ IsWellFormedOriginalString()

virtual bool System.UriParser.IsWellFormedOriginalString ( Uri  uri)
protectedvirtual

Indicates whether a URI is well-formed.

Parameters
uriThe URI to check.
Returns
true if uri is well-formed; otherwise, false.

Definition at line 227 of file UriParser.cs.

◆ OnNewUri()

virtual UriParser System.UriParser.OnNewUri ( )
protectedvirtual

Invoked by a T:System.Uri constructor to get a T:System.UriParser instance

Returns
A T:System.UriParser for the constructed T:System.Uri.

Definition at line 129 of file UriParser.cs.

◆ OnRegister()

virtual void System.UriParser.OnRegister ( string  schemeName,
int  defaultPort 
)
protectedvirtual

Invoked by the Framework when a T:System.UriParser method is registered.

Parameters
schemeNameThe scheme that is associated with this T:System.UriParser.
defaultPortThe port number of the scheme.

Definition at line 137 of file UriParser.cs.

◆ Register()

static void System.UriParser.Register ( UriParser  uriParser,
string  schemeName,
int  defaultPort 
)
static

Associates a scheme and port number with a T:System.UriParser.

Parameters
uriParserThe URI parser to register.
schemeNameThe name of the scheme that is associated with this parser.
defaultPortThe default port number for the specified scheme.
Exceptions
T:System.ArgumentNullExceptionuriParser parameter is null- or - schemeName parameter is null.
T:System.ArgumentOutOfRangeExceptionschemeName parameter is not valid- or - defaultPort parameter is not valid. The defaultPort parameter is less than -1 or greater than 65,534.

Definition at line 242 of file UriParser.cs.

◆ Resolve()

virtual string System.UriParser.Resolve ( Uri  baseUri,
Uri  relativeUri,
out UriFormatException  parsingError 
)
protectedvirtual

Called by T:System.Uri constructors and Overload:System.Uri.TryCreate to resolve a relative URI.

Parameters
baseUriA base URI.
relativeUriA relative URI.
parsingErrorErrors during the resolve process, if any.
Returns
The string of the resolved relative T:System.Uri.
Exceptions
T:System.InvalidOperationExceptionbaseUri parameter is not an absolute T:System.Uri- or - baseUri parameter requires user-driven parsing.

Definition at line 157 of file UriParser.cs.


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