X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/3c54407f8783d5e27363eabf41dbc3d031526ffe..e110d7bf5675f484c06b82f621ac98bedc464865:/ftparchive/writer.h diff --git a/ftparchive/writer.h b/ftparchive/writer.h index ce0eab7af..c62d4addf 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -13,6 +13,7 @@ #ifndef WRITER_H #define WRITER_H +#include #include #include @@ -20,9 +21,11 @@ #include #include #include +#include +#include +#include "contents.h" #include "cachedb.h" -#include "multicompress.h" #include "override.h" #include "apt-ftparchive.h" @@ -31,7 +34,7 @@ using std::cout; using std::endl; using std::vector; using std::map; - + class FTWScanner { protected: @@ -48,7 +51,7 @@ class FTWScanner static int ScannerFile(const char *File, bool const &ReadLink); bool Delink(string &FileName,const char *OriginalPath, - unsigned long &Bytes,off_t const &FileSize); + unsigned long long &Bytes,unsigned long long const &FileSize); inline void NewLine(unsigned const &Priority) { @@ -60,9 +63,7 @@ class FTWScanner } public: - bool DoMD5; - bool DoSHA1; - bool DoSHA256; + unsigned int DoHashes; unsigned long DeLinkLimit; string InternalPrefix; @@ -80,6 +81,8 @@ class FTWScanner virtual ~FTWScanner() {}; }; +class MultiCompress; + class TranslationWriter { MultiCompress *Comp; @@ -155,24 +158,26 @@ class ContentsWriter : public FTWScanner class SourcesWriter : public FTWScanner { + CacheDB Db; Override BOver; Override SOver; char *Buffer; - unsigned long BufSize; + unsigned long long BufSize; 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);}; }; @@ -189,16 +194,14 @@ public: string PathPrefix; string DirStrip; -protected: struct CheckSum { - string MD5; - string SHA1; - string SHA256; + HashStringList Hashes; // Limited by FileFd::Size() - unsigned long size; + unsigned long long size; ~CheckSum() {}; }; +protected: map CheckSums; };