QuoteUtil

Provide some consistent Http header value and Extension configuration parameter quoting support. <p> While QuotedStringTokenizer exists in the utils, and works great with http header values, using it in websocket-api is undesired. <ul> <li>Using QuotedStringTokenizer would introduce a dependency to the utils that would need to be exposed via the WebAppContext classloader</li> <li>ABNF defined extension parameter parsing requirements of RFC-6455 (WebSocket) ABNF, is slightly different than the ABNF parsing defined in RFC-2616 (HTTP/1.1).</li> <li>Future HTTPbis ABNF changes for parsing will impact QuotedStringTokenizer</li> </ul> It was decided to keep this implementation separate for the above reasons.

Members

Static functions

dequote
string dequote(string str)

Remove quotes from a string, only if the input string start with and end with the same quote character.

escape
void escape(StringBuilder buf, string str)
Undocumented in source. Be warned that the author may not have intended to support it.
quote
void quote(StringBuilder buf, string str)

Simple quote of a string, escaping where needed.

quoteIfNeeded
void quoteIfNeeded(StringBuilder buf, string str, string delim)

Append into buf the provided string, adding quotes if needed. <p> Quoting is determined if any of the characters in the <code>delim</code> are found in the input <code>str</code>.

splitAt
InputRange!string splitAt(string str, string delims)

Create an iterator of the input string, breaking apart the string at the provided delimiters, removing quotes and triming the parts of the string as needed.

unescape
string unescape(string str)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

ABNF_REQUIRED_QUOTING
enum string ABNF_REQUIRED_QUOTING;

ABNF from RFC 2616, RFC 822, and RFC 6455 specified characters requiring quoting.

Meta