aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bufferstore.cc
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2000-01-17 11:49:41 +0000
committerFritz Elfert <felfert@to.com>2000-01-17 11:49:41 +0000
commitab18114bfd38d4632c66401b5bc079241e27fab3 (patch)
tree14f9c1d5f020cf8ed2f205094ca9e2fc907bb969 /lib/bufferstore.cc
parent6eceb82662300bf306e70bd943200665bc3c9bc3 (diff)
downloadplptools-ab18114bfd38d4632c66401b5bc079241e27fab3.tar.gz
plptools-ab18114bfd38d4632c66401b5bc079241e27fab3.tar.bz2
plptools-ab18114bfd38d4632c66401b5bc079241e27fab3.zip
Release of plptools-0.5
Diffstat (limited to 'lib/bufferstore.cc')
-rw-r--r--lib/bufferstore.cc13
1 files changed, 10 insertions, 3 deletions
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 <stream.h>
+#include <stream.h>
+// That should be iostream.h, but it won't build on Sun WorkShop C++ 5.0
#include <iomanip.h>
#include <string.h>
@@ -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);