wordlist.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 "profiler/Profiler.h"
14 #include "sbuf/List.h"
15 
20 class wordlist
21 {
23  friend char *wordlistChopHead(wordlist **);
24 
25 public:
26  wordlist() : key(nullptr), next(nullptr) {}
27  // create a new wordlist node, with a copy of k as key
28  explicit wordlist(const char *k) : key(xstrdup(k)), next(nullptr) {}
29 
30  wordlist(const wordlist &) = delete;
31  wordlist &operator=(const wordlist &) = delete;
32 
33  char *key;
35 
36 private:
37  // does not free data members.
38  ~wordlist() = default;
39 };
40 
41 class MemBuf;
42 
47 const char *wordlistAdd(wordlist **, const char *);
48 
53 void wordlistCat(const wordlist *, MemBuf *);
54 
56 void wordlistDestroy(wordlist **);
57 
64 char *wordlistChopHead(wordlist **);
65 
68 
69 #endif /* SQUID_WORDLIST_H */
70 
void wordlistCat(const wordlist *, MemBuf *)
Definition: wordlist.cc:35
#define xstrdup
char * key
Definition: wordlist.h:33
wordlist()
Definition: wordlist.h:26
void wordlistDestroy(wordlist **)
destroy a wordlist
Definition: wordlist.cc:16
char * wordlistChopHead(wordlist **)
Definition: wordlist.cc:55
std::list< SBuf > SBufList
Definition: forward.h:26
wordlist & operator=(const wordlist &)=delete
wordlist(const char *k)
Definition: wordlist.h:28
SBufList ToSBufList(wordlist *)
convert a wordlist to a SBufList
Definition: wordlist.cc:44
const char * wordlistAdd(wordlist **, const char *)
Definition: wordlist.cc:25
Definition: MemBuf.h:23
friend char * wordlistChopHead(wordlist **)
Definition: wordlist.cc:55
MEMPROXY_CLASS(wordlist)
~wordlist()=default
wordlist * next
Definition: wordlist.h:34

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors