C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
Equals ( UrlPathString other ) : bool

Приватные методы

Метод Описание
UrlPathString ( string notEncodedString ) : System.Diagnostics

Описание методов

CreateFromHtmlXmlEncodedString() публичный статический Метод

In these strings, "&" would be & space would just be " "
public static CreateFromHtmlXmlEncodedString ( string encoded ) : UrlPathString
encoded string
Результат UrlPathString

CreateFromUnencodedString() публичный статический Метод

public static CreateFromUnencodedString ( string unencoded, bool strictlyTreatAsEncoded = false ) : UrlPathString
unencoded string
strictlyTreatAsEncoded bool
Результат UrlPathString

CreateFromUrlEncodedString() публичный статический Метод

NOTE: Assumes '+' is literal. See BL-3259
public static CreateFromUrlEncodedString ( string encoded ) : UrlPathString
encoded string
Результат UrlPathString

Equals() защищенный Метод

protected Equals ( UrlPathString other ) : bool
other UrlPathString
Результат bool

Equals() публичный Метод

public Equals ( object obj ) : bool
obj object
Результат bool

GetFullyDecodedPath() публичный статический Метод

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().
Результат string

GetHashCode() публичный Метод

public GetHashCode ( ) : int
Результат int

operator() публичный статический Метод

public static operator ( ) : bool
Результат bool