diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2011-07-13 16:37:15 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2011-07-13 16:37:15 +0200 |
commit | c31c1dded85ee1e88231a041aac7e507f2ed426c (patch) | |
tree | bcd28c9d5631d392af9c636814fd80f99a1455dc /apt-pkg/contrib/hashsum_template.h | |
parent | dd5e47ff5069e3859bd76d5fc8f6887121710556 (diff) |
move implementation of checksums around by abstracting even more
Diffstat (limited to 'apt-pkg/contrib/hashsum_template.h')
-rw-r--r-- | apt-pkg/contrib/hashsum_template.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apt-pkg/contrib/hashsum_template.h b/apt-pkg/contrib/hashsum_template.h index 7667baf92..2847f3308 100644 --- a/apt-pkg/contrib/hashsum_template.h +++ b/apt-pkg/contrib/hashsum_template.h @@ -84,4 +84,24 @@ class HashSumValue } }; +class SummationImplementation +{ + public: + virtual bool Add(const unsigned char *inbuf, unsigned long inlen) = 0; + inline bool Add(const char *inbuf, unsigned long const inlen) + { return Add((unsigned char *)inbuf, inlen); }; + + inline bool Add(const unsigned char *Data) + { return Add(Data, strlen((const char *)Data)); }; + inline bool Add(const char *Data) + { return Add((const unsigned char *)Data, strlen((const char *)Data)); }; + + inline bool Add(const unsigned char *Beg, const unsigned char *End) + { return Add(Beg, End - Beg); }; + inline bool Add(const char *Beg, const char *End) + { return Add((const unsigned char *)Beg, End - Beg); }; + + bool AddFD(int Fd, unsigned long Size); +}; + #endif |