--------------------- PatchSet 1528 Date: 2005/08/19 20:08:41 Author: rousskov Branch: squid3-icap Tag: (none) Log: - added hasContent() method - renamed packed() method to a more intuitive hasSpace() Members: src/MemBuf.h:1.3.16.1->1.3.16.2 Index: squid3/src/MemBuf.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/MemBuf.h,v retrieving revision 1.3.16.1 retrieving revision 1.3.16.2 diff -u -r1.3.16.1 -r1.3.16.2 --- squid3/src/MemBuf.h 18 Aug 2005 05:14:33 -0000 1.3.16.1 +++ squid3/src/MemBuf.h 19 Aug 2005 20:08:41 -0000 1.3.16.2 @@ -1,6 +1,6 @@ /* - * $Id: MemBuf.h,v 1.3.16.1 2005/08/18 05:14:33 rousskov Exp $ + * $Id: MemBuf.h,v 1.3.16.2 2005/08/19 20:08:41 rousskov Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -47,11 +47,12 @@ char *content() { return buf; } // start of the added data mb_size_t contentSize() const { return size; } // available data size + bool hasContent() const { return size > 0; } // space-related methods assume no growth and accounts for 0-termination char *space() { return buf + size; } // space to add data mb_size_t spaceSize() const; - bool packed() const { return spaceSize() <= 0; } + bool hasSpace() const { return size+1 < capacity; } void consume(mb_size_t sz); // removes sz bytes, moving content left void append(const char *c, mb_size_t sz); // grows if needed and possible