]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/format/Config.cc
2 * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
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.
11 #include "ConfigParser.h"
13 #include "format/Config.h"
16 Format::FmtConfig
Format::TheConfig
;
19 Format::FmtConfig::parseFormats()
23 if ((name
= ConfigParser::NextToken()) == nullptr) {
28 if ((def
= ConfigParser::NextQuotedOrToEol()) == nullptr) {
33 debugs(3, 2, "Custom Format for '" << name
<< "' is '" << def
<< "'");
35 Format
*nlf
= new Format(name
);
37 if (!nlf
->parse(def
)) {
42 // add to global config list
48 Format::FmtConfig::registerTokens(const SBuf
&nsName
, TokenTableEntry
const *tokenArray
)
50 debugs(46, 2, "register format tokens for '" << nsName
<< "'");
52 tokens
.emplace_back(TokenNamespace(nsName
, tokenArray
));
54 debugs(0, DBG_CRITICAL
, "BUG: format tokens for '" << nsName
<< "' missing!");