C# Class Bloom.UrlPathString

A wrapper around string designed to reduced bugs introduced by losing track of the encoded/unencoded state of a string. It does this by requiring users to specify what they are putting in/getting out, and it keeps track.
Afficher le fichier Open project: BloomBooks/BloomDesktop Class Usage Examples

Méthodes publiques

Méthode Description
CreateFromHtmlXmlEncodedString ( string encoded ) : UrlPathString

In these strings, "&" would be & space would just be " "

CreateFromUnencodedString ( string unencoded, bool strictlyTreatAsEncoded = false ) : UrlPathString
CreateFromUrlEncodedString ( string encoded ) : UrlPathString

NOTE: Assumes '+' is literal. See BL-3259

Equals ( object obj ) : bool
GetFullyDecodedPath ( string directory, string &filename ) : string

Some library books have been uploaded with the cover image filename URL encoded in the file instead of HTML/XML encoded. So if the file doesn't exist, try one more level of decoding to see if that may be the problem, but preserve the original path in case an error message is still needed.

See https://silbloom.myjetbrains.com/youtrack/issue/BL-3901.

GetHashCode ( ) : int
operator ( ) : bool

Méthodes protégées

Méthode Description
Equals ( UrlPathString other ) : bool

Private Methods

Méthode Description
UrlPathString ( string notEncodedString ) : System.Diagnostics

Method Details

CreateFromHtmlXmlEncodedString() public static méthode

In these strings, "&" would be & space would just be " "
public static CreateFromHtmlXmlEncodedString ( string encoded ) : UrlPathString
encoded string
Résultat UrlPathString

CreateFromUnencodedString() public static méthode

public static CreateFromUnencodedString ( string unencoded, bool strictlyTreatAsEncoded = false ) : UrlPathString
unencoded string
strictlyTreatAsEncoded bool
Résultat UrlPathString

CreateFromUrlEncodedString() public static méthode

NOTE: Assumes '+' is literal. See BL-3259
public static CreateFromUrlEncodedString ( string encoded ) : UrlPathString
encoded string
Résultat UrlPathString

Equals() protected méthode

protected Equals ( UrlPathString other ) : bool
other UrlPathString
Résultat bool

Equals() public méthode

public Equals ( object obj ) : bool
obj object
Résultat bool

GetFullyDecodedPath() public static méthode

Some library books have been uploaded with the cover image filename URL encoded in the file instead of HTML/XML encoded. So if the file doesn't exist, try one more level of decoding to see if that may be the problem, but preserve the original path in case an error message is still needed.
See https://silbloom.myjetbrains.com/youtrack/issue/BL-3901.
public static GetFullyDecodedPath ( string directory, string &filename ) : string
directory string path of the containing folder
filename string base filename to be combined with directory. This may be modified by HttpUtility.UrlDecode().
Résultat string

GetHashCode() public méthode

public GetHashCode ( ) : int
Résultat int

operator() public static méthode

public static operator ( ) : bool
Résultat bool