]> git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/Note.h
Source Format Enforcement (#1234)
[thirdparty/squid.git] / src / acl / Note.h
1 /*
2 * Copyright (C) 1996-2023 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_ACLNOTE_H
10 #define SQUID_ACLNOTE_H
11
12 #include "acl/CharacterSetOption.h"
13 #include "acl/Data.h"
14 #include "acl/Strategy.h"
15 #include "Notes.h"
16
17 namespace Acl {
18
19 /// common parent of several ACLs dealing with transaction annotations
20 class AnnotationStrategy: public ACLStrategy<NotePairs::Entry *>
21 {
22 public:
23 AnnotationStrategy(): delimiters(CharacterSet(__FILE__, ",")) {}
24
25 const Acl::Options &options() override;
26
27 Acl::CharacterSetOptionValue delimiters; ///< annotation separators
28 };
29
30 } // namespace Acl
31
32 /// \ingroup ACLAPI
33 class ACLNoteStrategy: public Acl::AnnotationStrategy
34 {
35
36 public:
37 int match (ACLData<MatchType> * &, ACLFilledChecklist *) override;
38 bool requiresRequest() const override { return true; }
39
40 private:
41 bool matchNotes(ACLData<MatchType> *, const NotePairs *) const;
42 };
43
44 #endif /* SQUID_ACLNOTE_H */
45