]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/CapturingStoreEntry.h
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_SRC_TESTS_CAPTURINGSTOREENTRY_H
10 #define SQUID_SRC_TESTS_CAPTURINGSTOREENTRY_H
14 /* class that captures various call data for test analysis */
16 class CapturingStoreEntry
: public StoreEntry
18 MEMPROXY_CLASS(CapturingStoreEntry
);
21 CapturingStoreEntry() : _buffer_calls(0), _flush_calls(0) {}
23 String _appended_text
;
27 void buffer() override
{
31 void flush() override
{
35 void append(char const * buf
, int len
) override
{
36 if (!buf
|| len
< 0) // old 'String' can't handle these cases
38 _appended_text
.append(buf
, len
);
42 #endif /* SQUID_SRC_TESTS_CAPTURINGSTOREENTRY_H */