+/// Used to store last timestamp of file and whether it is (was) zipped
+struct ZippedInfo {
+ bool zipped;
+ std::time_t timestamp;
+ ZippedInfo(bool zipped, std::time_t timestamp)
+ : zipped(zipped), timestamp(timestamp) { }
+};
+
+
+/// Mapping absolute pathnames of files to their ZippedInfo metadata.
+static std::map<std::string, ZippedInfo> zipped_;
+
+
+bool Formats::isZippedFile(support::FileName const & filename) const {
+ string const & fname = filename.absFileName();
+ time_t timestamp = filename.lastModified();
+ map<string, ZippedInfo>::iterator it = zipped_.find(fname);
+ if (it != zipped_.end() && it->second.timestamp == timestamp)
+ return it->second.zipped;
+ string const & format = getFormatFromFile(filename);
+ bool zipped = (format == "gzip" || format == "zip");
+ zipped_.insert(pair<string, ZippedInfo>(fname, ZippedInfo(zipped, timestamp)));
+ return zipped;
+}
+
+