From ab18114bfd38d4632c66401b5bc079241e27fab3 Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Mon, 17 Jan 2000 11:49:41 +0000 Subject: Release of plptools-0.5 --- lib/bufferstore.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/bufferstore.cc') diff --git a/lib/bufferstore.cc b/lib/bufferstore.cc index 886b952..842e666 100644 --- a/lib/bufferstore.cc +++ b/lib/bufferstore.cc @@ -19,7 +19,8 @@ // // e-mail philip.proudman@btinternet.com -#include +#include +// That should be iostream.h, but it won't build on Sun WorkShop C++ 5.0 #include #include @@ -48,7 +49,7 @@ bufferStore::bufferStore(const unsigned char*_buff, long _len) { start = 0; } -void bufferStore::operator =(const bufferStore &a) { +bufferStore &bufferStore::operator =(const bufferStore &a) { checkAllocd(a.getLen()); len = a.getLen(); memcpy(buff, a.getString(0), len); @@ -106,7 +107,7 @@ ostream &operator<<(ostream &s, const bufferStore &m) { if (c>=' ' && c <= 'z') s << c; } } - s<< ")"; + s<< ")" << dec << setw(0); return s; } @@ -144,6 +145,12 @@ void bufferStore::addStringT(const char* s) { addByte(0); } +void bufferStore::addBytes(const unsigned char* s, int l) { + checkAllocd(len + l); + memcpy(&buff[len], s, l); + len += l; +} + void bufferStore::addBuff(const bufferStore &s, long maxLen) { long l = s.getLen(); checkAllocd(len + l); -- cgit v1.2.3