+/*
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
#ifndef _SQUID_FORMAT_FORMAT_H
#define _SQUID_FORMAT_FORMAT_H
+#include "base/RefCount.h"
+#include "ConfigParser.h"
+
/*
* Squid configuration allows users to define custom formats in
* several components.
*/
class AccessLogEntry;
+typedef RefCount<AccessLogEntry> AccessLogEntryPointer;
class MemBuf;
class StoreEntry;
{
public:
Format(const char *name);
- ~Format();
+ virtual ~Format();
/* very inefficent parser, but who cares, this needs to be simple */
/* First off, let's tokenize, we'll optimize in a second pass.
* A token can either be a %-prefixed sequence (usually a dynamic
* token but it can be an escaped sequence), or a string. */
- bool parse(char *def);
+ bool parse(const char *def);
/// assemble the state information into a formatted line.
- void assemble(MemBuf &mb, AccessLogEntry *al, int logSequenceNumber) const;
+ void assemble(MemBuf &mb, const AccessLogEntryPointer &al, int logSequenceNumber) const;
/// dump this whole list of formats into the provided StoreEntry
- void dump(StoreEntry * entry, const char *name);
+ void dump(StoreEntry * entry, const char *directiveName);
char *name;
Token *format;
} // namespace Format
#endif /* _SQUID_FORMAT_FORMAT_H */
+