]> git.saurik.com Git - apt.git/blobdiff - ftparchive/writer.h
Merge remote-tracking branch 'upstream/debian/sid' into debian/experimental
[apt.git] / ftparchive / writer.h
index 4932b0cc8502f4a40f09262e7c986d127c6991ca..c62d4addf91793b1c6182820300db70f0332f1df 100644 (file)
@@ -13,6 +13,7 @@
 #ifndef WRITER_H
 #define WRITER_H
 
+#include <apt-pkg/hashes.h>
 
 #include <string>
 #include <stdio.h>
 #include <vector>
 #include <map>
 #include <set>
+#include <stdlib.h>
+#include <sys/types.h>
 
+#include "contents.h"
 #include "cachedb.h"
 #include "override.h"
 #include "apt-ftparchive.h"
@@ -59,10 +63,7 @@ class FTWScanner
    }
    
    public:
-   bool DoMD5;
-   bool DoSHA1;
-   bool DoSHA256;
-   bool DoSHA512;
+   unsigned int DoHashes;
 
    unsigned long DeLinkLimit;
    string InternalPrefix;
@@ -172,7 +173,7 @@ class SourcesWriter : public FTWScanner
    string PathPrefix;
    string DirStrip;
    FILE *Output;
-   struct CacheDB::Stats Stats;
+   struct CacheDB::Stats &Stats;
 
    virtual bool DoPackage(string FileName);
 
@@ -193,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;
 };