Squid Web Cache
master
Loading...
Searching...
No Matches
CapturingStoreEntry.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2025 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_SRC_TESTS_CAPTURINGSTOREENTRY_H
10
#define SQUID_SRC_TESTS_CAPTURINGSTOREENTRY_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
void
buffer
()
override
{
28
_buffer_calls
+= 1;
29
}
30
31
void
flush
()
override
{
32
_flush_calls
+= 1;
33
}
34
35
void
append
(
char
const
* buf,
int
len)
override
{
36
if
(!buf || len < 0)
// old 'String' can't handle these cases
37
return
;
38
_appended_text
.
append
(buf, len);
39
}
40
};
41
42
#endif
/* SQUID_SRC_TESTS_CAPTURINGSTOREENTRY_H */
43
Store.h
CapturingStoreEntry
Definition
CapturingStoreEntry.h:17
CapturingStoreEntry::buffer
void buffer() override
Definition
CapturingStoreEntry.h:27
CapturingStoreEntry::CapturingStoreEntry
CapturingStoreEntry()
Definition
CapturingStoreEntry.h:21
CapturingStoreEntry::_flush_calls
int _flush_calls
Definition
CapturingStoreEntry.h:25
CapturingStoreEntry::append
void append(char const *buf, int len) override
Appends a c-string to existing packed data.
Definition
CapturingStoreEntry.h:35
CapturingStoreEntry::flush
void flush() override
Definition
CapturingStoreEntry.h:31
CapturingStoreEntry::_buffer_calls
int _buffer_calls
Definition
CapturingStoreEntry.h:24
CapturingStoreEntry::MEMPROXY_CLASS
MEMPROXY_CLASS(CapturingStoreEntry)
CapturingStoreEntry::_appended_text
String _appended_text
Definition
CapturingStoreEntry.h:23
StoreEntry
Definition
Store.h:38
String
Definition
SquidString.h:27
String::append
void append(char const *buf, int len)
Definition
String.cc:131
squid
src
tests
CapturingStoreEntry.h
Generated by
1.9.8