Cupt
hashsums.hpp
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright (C) 2010 by Eugene V. Lyubimkin *
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 *
6 * (version 3 or above) as published by the Free Software Foundation. *
7 * *
8 * This program is distributed in the hope that it will be useful, *
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11 * GNU General Public License for more details. *
12 * *
13 * You should have received a copy of the GNU GPL *
14 * along with this program; if not, write to the *
15 * Free Software Foundation, Inc., *
16 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA *
17 **************************************************************************/
18 #ifndef CUPT_HASHSUMS_SEEN
19 #define CUPT_HASHSUMS_SEEN
20 
22 
23 #include <cupt/common.hpp>
24 
25 namespace cupt {
26 
28 class CUPT_API HashSums
29 {
30  public:
32  enum Type { MD5, SHA1, SHA256, Count };
33 
35  string values[Count];
36 
38  string& operator[](const Type& type);
40  const string& operator[](const Type& type) const;
42 
47  bool verify(const string& path) const;
49 
55  bool match(const HashSums& other) const;
57 
60  bool empty() const;
61 
63 
66  void fill(const string& path);
67 
69 
74  static string getHashOfString(const Type& type, const string& pattern);
75 };
76 
77 }
78 
79 #endif
80 
common.hpp
cupt::HashSums
hash sums
Definition: hashsums.hpp:28
cupt::HashSums::Type
Type
hash sum type
Definition: hashsums.hpp:32