X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/113942be71c90e7d6a9cff93cc05ac119db526de..e9ecab0f97be19326c52f2afe04fd9b44eba01ae:/ftparchive/writer.h diff --git a/ftparchive/writer.h b/ftparchive/writer.h index af7ba4edd..ce0eab7af 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -19,8 +19,10 @@ #include #include #include +#include #include "cachedb.h" +#include "multicompress.h" #include "override.h" #include "apt-ftparchive.h" @@ -58,6 +60,9 @@ class FTWScanner } public: + bool DoMD5; + bool DoSHA1; + bool DoSHA256; unsigned long DeLinkLimit; string InternalPrefix; @@ -67,9 +72,30 @@ class FTWScanner bool LoadFileList(string const &BaseDir,string const &File); void ClearPatterns() { Patterns.clear(); }; void AddPattern(string const &Pattern) { Patterns.push_back(Pattern); }; + void AddPattern(char const *Pattern) { Patterns.push_back(Pattern); }; + void AddPatterns(std::vector const &patterns) { Patterns.insert(Patterns.end(), patterns.begin(), patterns.end()); }; bool SetExts(string const &Vals); FTWScanner(string const &Arch = string()); + virtual ~FTWScanner() {}; +}; + +class TranslationWriter +{ + MultiCompress *Comp; + FILE *Output; + std::set Included; + unsigned short RefCounter; + + public: + void IncreaseRefCounter() { ++RefCounter; }; + unsigned short DecreaseRefCounter() { return (RefCounter == 0) ? 0 : --RefCounter; }; + unsigned short GetRefCounter() const { return RefCounter; }; + bool DoPackage(string const &Pkg, string const &Desc, string const &MD5); + + TranslationWriter(string const &File, string const &TransCompress, mode_t const &Permissions); + TranslationWriter() : Comp(NULL), Output(NULL), RefCounter(0) {}; + ~TranslationWriter(); }; class PackagesWriter : public FTWScanner @@ -80,9 +106,6 @@ class PackagesWriter : public FTWScanner public: // Some flags - bool DoMD5; - bool DoSHA1; - bool DoSHA256; bool DoAlwaysStat; bool NoOverride; bool DoContents; @@ -93,6 +116,7 @@ class PackagesWriter : public FTWScanner string DirStrip; FILE *Output; struct CacheDB::Stats &Stats; + TranslationWriter *TransWriter; inline bool ReadOverride(string const &File) {return Over.ReadOverride(File);}; inline bool ReadExtraOverride(string const &File)