wordlist.h
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#ifndef SQUID_WORDLIST_H
10#define SQUID_WORDLIST_H
11
12#include "globals.h"
13#include "sbuf/List.h"
14
20{
22 friend char *wordlistChopHead(wordlist **);
23
24public:
25 wordlist() : key(nullptr), next(nullptr) {}
26 // create a new wordlist node, with a copy of k as key
27 explicit wordlist(const char *k) : key(xstrdup(k)), next(nullptr) {}
28
29 wordlist(const wordlist &) = delete;
30 wordlist &operator=(const wordlist &) = delete;
31
32 char *key;
34
35private:
36 // does not free data members.
37 ~wordlist() = default;
38};
39
40class MemBuf;
41
46const char *wordlistAdd(wordlist **, const char *);
47
52void wordlistCat(const wordlist *, MemBuf *);
53
56
64
67
68#endif /* SQUID_WORDLIST_H */
69
Definition: MemBuf.h:24
MEMPROXY_CLASS(wordlist)
wordlist(const char *k)
Definition: wordlist.h:27
wordlist()
Definition: wordlist.h:25
char * key
Definition: wordlist.h:32
~wordlist()=default
wordlist & operator=(const wordlist &)=delete
friend char * wordlistChopHead(wordlist **)
Definition: wordlist.cc:55
wordlist * next
Definition: wordlist.h:33
wordlist(const wordlist &)=delete
#define xstrdup
std::list< SBuf > SBufList
Definition: forward.h:23
void wordlistDestroy(wordlist **)
destroy a wordlist
Definition: wordlist.cc:16
void wordlistCat(const wordlist *, MemBuf *)
Definition: wordlist.cc:35
SBufList ToSBufList(wordlist *)
convert a wordlist to a SBufList
Definition: wordlist.cc:44
const char * wordlistAdd(wordlist **, const char *)
Definition: wordlist.cc:25
char * wordlistChopHead(wordlist **)
Definition: wordlist.cc:55

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors