12.06.2015 Views

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

§57 ANNOYANCE-FILTER BASE64 MIME DECODER 55<br />

57. <strong>The</strong> static method decodeEscapedText decodes text in its string argument, returning a string<br />

with escape sequences replaced by the encoded characters. Note that, notwithstanding this being a<br />

static method which can be invoked without reference to a base64MIMEdecoder object, we in fact<br />

actually instantiate such an object within the method, supplying its input from an istringstream<br />

constructed from the argument string.<br />

〈 Class implementations 11 〉 +≡<br />

string base64MIMEdecoder ::decodeEscapedText (const string s, mailFolder ∗m)<br />

{<br />

string r = "";<br />

base64MIMEdecoder dc;<br />

istringstream iss (s);<br />

int dchar ;<br />

}<br />

dc.set(&iss , m, "");<br />

while ((dchar = dc.getDecodedChar ( )) ≥ 0) {<br />

r += static cast〈char〉(dchar );<br />

}<br />

return r;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!