Squid Web Cache
master
Loading...
Searching...
No Matches
NoteData.cc
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
#include "
squid.h
"
10
#include "
acl/Acl.h
"
11
#include "
acl/Checklist.h
"
12
#include "
acl/NoteData.h
"
13
#include "
acl/StringData.h
"
14
#include "
ConfigParser.h
"
15
#include "
debug/Stream.h
"
16
#include "
sbuf/StringConvert.h
"
17
#include "
wordlist.h
"
18
19
ACLNoteData::ACLNoteData
() : values(new
ACLStringData
)
20
{}
21
22
ACLNoteData::~ACLNoteData
()
23
{
24
delete
values
;
25
}
26
27
bool
28
ACLNoteData::match
(
NotePairs::Entry
*entry)
29
{
30
if
(entry->
name
().
cmp
(
name
) != 0)
31
return
false
;
// name mismatch
32
33
// a name-only note ACL matches any value; others require a values match
34
return
values
->
empty
() ||
35
values
->
match
(entry->
value
());
36
}
37
38
SBufList
39
ACLNoteData::dump
()
const
40
{
41
SBufList
sl;
42
sl.push_back(
name
);
43
sl.splice(sl.end(),
values
->
dump
());
44
return
sl;
45
}
46
47
void
48
ACLNoteData::parse
()
49
{
50
Acl::SetKey
(
name
,
"annotation name"
,
ConfigParser::strtokFile
());
51
values
->
parse
();
52
}
53
54
bool
55
ACLNoteData::empty
()
const
56
{
57
return
name
.
isEmpty
();
58
}
59
Checklist.h
ConfigParser.h
NoteData.h
StringConvert.h
StringData.h
Acl.h
ACLNoteData::parse
void parse() override
Definition
NoteData.cc:48
ACLNoteData::values
ACLStringData * values
if set, at least one value must match
Definition
NoteData.h:33
ACLNoteData::empty
bool empty() const override
Definition
NoteData.cc:55
ACLNoteData::~ACLNoteData
~ACLNoteData() override
Definition
NoteData.cc:22
ACLNoteData::match
bool match(NotePairs::Entry *) override
Definition
NoteData.cc:28
ACLNoteData::ACLNoteData
ACLNoteData()
Definition
NoteData.cc:19
ACLNoteData::name
SBuf name
Note name to check. It is always set.
Definition
NoteData.h:32
ACLNoteData::dump
SBufList dump() const override
Definition
NoteData.cc:39
ACLStringData
Definition
StringData.h:19
ACLStringData::match
bool match(char const *) override
Definition
StringData.cc:39
ACLStringData::empty
bool empty() const override
Definition
StringData.cc:65
ACLStringData::parse
void parse() override
Definition
StringData.cc:58
ACLStringData::dump
SBufList dump() const override
Definition
StringData.cc:50
ConfigParser::strtokFile
static char * strtokFile()
Definition
ConfigParser.cc:65
NotePairs::Entry
Used to store a note key/value pair.
Definition
Notes.h:187
NotePairs::Entry::value
const SBuf & value() const
Definition
Notes.h:200
NotePairs::Entry::name
const SBuf & name() const
Definition
Notes.h:199
SBuf::cmp
int cmp(const SBuf &S, const size_type n) const
shorthand version for compare()
Definition
SBuf.h:279
SBuf::isEmpty
bool isEmpty() const
Definition
SBuf.h:435
Stream.h
Acl::SetKey
void SetKey(SBuf &keyStorage, const char *keyParameterName, const char *newKey)
Definition
Acl.cc:100
SBufList
std::list< SBuf > SBufList
Definition
forward.h:23
squid.h
wordlist.h
squid
src
acl
NoteData.cc
Generated by
1.9.8