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.

§47 ANNOYANCE-FILTER SINK MIME DECODER 49<br />

47. Sink MIME decoder.<br />

<strong>The</strong> sinkMIMEdecoder simply discards lines from the MIME part the first time getDecodedChar or<br />

getDecodedLine is called. It is used for skipping parts in which we aren’t interested.<br />

〈 Class definitions 10 〉 +≡<br />

class sinkMIMEdecoder : public MIMEdecoder {<br />

public:<br />

string name (void) const<br />

{<br />

return "Sink";<br />

}<br />

int getDecodedChar (void)<br />

{<br />

if (¬atEnd ) {<br />

while (getNextEncodedLine ( )) ;<br />

assert(atEnd );<br />

}<br />

return −1;<br />

}<br />

};

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

Saved successfully!

Ooh no, something went wrong!