]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/NoteData.cc
2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
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.
11 #include "acl/Checklist.h"
12 #include "acl/NoteData.h"
13 #include "acl/StringData.h"
14 #include "ConfigParser.h"
16 #include "sbuf/StringConvert.h"
19 ACLNoteData::ACLNoteData() : values(new ACLStringData
)
22 ACLNoteData::~ACLNoteData()
28 ACLNoteData::match(NotePairs::Entry
*entry
)
30 if (entry
->name().cmp(name
) != 0)
31 return false; // name mismatch
33 // a name-only note ACL matches any value; others require a values match
34 return values
->empty() ||
35 values
->match(entry
->value());
39 ACLNoteData::dump() const
43 sl
.splice(sl
.end(), values
->dump());
50 char* t
= ConfigParser::strtokFile();
57 ACLNoteData::empty() const
59 return name
.isEmpty();
62 ACLData
<NotePairs::Entry
*> *
63 ACLNoteData::clone() const
65 ACLNoteData
* result
= new ACLNoteData
;
66 result
->values
= dynamic_cast<ACLStringData
*>(values
->clone());
67 assert(result
->values
);