#include <iostream>
#include <vector>
#include <map>
+#include <set>
#include "cachedb.h"
+#include "multicompress.h"
#include "override.h"
#include "apt-ftparchive.h"
{
protected:
vector<string> Patterns;
+ string Arch;
const char *OriginalPath;
- char *RealPath;
bool ErrorPrinted;
// Stuff for the delinker
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<string> 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
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)
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() {};
};