+++ /dev/null
-/*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
- *
- * Squid software is distributed under GPLv2+ license and includes
- * contributions from numerous individuals and organizations.
- * Please see the COPYING and CONTRIBUTORS files for details.
- */
-
-/* DEBUG: section 59 auto-growing Memory Buffer with printf */
-
-MemBuf::MemBuf() : buf (NULL), size (0), max_capacity (0), capacity(0), stolen(0)
-{}
-
-MemBuf::~MemBuf()
-{
- if (!stolen && buf)
- clean();
-}
/**
* Auto-growing memory-resident buffer with printf interface
- *
- \todo XXX: convert global memBuf*() functions into methods
+ * \deprecated Use SBuf instead.
*/
class MemBuf
{
-
public:
- _SQUID_INLINE_ MemBuf();
- _SQUID_INLINE_ ~MemBuf();
+ MemBuf():
+ buf(NULL),
+ size(0),
+ max_capacity(0),
+ capacity(0),
+ stolen(0)
+ {}
+ ~MemBuf() {
+ if (!stolen && buf)
+ clean();
+ }
/// start of the added data
char *content() { return buf; }
\deprecated use space*() and content*() methods to access safely instead.
* public, read-only.
*
- \todo XXX: hide these members completely and remove 0-termination
+ * TODO: hide these members completely and remove 0-termination
* so that consume() does not need to memmove all the time
*/
char *buf; // available content
/**
* when grows: assert(new_capacity <= max_capacity)
- \deprecated Use interface function instead
- \todo XXX: make these private after converting memBuf*() functions to methods
+ * \deprecated Use interface function instead
+ * TODO: make these private after converting memBuf*() functions to methods
*/
mb_size_t max_capacity;
/**
* allocated space
- \deprecated Use interface function instead
- \todo XXX: make these private after converting memBuf*() functions to methods
+ * \deprecated Use interface function instead
+ * TODO: make these private after converting memBuf*() functions to methods
*/
mb_size_t capacity;
CBDATA_CLASS2(MemBuf);
};
-#if _USE_INLINE_
-#include "MemBuf.cci"
-#endif
-
/** returns free() function to be used, _freezes_ the object! */
void memBufReport(MemBuf * mb);
/** pack content into a mem buf. */
void packerToMemInit(Packer * p, MemBuf * mb);
-#endif /* SQUID_MEM_H */
+#endif /* SQUID_MEMBUF_H */