ConfigParser.cc
Go to the documentation of this file.
299 debugs(3, DBG_CRITICAL, "FATAL: Not alphanumeric character '"<< *s << "' in unquoted token " << tokenStart);
373 debugs(3, DBG_CRITICAL, "FATAL: can't open %s for reading parameters: includes are nested too deeply (>16)!\n" << path);
461 debugs(3, DBG_CRITICAL, "ERROR: Failure while parsing key=value token. Value missing after: " << key);
472 debugs(3, DBG_CRITICAL, "FATAL: Can not read regex expression while configuration_includes_quoted_values is enabled");
485 throw TextException("Cannot read regex expression while configuration_includes_quoted_values is enabled", Here());
552 throw TextException(ToSBuf("trailing garbage at the end of a configuration directive: ", garbage), Here());
size_t aclParseAclList(ConfigParser &, Acl::Tree **treep, const char *label)
Definition: Gadgets.cc:191
const char * cfg_directive
During parsing, the name of the current squid.conf directive being parsed.
Definition: cache_cf.cc:270
Definition: ConfigParser.h:164
char * nextElement(TokenType &type)
Definition: ConfigParser.cc:647
bool optionalKvPair(char *&key, char *&value)
Definition: ConfigParser.cc:421
static const char * CfgPos
Pointer to the next element in cfgLine string.
Definition: ConfigParser.h:221
static bool RecognizeQuotedPair_
The next tokens may contain quoted-pair (-escaped) characters.
Definition: ConfigParser.h:225
void rejectDuplicateDirective()
rejects configuration due to a repeated directive
Definition: ConfigParser.cc:541
static enum ConfigParser::ParsingStates KvPairState_
Parsing state while parsing kv-pair tokens.
Definition: ConfigParser.cc:30
std::unique_ptr< RegexPattern > regex(const char *expectedRegexDescription)
extracts and returns a regex (including any optional flags)
Definition: ConfigParser.cc:482
static std::queue< char * > CfgLineTokens_
Store the list of tokens for current configuration line.
Definition: ConfigParser.h:222
static bool ParseKvPair_
The next token will be handled as kv-pair token.
Definition: ConfigParser.h:227
static char * NextElement(TokenType &type)
Wrapper method for TokenParse.
Definition: ConfigParser.cc:317
static bool RecognizeQuotedValues
configuration_includes_quoted_values in squid.conf
Definition: ConfigParser.h:148
static bool ParseQuotedOrToEol_
The next tokens will be handled as quoted or to_eol token.
Definition: ConfigParser.h:224
bool skipOptional(const char *keyword)
either extracts the given (optional) token or returns false
Definition: ConfigParser.cc:567
void closeDirective()
stops parsing the current configuration directive
Definition: ConfigParser.cc:548
static char * UnQuote(const char *token, const char **next=nullptr)
Definition: ConfigParser.cc:138
static bool PreviewMode_
The next token will not popped from cfg files, will just previewd.
Definition: ConfigParser.h:226
static bool NextKvPair(char *&key, char *&value)
Definition: ConfigParser.cc:447
static void SetCfgLine(char *line)
Set the configuration file line to parse.
Definition: ConfigParser.cc:203
SBuf token(const char *expectedTokenDescription)
extracts and returns a required token
Definition: ConfigParser.cc:557
static const char * QuoteString(const String &var)
Definition: ConfigParser.cc:517
static char * TokenParse(const char *&nextToken, TokenType &type)
Definition: ConfigParser.cc:221
Definition: RegexPattern.h:21
Definition: SquidString.h:26
SBuf ToSBuf(Args &&... args)
slowly stream-prints all arguments into a freshly allocated SBuf
Definition: Stream.h:63