silence gcc/g++ warnings on libc/stdc++ version tests
[ntk/apt.git] / apt-pkg / contrib / hashes.h
CommitLineData
63b1700f
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3// $Id: hashes.h,v 1.1 2001/03/06 07:15:29 jgg Exp $
4/* ######################################################################
5
6 Hashes - Simple wrapper around the hash functions
7
8 This is just used to make building the methods simpler, this is the
9 only interface required..
10
11 ##################################################################### */
12 /*}}}*/
13#ifndef APTPKG_HASHES_H
14#define APTPKG_HASHES_H
15
16#ifdef __GNUG__
17#pragma interface "apt-pkg/hashesh.h"
18#endif
19
20#include <apt-pkg/md5.h>
21#include <apt-pkg/sha1.h>
22
23class Hashes
24{
25 public:
26
27 MD5Summation MD5;
28 SHA1Summation SHA1;
29
30 inline bool Add(const unsigned char *Data,unsigned long Size)
31 {
32 MD5.Add(Data,Size);
33 SHA1.Add(Data,Size);
34 };
35 inline bool Add(const char *Data) {return Add((unsigned char *)Data,strlen(Data));};
36 bool AddFD(int Fd,unsigned long Size);
37 inline bool Add(const unsigned char *Beg,const unsigned char *End)
38 {return Add(Beg,End-Beg);};
39};
40
41#endif