]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/format/Format.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / format / Format.h
index 3c177569f1530147984a80ba90978fc65f01a7c1..4ae6e668db8cb0545b89df9bba3ef1fd0da698ca 100644 (file)
@@ -1,6 +1,17 @@
+/*
+ * 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.
@@ -14,6 +25,7 @@
  */
 
 class AccessLogEntry;
+typedef RefCount<AccessLogEntry> AccessLogEntryPointer;
 class MemBuf;
 class StoreEntry;
 
@@ -27,19 +39,19 @@ class Format
 {
 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;
@@ -49,3 +61,4 @@ public:
 } // namespace Format
 
 #endif /* _SQUID_FORMAT_FORMAT_H */
+