X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/89d88ac3ef3f82fdfeac6d8d231deddeeb0f02e9..6d979490c13e9d8004942507c99d152c22184a27:/ftparchive/writer.h diff --git a/ftparchive/writer.h b/ftparchive/writer.h index 76a3dfd1e..226996475 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -13,6 +13,7 @@ #ifndef WRITER_H #define WRITER_H +#include #include #include @@ -20,7 +21,10 @@ #include #include #include +#include +#include +#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; @@ -125,8 +126,10 @@ class PackagesWriter : public FTWScanner {return Over.ReadExtraOverride(File);}; virtual bool DoPackage(string FileName); - PackagesWriter(string const &DB,string const &Overrides,string const &ExtOverrides=string(), - string const &Arch=string()); + PackagesWriter(string const &DB, + string const &Overrides, + string const &ExtOverrides = "", + string const &Arch = ""); virtual ~PackagesWriter() {}; }; @@ -157,6 +160,7 @@ class ContentsWriter : public FTWScanner class SourcesWriter : public FTWScanner { + CacheDB Db; Override BOver; Override SOver; char *Buffer; @@ -165,16 +169,17 @@ class SourcesWriter : public FTWScanner public: bool NoOverride; + bool DoAlwaysStat; // General options string PathPrefix; string DirStrip; FILE *Output; - struct CacheDB::Stats Stats; + struct CacheDB::Stats &Stats; virtual bool DoPackage(string FileName); - SourcesWriter(string const &BOverrides,string const &SOverrides, + SourcesWriter(string const &DB,string const &BOverrides,string const &SOverrides, string const &ExtOverrides=string()); virtual ~SourcesWriter() {free(Buffer);}; }; @@ -191,17 +196,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 CheckSums; };