NoteData.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#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
20{}
21
23{
24 delete values;
25}
26
27bool
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
40{
41 SBufList sl;
42 sl.push_back(name);
43 sl.splice(sl.end(), values->dump());
44 return sl;
45}
46
47void
49{
50 Acl::SetKey(name, "annotation name", ConfigParser::strtokFile());
51 values->parse();
52}
53
54bool
56{
57 return name.isEmpty();
58}
59
void parse() override
Definition: NoteData.cc:48
ACLStringData * values
if set, at least one value must match
Definition: NoteData.h:33
bool empty() const override
Definition: NoteData.cc:55
~ACLNoteData() override
Definition: NoteData.cc:22
bool match(NotePairs::Entry *) override
Definition: NoteData.cc:28
SBuf name
Note name to check. It is always set.
Definition: NoteData.h:32
SBufList dump() const override
Definition: NoteData.cc:39
bool match(char const *) override
Definition: StringData.cc:39
bool empty() const override
Definition: StringData.cc:60
void parse() override
Definition: StringData.cc:53
SBufList dump() const override
Definition: StringData.cc:45
static char * strtokFile()
Definition: ConfigParser.cc:65
Used to store a note key/value pair.
Definition: Notes.h:179
const SBuf & value() const
Definition: Notes.h:192
const SBuf & name() const
Definition: Notes.h:191
int cmp(const SBuf &S, const size_type n) const
shorthand version for compare()
Definition: SBuf.h:275
bool isEmpty() const
Definition: SBuf.h:431
void SetKey(SBuf &keyStorage, const char *keyParameterName, const char *newKey)
Definition: Acl.cc:79
std::list< SBuf > SBufList
Definition: forward.h:23

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors