#ifndef WRITER_H
#define WRITER_H
+#include <apt-pkg/hashes.h>
#include <string>
#include <stdio.h>
#include <vector>
#include <map>
#include <set>
+#include <stdlib.h>
+#include <sys/types.h>
+#include "contents.h"
#include "cachedb.h"
#include "override.h"
#include "apt-ftparchive.h"
}
public:
- bool DoMD5;
- bool DoSHA1;
- bool DoSHA256;
- bool DoSHA512;
+ unsigned int DoHashes;
unsigned long DeLinkLimit;
string InternalPrefix;
class SourcesWriter : public FTWScanner
{
+ CacheDB Db;
Override BOver;
Override SOver;
char *Buffer;
public:
bool NoOverride;
+ bool DoAlwaysStat;
// General options
string PathPrefix;
string DirStrip;
FILE *Output;
- struct CacheDB::Stats Stats;
+ struct CacheDB::Stats &Stats;
virtual bool DoPackage(string FileName);
- SourcesWriter(string const &BOverrides,string const &SOverrides,
+ SourcesWriter(string const &DB,string const &BOverrides,string const &SOverrides,
string const &ExtOverrides=string());
virtual ~SourcesWriter() {free(Buffer);};
};
string PathPrefix;
string DirStrip;
-protected:
struct CheckSum
{
- string MD5;
- string SHA1;
- string SHA256;
- string SHA512;
+ HashStringList Hashes;
// Limited by FileFd::Size()
unsigned long long size;
~CheckSum() {};
};
+protected:
map<string,struct CheckSum> CheckSums;
};