]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/StringData.cc
2 * Copyright (C) 1996-2015 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"
17 ACLStringData::ACLStringData()
20 ACLStringData::ACLStringData(ACLStringData
const &old
) : stringValues(old
.stringValues
)
24 ACLStringData::~ACLStringData()
29 ACLStringData::insert(const char *value
)
31 stringValues
.insert(SBuf(value
));
35 ACLStringData::match(char const *toFind
)
37 if (stringValues
.empty() || !toFind
)
41 debugs(28, 3, "aclMatchStringList: checking '" << tf
<< "'");
43 bool found
= (stringValues
.find(tf
) != stringValues
.end());
44 debugs(28, 3, "aclMatchStringList: '" << tf
<< "' " << (found
? "found" : "NOT found"));
50 ACLStringData::dump() const
53 sl
.insert(sl
.end(), stringValues
.begin(), stringValues
.end());
58 ACLStringData::parse()
61 while ((t
= strtokFile()))
62 stringValues
.insert(SBuf(t
));
66 ACLStringData::empty() const
68 return stringValues
.empty();
71 ACLData
<char const *> *
72 ACLStringData::clone() const
74 /* Splay trees don't clone yet. */
75 return new ACLStringData(*this);