]> git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/CapturingStoreEntry.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / tests / CapturingStoreEntry.h
1 /*
2 * Copyright (C) 1996-2015 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 "Store.h"
13
14 /* class that captures various call data for test analysis */
15
16 class CapturingStoreEntry : public StoreEntry
17 {
18 MEMPROXY_CLASS(CapturingStoreEntry);
19
20 public:
21 CapturingStoreEntry() : _buffer_calls(0), _flush_calls(0) {}
22
23 String _appended_text;
24 int _buffer_calls;
25 int _flush_calls;
26
27 virtual void buffer() {
28 _buffer_calls += 1;
29 }
30
31 virtual void flush() {
32 _flush_calls += 1;
33 }
34
35 virtual void append(char const * buf, int len) {
36 _appended_text.append(buf, len);
37 }
38 };
39
40 #endif
41