StringData.cc
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/* DEBUG: section 28 Access Control */
10
11#include "squid.h"
12#include "acl/Checklist.h"
13#include "acl/StringData.h"
14#include "ConfigParser.h"
15#include "debug/Stream.h"
16
17void
18ACLStringData::insert(const char *value)
19{
20 stringValues.insert(SBuf(value));
21}
22
23bool
25{
26 if (stringValues.empty() || tf.isEmpty())
27 return 0;
28
29 debugs(28, 3, "aclMatchStringList: checking '" << tf << "'");
30
31 bool found = (stringValues.find(tf) != stringValues.end());
32 debugs(28, 3, "aclMatchStringList: '" << tf << "' " << (found ? "found" : "NOT found"));
33
34 return found;
35}
36
37// XXX: performance regression due to SBuf(char*) data-copies.
38bool
39ACLStringData::match(char const *toFind)
40{
41 return match(SBuf(toFind));
42}
43
46{
47 SBufList sl;
48 sl.insert(sl.end(), stringValues.begin(), stringValues.end());
49 return sl;
50}
51
52void
54{
55 while (const char *t = ConfigParser::strtokFile())
56 stringValues.insert(SBuf(t));
57}
58
59bool
61{
62 return stringValues.empty();
63}
64
bool match(char const *) override
Definition: StringData.cc:39
void insert(const char *)
Insert a string data value.
Definition: StringData.cc:18
bool empty() const override
Definition: StringData.cc:60
StringValues_t stringValues
Definition: StringData.h:37
void parse() override
Definition: StringData.cc:53
SBufList dump() const override
Definition: StringData.cc:45
static char * strtokFile()
Definition: ConfigParser.cc:65
Definition: SBuf.h:94
bool isEmpty() const
Definition: SBuf.h:431
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Stream.h:194
std::list< SBuf > SBufList
Definition: forward.h:23

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors