summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/hashsum_template.h
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-07-15 09:42:37 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-07-15 09:42:37 +0200
commit35555c1826da5df9f2c06a74f2e91be843ad8142 (patch)
tree9127cb9461a2de987748600c08682f7051ba12b7 /apt-pkg/contrib/hashsum_template.h
parentcec8c646c79e40d928464b08a6f2e3ea62bb1611 (diff)
parent4b42f43bed369817398b6c8d538f08e5bf6dff76 (diff)
merged from donkult
Diffstat (limited to 'apt-pkg/contrib/hashsum_template.h')
-rw-r--r--apt-pkg/contrib/hashsum_template.h20
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..85d94c2af 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 = 0);
+};
+
#endif