const char *aContentType,
const char *aContentEncoding, const char *aTransferMode,
bool optionViewEnable, bool optionDownloadEnable,
- const char *anIconName) :
- pattern(xstrdup(aPattern)),
- compiled_pattern(compiledPattern),
- content_type(xstrdup(aContentType)),
- content_encoding(xstrdup(aContentEncoding)),
- view_option(optionViewEnable),
- download_option(optionViewEnable),
- next(NULL), theIcon(anIconName)
- {
- if (!strcasecmp(aTransferMode, "ascii"))
- transfer_mode = 'A';
- else if (!strcasecmp(aTransferMode, "text"))
- transfer_mode = 'A';
- else
- transfer_mode = 'I';
- }
+ const char *anIconName);
~MimeEntry();
const char *pattern;
url = xstrdup(internalLocalUri("/squid-internal-static/icons/", icon));
}
-MimeIcon::~MimeIcon ()
+MimeIcon::~MimeIcon()
{
safe_free (icon);
safe_free (url);
}
void
-MimeIcon::setName (char const *aString)
+MimeIcon::setName(char const *aString)
{
safe_free (icon);
safe_free (url);
}
char const *
-MimeIcon::getName () const
+MimeIcon::getName() const
{
return icon;
}
safe_free(content_encoding);
regfree(&compiled_pattern);
}
+
+MimeEntry::MimeEntry(const char *aPattern, const regex_t &compiledPattern,
+ const char *aContentType, const char *aContentEncoding,
+ const char *aTransferMode, bool optionViewEnable,
+ bool optionDownloadEnable, const char *anIconName) :
+ pattern(xstrdup(aPattern)),
+ compiled_pattern(compiledPattern),
+ content_type(xstrdup(aContentType)),
+ content_encoding(xstrdup(aContentEncoding)),
+ view_option(optionViewEnable),
+ download_option(optionViewEnable),
+ next(NULL), theIcon(anIconName)
+{
+ if (!strcasecmp(aTransferMode, "ascii"))
+ transfer_mode = 'A';
+ else if (!strcasecmp(aTransferMode, "text"))
+ transfer_mode = 'A';
+ else
+ transfer_mode = 'I';
+}