]> git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/CapturingStoreEntry.h
Merge from trunk rev.13584
[thirdparty/squid.git] / src / tests / CapturingStoreEntry.h
1 /*
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9 #ifndef SQUID_TESTS_CAPTURINGSTORE_ENTRY_H
10 #define SQUID_TESTS_CAPTURINGSTORE_ENTRY_H
11
12 #include "Mem.h"
13 #include "Store.h"
14
15 /* class that captures various call data for test analysis */
16
17 class CapturingStoreEntry : public StoreEntry
18 {
19
20 public:
21 MEMPROXY_CLASS(CapturingStoreEntry);
22
23 CapturingStoreEntry() : _buffer_calls(0), _flush_calls(0) {}
24
25 String _appended_text;
26 int _buffer_calls;
27 int _flush_calls;
28
29 virtual void buffer() {
30 _buffer_calls += 1;
31 }
32
33 virtual void flush() {
34 _flush_calls += 1;
35 }
36
37 virtual void append(char const * buf, int len) {
38 _appended_text.append(buf, len);
39 }
40 };
41
42 MEMPROXY_CLASS_INLINE(CapturingStoreEntry);
43
44 #endif