]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/format/Format.h
08249ecc9d720443ebc472b75d22600ca48cd4e3
2 * Copyright (C) 1996-2016 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.
9 #ifndef _SQUID_FORMAT_FORMAT_H
10 #define _SQUID_FORMAT_FORMAT_H
12 #include "base/RefCount.h"
13 #include "ConfigParser.h"
14 #include "sbuf/SBuf.h"
17 * Squid configuration allows users to define custom formats in
20 * - external ACL input
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.
29 typedef RefCount
<AccessLogEntry
> AccessLogEntryPointer
;
36 extern const SBuf Dash
;
40 // XXX: inherit from linked list
44 Format(const char *name
);
47 /* very inefficent 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
);
53 /// assemble the state information into a formatted line.
54 void assemble(MemBuf
&mb
, const AccessLogEntryPointer
&al
, int logSequenceNumber
) const;
56 /// dump this whole list of formats into the provided StoreEntry
57 void dump(StoreEntry
* entry
, const char *directiveName
, bool eol
= true) const;
66 #endif /* _SQUID_FORMAT_FORMAT_H */