From ec3cbbf5590e48ff9a6a1119f08ed07bc41ecba6 Mon Sep 17 00:00:00 2001 From: zimoch Date: Fri, 11 Jul 2008 14:49:23 +0000 Subject: [PATCH] allow append of n equal bytes --- src/StreamBuffer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/StreamBuffer.h b/src/StreamBuffer.h index 5407355..d475dba 100644 --- a/src/StreamBuffer.h +++ b/src/StreamBuffer.h @@ -106,8 +106,8 @@ public: {grow(size); char* p=buffer+len; len+=size; return p;} // append: append data at the end of the buffer - StreamBuffer& append(char c) - {check(1); buffer[offs+len++]=c; return *this;} + StreamBuffer& append(char c, long count=1) + {check(count); while(count-->0) buffer[offs+len++]=c; return *this;} StreamBuffer& append(const void* s, long size);