Squid Web Cache
master
Loading...
Searching...
No Matches
Format.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2025 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_FORMAT_H
10
#define SQUID_SRC_FORMAT_FORMAT_H
11
12
#include "
base/RefCount.h
"
13
#include "
ConfigParser.h
"
14
#include "
sbuf/SBuf.h
"
15
16
/*
17
* Squid configuration allows users to define custom formats in
18
* several components.
19
* - logging
20
* - external ACL input
21
* - deny page URL
22
*
23
* These enumerations and classes define the API for parsing of
24
* format directives to define these patterns. Along with output
25
* functionality to produce formatted buffers.
26
*/
27
28
class
AccessLogEntry
;
29
typedef
RefCount<AccessLogEntry>
AccessLogEntryPointer
;
30
class
MemBuf
;
31
class
StoreEntry
;
32
33
namespace
Format
34
{
35
36
extern
const
SBuf
Dash
;
37
38
class
Token;
39
40
// XXX: inherit from linked list
41
class
Format
42
{
43
public
:
44
Format
(
const
char
*name);
45
virtual
~Format
();
46
47
/* very inefficient parser, but who cares, this needs to be simple */
48
/* First off, let's tokenize, we'll optimize in a second pass.
49
* A token can either be a %-prefixed sequence (usually a dynamic
50
* token but it can be an escaped sequence), or a string. */
51
bool
parse
(
const
char
*def);
52
54
void
assemble(
MemBuf
&mb,
const
AccessLogEntryPointer
&al,
int
logSequenceNumber)
const
;
55
57
void
dump(
StoreEntry
* entry,
const
char
*directiveName,
bool
eol =
true
)
const
;
58
59
char
*
name
;
60
Token
*
format
;
61
Format
*
next
;
62
};
63
68
size_t
AssembleOne
(
const
char
*start,
MemBuf
&buf,
const
AccessLogEntryPointer
&ale);
69
70
}
// namespace Format
71
72
#endif
/* SQUID_SRC_FORMAT_FORMAT_H */
73
ConfigParser.h
AccessLogEntryPointer
RefCount< AccessLogEntry > AccessLogEntryPointer
Definition
Format.h:29
RefCount.h
SBuf.h
AccessLogEntry
Definition
AccessLogEntry.h:41
Format::Format::name
char * name
Definition
Format.h:59
Format::Format::next
Format * next
Definition
Format.h:61
Format::Format::format
Token * format
Definition
Format.h:60
Format::Token
Definition
Token.h:36
MemBuf
Definition
MemBuf.h:24
RefCount
Definition
RefCount.h:28
SBuf
Definition
SBuf.h:94
StoreEntry
Definition
Store.h:38
Format
Definition
SchemeConfig.h:28
Format::Dash
const SBuf Dash
Format::AssembleOne
size_t AssembleOne(const char *start, MemBuf &buf, const AccessLogEntryPointer &ale)
Definition
Format.cc:99
parse
static struct node * parse(FILE *fp)
Definition
parse.c:965
squid
src
format
Format.h
Generated by
1.9.8