X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/34e8a998eb9e4f75f989acc6f8b9db8010e56b7c..a23a7811d04b3f3f7ce761d025b684b3cf82b25e:/ftparchive/writer.h diff --git a/ftparchive/writer.h b/ftparchive/writer.h index 520e91dd6..49d430c47 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,6 +36,7 @@ class FTWScanner { protected: vector Patterns; + string Arch; const char *OriginalPath; bool ErrorPrinted; @@ -68,7 +71,26 @@ class FTWScanner void AddPattern(string const &Pattern) { Patterns.push_back(Pattern); }; bool SetExts(string const &Vals); - FTWScanner(); + 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 @@ -92,7 +114,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) @@ -125,7 +147,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() {}; };