wordlist.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2021 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 
19 class wordlist
20 {
22  friend char *wordlistChopHead(wordlist **);
23 
24 public:
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 
35 private:
36  // does not free data members.
37  ~wordlist() = default;
38 };
39 
40 class MemBuf;
41 
46 const char *wordlistAdd(wordlist **, const char *);
47 
52 void wordlistCat(const wordlist *, MemBuf *);
53 
55 void wordlistDestroy(wordlist **);
56 
63 char *wordlistChopHead(wordlist **);
64 
67 
68 #endif /* SQUID_WORDLIST_H */
69 
friend char * wordlistChopHead(wordlist **)
Definition: wordlist.cc:55
std::list< SBuf > SBufList
Definition: forward.h:22
wordlist(const wordlist &)=delete
#define xstrdup
void wordlistCat(const wordlist *, MemBuf *)
Definition: wordlist.cc:35
wordlist()
Definition: wordlist.h:25
wordlist & operator=(const wordlist &)=delete
Definition: MemBuf.h:24
void wordlistDestroy(wordlist **)
destroy a wordlist
Definition: wordlist.cc:16
~wordlist()=default
wordlist(const char *k)
Definition: wordlist.h:27
wordlist * next
Definition: wordlist.h:33
char * key
Definition: wordlist.h:32
char * wordlistChopHead(wordlist **)
Definition: wordlist.cc:55
MEMPROXY_CLASS(wordlist)
const char * wordlistAdd(wordlist **, const char *)
Definition: wordlist.cc:25
SBufList ToSBufList(wordlist *)
convert a wordlist to a SBufList
Definition: wordlist.cc:44

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors