C# Class DotNetXri.Syntax.IRIUtils

Utility class that provides XRI-IRI-URI transformations
Mostrar archivo Open project: AArnott/dotnetxri

Public Methods

Method Description
IRItoURI ( string iri ) : string

Transforms the given IRI to URI.

IRItoXRI ( string iri ) : string
URItoIRI ( string uri ) : string

Transform the given URI to IRI according to the rules in RFC3987 section 3.2

XRItoIRI ( string s, bool inXref ) : string

Transforms the given XRI part to IRI-normal form. This method does not parse the given String; it simply converts all '%' to '%25', and if inXref is true, also percent encodes '#', '?' and '/'.

decodeHex ( string s, int index ) : int

Attempts to decode a 3-character percent-encoded sequence to the numeric value.

Protected Methods

Method Description
isIPrivate ( int cp ) : bool
isUCSChar ( int cp ) : bool
isUCSCharOrIPrivate ( int cp ) : bool
toUTF8PercentEncoded ( int cp ) : string

Private Methods

Method Description
countUTF8Sequence ( string inValue, int inIndex, byte u8buf ) : int
getHex ( string s, int index ) : string

Attempt to read a percent encoded sequence from the given string s at index position.

hasBiDiChar ( string s ) : bool
isPercentEncoded ( string s, int index ) : bool

Method Details

IRItoURI() public static method

Transforms the given IRI to URI.
public static IRItoURI ( string iri ) : string
iri string
return string

IRItoXRI() public static method

public static IRItoXRI ( string iri ) : string
iri string
return string

URItoIRI() public static method

Transform the given URI to IRI according to the rules in RFC3987 section 3.2
public static URItoIRI ( string uri ) : string
uri string this MUST be a valid URI string. Use the java.net.URI class /// to check before using this method.
return string

XRItoIRI() public static method

Transforms the given XRI part to IRI-normal form. This method does not parse the given String; it simply converts all '%' to '%25', and if inXref is true, also percent encodes '#', '?' and '/'.
public static XRItoIRI ( string s, bool inXref ) : string
s string
inXref bool
return string

decodeHex() public static method

Attempts to decode a 3-character percent-encoded sequence to the numeric value.
public static decodeHex ( string s, int index ) : int
s string
index int
return int

isIPrivate() protected static method

protected static isIPrivate ( int cp ) : bool
cp int
return bool

isUCSChar() protected static method

protected static isUCSChar ( int cp ) : bool
cp int
return bool

isUCSCharOrIPrivate() protected static method

protected static isUCSCharOrIPrivate ( int cp ) : bool
cp int
return bool

toUTF8PercentEncoded() protected static method

protected static toUTF8PercentEncoded ( int cp ) : string
cp int
return string