BoolOps.h
Go to the documentation of this file.
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_SRC_ACL_BOOLOPS_H
10 #define SQUID_SRC_ACL_BOOLOPS_H
11 
12 #include "acl/InnerNode.h"
13 
14 /* ACLs defined here are used internally to construct an ACL expression tree.
15  * They cannot be specified directly in squid.conf because squid.conf ACLs are
16  * more complex than (and are implemented using) these operator-like classes.*/
17 
18 namespace Acl
19 {
20 
22 class NotNode: public InnerNode
23 {
25 
26 public:
27  explicit NotNode(Acl::Node *acl);
28 
29 private:
30  /* Acl::Node API */
31  char const *typeString() const override;
32  void parse() override;
33  SBufList dump() const override;
34 
35  /* Acl::InnerNode API */
36  int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const override;
37 };
38 
42 class AndNode: public InnerNode
43 {
45 
46 public:
47  /* ACL API */
48  char const *typeString() const override;
49  void parse() override;
50 
51 private:
52  int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const override;
53 };
54 
58 class OrNode: public InnerNode
59 {
61 
62 public:
65  virtual bool bannedAction(ACLChecklist *, Nodes::const_iterator) const;
66 
67  /* Acl::Node API */
68  char const *typeString() const override;
69  void parse() override;
70 
71 protected:
72  mutable Nodes::const_iterator lastMatch_;
73 
74 private:
75  int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const override;
76 };
77 
78 } // namespace Acl
79 
80 #endif /* SQUID_SRC_ACL_BOOLOPS_H */
81 
const char * typeString() const override
Definition: BoolOps.cc:65
void parse() override
parses node representation in squid.conf; dies on failures
Definition: BoolOps.cc:84
virtual bool bannedAction(ACLChecklist *, Nodes::const_iterator) const
Definition: BoolOps.cc:99
Nodes::const_iterator lastMatch_
Definition: BoolOps.h:72
std::list< SBuf > SBufList
Definition: forward.h:22
SBufList dump() const override
Definition: BoolOps.cc:55
void parse() override
parses node representation in squid.conf; dies on failures
Definition: BoolOps.cc:127
Definition: Acl.cc:33
An intermediate Acl::Node tree node. Manages a collection of child tree nodes.
Definition: InnerNode.h:22
MEMPROXY_CLASS(OrNode)
Implements the "not" or "!" operator.
Definition: BoolOps.h:22
NotNode(Acl::Node *acl)
Definition: BoolOps.cc:17
const char * typeString() const override
Definition: BoolOps.cc:93
int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const override
Definition: BoolOps.cc:105
void parse() override
parses node representation in squid.conf; dies on failures
Definition: BoolOps.cc:27
MEMPROXY_CLASS(AndNode)
const char * typeString() const override
Definition: BoolOps.cc:49
Definition: Node.h:25
MEMPROXY_CLASS(NotNode)
int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const override
Definition: BoolOps.cc:71
int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const override
Definition: BoolOps.cc:35

 

Introduction

Documentation

Support

Miscellaneous