]> cygwin.com Git - cygwin-apps/setup.git/blob - MD5++.h
2003-10-23 Jerry D. Hedden <jerry@hedden.us>
[cygwin-apps/setup.git] / MD5++.h
1 /*
2 * Copyright (c) 2001, Robert Collins.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
11 *
12 * Written by Robert Collins <rbtcollins@hotmail.com>
13 *
14 */
15
16 #ifndef SETUP_MD5___H
17 #define SETUP_MD5___H
18
19 /* this is the parent class for all package source (not source code - installation
20 * source as in http/ftp/disk file) operations.
21 */
22
23 /* required to parse this file */
24 #include "String++.h"
25
26 // trivial c++ support class for the md5 storage
27 class md5
28 {
29 public:
30 md5(): _set(false){}
31 bool isSet() const {return _set;}
32 void set(unsigned char const hexdigest[16]){for (int i =0 ;i < 16; ++i)digest[i] = hexdigest[i]; _set = true;}
33 unsigned char const * get() const {return digest;}
34 String print() const;
35 bool operator == (md5 const &rhs)const;
36 bool operator != (md5 const &rhs)const;
37 private:
38 unsigned char digest[16];
39 bool _set;
40 };
41
42 #endif /* SETUP_MD5___H */
This page took 0.039839 seconds and 5 git commands to generate.