Config.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_SRC_FORMAT_CONFIG_H
10 #define SQUID_SRC_FORMAT_CONFIG_H
11 
12 #include "sbuf/SBuf.h"
13 
14 #include <list>
15 
16 namespace Format
17 {
18 
19 class TokenTableEntry;
20 
25 {
26 public:
27  TokenNamespace(const SBuf &nsName, TokenTableEntry const *tSet) : prefix(nsName), tokenSet(tSet) {}
28 
31 
35 };
36 
38 class FmtConfig
39 {
40 public:
41  /* Register a namespace set of tokens to be accepted by the format parser.
42  * Multiple arrays can be registered, they will be scanned for
43  * in order registered. So care needs to be taken that arrays registered
44  * first do not overlap or consume tokens registered later for a namespace.
45  */
46  void registerTokens(const SBuf &nsName, TokenTableEntry const *tokenArray);
47 
49  std::list<TokenNamespace> tokens;
50 };
51 
52 extern FmtConfig TheConfig;
53 
54 } // namespace Format
55 
56 #endif /* SQUID_SRC_FORMAT_CONFIG_H */
57 
Definition: SBuf.h:93
One entry in a table of format tokens.
SBuf prefix
prefix namespace name (excluding '::')
Definition: Config.h:30
const TokenTableEntry * tokenSet
Definition: Config.h:34
FmtConfig TheConfig
Definition: Config.cc:14
TokenNamespace(const SBuf &nsName, TokenTableEntry const *tSet)
Definition: Config.h:27
std::list< TokenNamespace > tokens
list of token namespaces registered
Definition: Config.h:49
The set of custom formats defined in squid.conf.
Definition: Config.h:38
void registerTokens(const SBuf &nsName, TokenTableEntry const *tokenArray)
Definition: Config.cc:17

 

Introduction

Documentation

Support

Miscellaneous