]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/StringData.cc
834c6096f9ca08959b04bc6f3aa2056a9e6a4bc5
2 * Copyright (C) 1996-2025 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.
9 /* DEBUG: section 28 Access Control */
12 #include "acl/Checklist.h"
13 #include "acl/StringData.h"
14 #include "ConfigParser.h"
15 #include "debug/Stream.h"
18 ACLStringData::insert(const char *value
)
20 stringValues
.insert(SBuf(value
));
24 ACLStringData::match(const SBuf
&tf
)
26 if (stringValues
.empty())
29 debugs(28, 3, "aclMatchStringList: checking '" << tf
<< "'");
31 bool found
= (stringValues
.find(tf
) != stringValues
.end());
32 debugs(28, 3, "aclMatchStringList: '" << tf
<< "' " << (found
? "found" : "NOT found"));
37 // XXX: performance regression due to SBuf(char*) data-copies.
39 ACLStringData::match(char const *toFind
)
42 // TODO: Check whether we can Assure(toFind) instead.
43 debugs(28, 3, "not matching a nil c-string");
46 return match(SBuf(toFind
));
50 ACLStringData::dump() const
53 sl
.insert(sl
.end(), stringValues
.begin(), stringValues
.end());
58 ACLStringData::parse()
60 while (const char *t
= ConfigParser::strtokFile())
61 stringValues
.insert(SBuf(t
));
65 ACLStringData::empty() const
67 return stringValues
.empty();