From 8baf7e1e75a185c742dc6d5b27e50058635e5522 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 10 May 2010 03:31:08 +0000 Subject: Added the new QueueBuf. It's brilliant, and I've wanted it for a long time. ...I mean brilliant as in cool. --- src/tests/queuebuf.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/tests/queuebuf.cpp (limited to 'src/tests') diff --git a/src/tests/queuebuf.cpp b/src/tests/queuebuf.cpp new file mode 100644 index 0000000..accc723 --- /dev/null +++ b/src/tests/queuebuf.cpp @@ -0,0 +1,23 @@ +#include +#include + +using namespace Bu; + +int main() +{ + static const char *src = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789%#"; + QueueBuf qb; + + for( int j = 0; j < 8; j++ ) + { + qb.write( src, 60 ); + } + + char buf[11]; + while( !qb.isEos() ) + { + buf[qb.read( buf, 9 )] = '\0'; + sio << "Read: >>" << buf << "<<" << sio.nl; + } +} + -- cgit v1.2.3