From 68d5fd192fee358ad195c32b47333f8f87ae13f2 Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Mon, 7 Aug 2000 23:42:40 +0000 Subject: General cleanup: - Corrected some operators of bufferArray - Added more constructors to PsiTime - Added one more fallback for Timezone calculation in PsiTime - Use PsiTime in rfsv - Moved some common methods from rfsv16/32 to rfsv - Added more kdoc comments. - Made interface more robust (added const whereever possible, changed pointer arguments to references) --- lib/bufferarray.cc | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'lib/bufferarray.cc') diff --git a/lib/bufferarray.cc b/lib/bufferarray.cc index 77a08c6..953ec8f 100644 --- a/lib/bufferarray.cc +++ b/lib/bufferarray.cc @@ -125,15 +125,24 @@ operator [](const unsigned long index) return buff[index]; } -bufferArray &bufferArray:: -operator +(const bufferStore &a) +bufferArray bufferArray:: +operator +(const bufferStore &s) { - append(a); - return *this; + bufferArray res = *this; + res += s; + return res; } -bufferArray &bufferArray:: +bufferArray bufferArray:: operator +(const bufferArray &a) +{ + bufferArray res = *this; + res += a; + return res; +} + +bufferArray &bufferArray:: +operator +=(const bufferArray &a) { lenAllocd += a.lenAllocd; bufferStore *nb = new bufferStore[lenAllocd]; @@ -148,8 +157,8 @@ operator +(const bufferArray &a) } bufferArray &bufferArray:: -operator +=(const bufferStore &a) +operator +=(const bufferStore &s) { - append(a); + append(s); return *this; } -- cgit v1.2.3