C# Class Platform.StringUriUtils

Provides useful methods for dealing with string based URIs.
Afficher le fichier Open project: platformdotnet/Platform

Méthodes publiques

Свойство Type Description
AcceptableSeperatorChars char[]

Méthodes publiques

Méthode Description
AppendQueryPart ( string uri, string key, string value ) : string
BuildQuery ( NameValueCollection nameValueCollection ) : string
BuildQuery ( NameValueCollection nameValueCollection, string>.Predicate acceptPair ) : string
BuildQuery ( string>.System pairs ) : string
BuildQuery ( string>.System pairs, string>.Predicate acceptPair ) : string
Combine ( string left, string right ) : string
ContainsQuery ( string uri ) : bool
Escape ( string s, Predicate includeChar ) : string
GetName ( string uri ) : string

Returns the name part of a URL

GetPath ( string uri ) : string
GetScheme ( string uri ) : string
GetSchemeAndPath ( string uri ) : string>.Pair
NormalizePath ( string path ) : string

NormalizePath(string, int, int)

Calls NormalizePath(string, int, int) with the array AcceptableSeperatorChars which contains '/' and '\'.

NormalizePath ( string path, int startIndex, int count ) : string
NormalizePath ( string path, int startIndex, int count, char seperatorChars, bool preserveEndingSeperator ) : string

Normalises a given path and returns the new normalised version.

The normalization process consists of the following: Path elements consisting of '.' are removed. Path elements before path elements consisting of '..' are removed. The given chars are replaced with the standard URI seperator char '/'.

Paths will always be returned without the trailing seperator char '/'.

ParseQuery ( string query ) : IEnumerable>,System.Collections.Generic
RemoveQuery ( string uri ) : string
Unescape ( string s ) : string
UrlEncode ( string instring ) : string

Private Methods

Méthode Description
CharArrayContains ( char array, char c ) : bool

Method Details

AppendQueryPart() public static méthode

public static AppendQueryPart ( string uri, string key, string value ) : string
uri string
key string
value string
Résultat string

BuildQuery() public static méthode

public static BuildQuery ( NameValueCollection nameValueCollection ) : string
nameValueCollection System.Collections.Specialized.NameValueCollection
Résultat string

BuildQuery() public static méthode

public static BuildQuery ( NameValueCollection nameValueCollection, string>.Predicate acceptPair ) : string
nameValueCollection System.Collections.Specialized.NameValueCollection
acceptPair string>.Predicate
Résultat string

BuildQuery() public static méthode

public static BuildQuery ( string>.System pairs ) : string
pairs string>.System
Résultat string

BuildQuery() public static méthode

public static BuildQuery ( string>.System pairs, string>.Predicate acceptPair ) : string
pairs string>.System
acceptPair string>.Predicate
Résultat string

Combine() public static méthode

public static Combine ( string left, string right ) : string
left string
right string
Résultat string

ContainsQuery() public static méthode

public static ContainsQuery ( string uri ) : bool
uri string
Résultat bool

Escape() public static méthode

public static Escape ( string s, Predicate includeChar ) : string
s string
includeChar Predicate
Résultat string

GetName() public static méthode

Returns the name part of a URL
public static GetName ( string uri ) : string
uri string
Résultat string

GetPath() public static méthode

public static GetPath ( string uri ) : string
uri string
Résultat string

GetScheme() public static méthode

public static GetScheme ( string uri ) : string
uri string
Résultat string

GetSchemeAndPath() public static méthode

public static GetSchemeAndPath ( string uri ) : string>.Pair
uri string
Résultat string>.Pair

NormalizePath() public static méthode

NormalizePath(string, int, int)
Calls NormalizePath(string, int, int) with the array AcceptableSeperatorChars which contains '/' and '\'.
public static NormalizePath ( string path ) : string
path string
Résultat string

NormalizePath() public static méthode

public static NormalizePath ( string path, int startIndex, int count ) : string
path string
startIndex int
count int
Résultat string

NormalizePath() public static méthode

Normalises a given path and returns the new normalised version.

The normalization process consists of the following: Path elements consisting of '.' are removed. Path elements before path elements consisting of '..' are removed. The given chars are replaced with the standard URI seperator char '/'.

Paths will always be returned without the trailing seperator char '/'.

public static NormalizePath ( string path, int startIndex, int count, char seperatorChars, bool preserveEndingSeperator ) : string
path string /// The path to normalise. ///
startIndex int
count int
seperatorChars char
preserveEndingSeperator bool
Résultat string

ParseQuery() public static méthode

public static ParseQuery ( string query ) : IEnumerable>,System.Collections.Generic
query string
Résultat IEnumerable>,System.Collections.Generic

RemoveQuery() public static méthode

public static RemoveQuery ( string uri ) : string
uri string
Résultat string

Unescape() public static méthode

public static Unescape ( string s ) : string
s string
Résultat string

UrlEncode() public static méthode

public static UrlEncode ( string instring ) : string
instring string
Résultat string

Property Details

AcceptableSeperatorChars public_oe static_oe property

Array of standard acceptable seperator chars for use when normalizing a path.
This array holds the chars '/' and '\'.
public static char[] AcceptableSeperatorChars
Résultat char[]