summaryrefslogtreecommitdiff
path: root/ftparchive/writer.h
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-03-22 18:25:37 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-03-22 18:25:37 +0100
commit66905344357d03c206d99964a0d941b261f7146c (patch)
tree220c9794810f30c63170017b6362d3713b431cc1 /ftparchive/writer.h
parent6bc703c22970055d9e1a1b4e3e0efe74f4cefda5 (diff)
* ftparchive/writer.cc:
- write LongDescriptions if they shouldn't be included in Packages file into i18n/Translation-en by default. It is ensured that each package+description is listed only ones in the Translation file even if we generate multiple Packages file in one run. The file is only generated in "generate" - the simple file commands can't create it by now. Also, the LongDescription is currently a global setting, so generating archives with and without LongDescriptions in the Packages file in the same run are currently not possible.
Diffstat (limited to 'ftparchive/writer.h')
-rw-r--r--ftparchive/writer.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/ftparchive/writer.h b/ftparchive/writer.h
index af7ba4edd..2afd1af1f 100644
--- a/ftparchive/writer.h
+++ b/ftparchive/writer.h
@@ -19,6 +19,7 @@
#include <iostream>
#include <vector>
#include <map>
+#include <set>
#include "cachedb.h"
#include "override.h"
@@ -72,6 +73,23 @@ class FTWScanner
FTWScanner(string const &Arch = string());
};
+class TranslationWriter
+{
+ 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);
+ TranslationWriter() : Output(NULL), RefCounter(0) {};
+ ~TranslationWriter();
+};
+
class PackagesWriter : public FTWScanner
{
Override Over;
@@ -93,6 +111,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)