]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/format/Format.h
2 * Copyright (C) 1996-2015 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"
16 * Squid configuration allows users to define custom formats in
19 * - external ACL input
22 * These enumerations and classes define the API for parsing of
23 * format directives to define these patterns. Along with output
24 * functionality to produce formatted buffers.
28 typedef RefCount
<AccessLogEntry
> AccessLogEntryPointer
;
37 // XXX: inherit from linked list
41 Format(const char *name
);
44 /* very inefficent parser, but who cares, this needs to be simple */
45 /* First off, let's tokenize, we'll optimize in a second pass.
46 * A token can either be a %-prefixed sequence (usually a dynamic
47 * token but it can be an escaped sequence), or a string. */
48 bool parse(const char *def
);
50 /// assemble the state information into a formatted line.
51 void assemble(MemBuf
&mb
, const AccessLogEntryPointer
&al
, int logSequenceNumber
) const;
53 /// dump this whole list of formats into the provided StoreEntry
54 void dump(StoreEntry
* entry
, const char *directiveName
);
63 #endif /* _SQUID_FORMAT_FORMAT_H */