From 89df61f21e525c7a36846ce1a960ffba5501cdca Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 30 Jun 2009 04:28:47 +0000 Subject: Bu::Client now gives you the option to add additional filters to the filter chain on the base stream, which for the moment is a socket. I also demonstrate this in the new rot13 test, with a rot13 filter, and a simple echo protocol. --- src/client.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/client.h') diff --git a/src/client.h b/src/client.h index b11774e..7ba1ac5 100644 --- a/src/client.h +++ b/src/client.h @@ -66,7 +66,18 @@ namespace Bu bool hasOutput() { return !sWriteBuf.isEmpty(); } + template + void pushFilter() + { + filter *pFlt = new filter( *pTopStream ); + pTopStream = pFlt; + lFilts.prepend( pFlt ); + } + private: + typedef Bu::List FilterList; + FilterList lFilts; + Bu::Stream *pTopStream; Bu::Socket *pSocket; Bu::Protocol *pProto; Bu::FString sReadBuf; -- cgit v1.2.3