X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/cda675393c357aeeb7617652f5fe3c77d803229a..e7aea3985734af1702fde6e2b0af90b992425334:/ftparchive/writer.h diff --git a/ftparchive/writer.h b/ftparchive/writer.h index af7ba4edd..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" @@ -72,6 +74,24 @@ class FTWScanner 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 { Override Over; @@ -93,6 +113,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)