[sword-cvs] sword/include swbuf.h,1.25,1.26

sword@www.crosswire.org sword@www.crosswire.org
Sun, 21 Dec 2003 03:55:00 -0700


Update of /usr/local/cvsroot/sword/include
In directory www:/tmp/cvs-serv1859

Modified Files:
	swbuf.h 
Log Message:
Added a working shift operator to SWBuf


Index: swbuf.h
===================================================================
RCS file: /usr/local/cvsroot/sword/include/swbuf.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- swbuf.h	21 Dec 2003 10:42:01 -0000	1.25
+++ swbuf.h	21 Dec 2003 10:54:58 -0000	1.26
@@ -193,7 +193,7 @@
 	inline SWBuf &operator -=(unsigned long len) { setSize(length()-len); return *this; }
 	inline SWBuf &operator --(int) { operator -=(1); return *this; }
 
-	inline SWBuf &operator <<(int) { memmove(buf, buf+1, length()); (*this)--; return *this; }
+	inline SWBuf &operator <<(int n) { n = (n<length())?n:length(); memmove(buf, buf+n, length()-n); (*this)-=n; return *this; }
 	inline SWBuf operator +(const SWBuf &other) const {
 		SWBuf retVal = buf;
 		retVal += other;