diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-16 22:17:23 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-16 22:17:23 +0100 |
commit | e70c1d067335bfa686fa0c6e75e32afb095e1aaa (patch) | |
tree | e985e74ed4d613126b24839d710e4b49db753824 /apt-pkg/contrib/hashes.h | |
parent | e75aa33384d52635fba502bed628bc68f9cb5066 (diff) | |
parent | 85e1885525977809ff6a3b70abb84d3a63e41817 (diff) |
merged from debian-experimental2
Diffstat (limited to 'apt-pkg/contrib/hashes.h')
-rw-r--r-- | apt-pkg/contrib/hashes.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index 81851dede..0c0b6c6a7 100644 --- a/apt-pkg/contrib/hashes.h +++ b/apt-pkg/contrib/hashes.h @@ -17,11 +17,18 @@ #include <apt-pkg/md5.h> #include <apt-pkg/sha1.h> #include <apt-pkg/sha2.h> +#include <apt-pkg/fileutl.h> #include <algorithm> #include <vector> #include <cstring> + +#ifndef APT_8_CLEANER_HEADERS +using std::min; +using std::vector; +#endif + // helper class that contains hash function name // and hash class HashString @@ -68,6 +75,10 @@ class Hashes { return AddFD(Fd, Size, true, true, true, true); }; bool AddFD(int const Fd, unsigned long long Size, bool const addMD5, bool const addSHA1, bool const addSHA256, bool const addSHA512); + inline bool AddFD(FileFd &Fd,unsigned long long Size = 0) + { return AddFD(Fd, Size, true, true, true, true); }; + bool AddFD(FileFd &Fd, unsigned long long Size, bool const addMD5, + bool const addSHA1, bool const addSHA256, bool const addSHA512); inline bool Add(const unsigned char *Beg,const unsigned char *End) {return Add(Beg,End-Beg);}; }; |