diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-04-27 18:23:20 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-05-09 13:06:27 +0200 |
commit | a311fb96b84757ef8628e6a754232614a53b7891 (patch) | |
tree | 1d76304ca36064edf4e33a27c2af0b3456d3505d /ftparchive/writer.h | |
parent | b3501edb7091ca3aa6c2d6d96dc667b8161dd2b9 (diff) |
deal with hashes in ftparchive more dynamic as well
Now that libapts acquire system happily passes around hashes and can be
made to support new ones without an ABI break in the future, we can
free ftparchive from all the deprecation warnings the last commit
introduced for it.
The goal here isn't to preserve ABI as we have none to keep here, but to
help avoiding introduction problems of 'new' hashes later as bugs creep
into the copy&paste parts, so short/less of them is good.
Diffstat (limited to 'ftparchive/writer.h')
-rw-r--r-- | ftparchive/writer.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/ftparchive/writer.h b/ftparchive/writer.h index b1a653e7d..c62d4addf 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -13,6 +13,8 @@ #ifndef WRITER_H #define WRITER_H +#include <apt-pkg/hashes.h> + #include <string> #include <stdio.h> #include <iostream> @@ -61,10 +63,7 @@ class FTWScanner } public: - bool DoMD5; - bool DoSHA1; - bool DoSHA256; - bool DoSHA512; + unsigned int DoHashes; unsigned long DeLinkLimit; string InternalPrefix; @@ -195,17 +194,14 @@ public: string PathPrefix; string DirStrip; -protected: struct CheckSum { - string MD5; - string SHA1; - string SHA256; - string SHA512; + HashStringList Hashes; // Limited by FileFd::Size() unsigned long long size; ~CheckSum() {}; }; +protected: map<string,struct CheckSum> CheckSums; }; |