X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/f45fd56b58a71f2827eb8b4f96333782d84b7b63..e7aea3985734af1702fde6e2b0af90b992425334:/ftparchive/writer.h?ds=sidebyside diff --git a/ftparchive/writer.h b/ftparchive/writer.h index ad58dee0a..3123a7f46 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" @@ -34,8 +36,8 @@ class FTWScanner { protected: vector Patterns; + string Arch; const char *OriginalPath; - char *RealPath; bool ErrorPrinted; // Stuff for the delinker @@ -69,8 +71,25 @@ class FTWScanner void AddPattern(string const &Pattern) { Patterns.push_back(Pattern); }; bool SetExts(string const &Vals); - FTWScanner(); - virtual ~FTWScanner() {delete [] RealPath;}; + FTWScanner(string const &Arch = string()); +}; + +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 @@ -94,7 +113,7 @@ class PackagesWriter : public FTWScanner string DirStrip; FILE *Output; struct CacheDB::Stats &Stats; - string Arch; + TranslationWriter *TransWriter; inline bool ReadOverride(string const &File) {return Over.ReadOverride(File);}; inline bool ReadExtraOverride(string const &File) @@ -127,7 +146,7 @@ class ContentsWriter : public FTWScanner void Finish() {Gen.Print(Output);}; inline bool ReadyDB(string const &DB) {return Db.ReadyDB(DB);}; - ContentsWriter(string const &DB); + ContentsWriter(string const &DB, string const &Arch = string()); virtual ~ContentsWriter() {}; };