From: wessels <> Date: Tue, 22 Nov 2005 06:04:56 +0000 (+0000) Subject: Added const version of MemBuf::content() so that const MemBuf can be X-Git-Tag: SQUID_3_0_PRE4~513 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9bcd2d11896106bcb7662cb67bae20f1c4c129dc;p=thirdparty%2Fsquid.git Added const version of MemBuf::content() so that const MemBuf can be a parameter. Added MemBuf::wasStolen() method This was done for ICAP integration. --- diff --git a/src/MemBuf.h b/src/MemBuf.h index 6308eb8caf..cf2f47855d 100644 --- a/src/MemBuf.h +++ b/src/MemBuf.h @@ -1,5 +1,7 @@ + + /* - * $Id: MemBuf.h,v 1.5 2005/09/17 05:50:07 wessels Exp $ + * $Id: MemBuf.h,v 1.6 2005/11/21 23:04:56 wessels Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -45,7 +47,9 @@ public: /* use methods instead of deprecated buf and size members */ - char *content() { return buf; } // start of the added data + char *content() { return buf; } // start of the added data + + const char *content() const { return buf; } // start of the added data mb_size_t contentSize() const { return size; } // available data size @@ -70,6 +74,8 @@ public: void terminate(); // zero-terminates the buffer w/o increasing contentSize + bool wasStolen() const { return stolen; } + /* init with specific sizes */ void init(mb_size_t szInit, mb_size_t szMax); @@ -102,7 +108,6 @@ public: /* returns free() function to be used, _freezes_ the object! */ FREE *freeFunc(); - private: /* * private copy constructor and assignment operator generates @@ -130,6 +135,12 @@ public: unsigned stolen: 1; /* the buffer has been stolen for use by someone else */ + +#if 0 + +unsigned valid: + 1; /* to be used for debugging only! */ +#endif }; #ifdef _USE_INLINE_