OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Md5sum implementation for Android. This version handles files as well as | 5 // Md5sum implementation for Android. This version handles files as well as |
6 // directories. Its output is sorted by file path. | 6 // directories. Its output is sorted by file path. |
7 | 7 |
| 8 #include <stddef.h> |
| 9 |
8 #include <fstream> | 10 #include <fstream> |
9 #include <iostream> | 11 #include <iostream> |
10 #include <set> | 12 #include <set> |
11 #include <string> | 13 #include <string> |
12 | 14 |
13 #include "base/files/file_enumerator.h" | 15 #include "base/files/file_enumerator.h" |
14 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
15 #include "base/files/file_util.h" | 17 #include "base/files/file_util.h" |
16 #include "base/logging.h" | 18 #include "base/logging.h" |
17 #include "base/md5.h" | 19 #include "base/md5.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 for (std::set<std::string>::const_iterator it = files.begin(); | 81 for (std::set<std::string>::const_iterator it = files.begin(); |
80 it != files.end(); ++it) { | 82 it != files.end(); ++it) { |
81 if (!MD5Sum(it->c_str(), &digest)) { | 83 if (!MD5Sum(it->c_str(), &digest)) { |
82 failed = true; | 84 failed = true; |
83 } else { | 85 } else { |
84 std::cout << digest << " " << *it << std::endl; | 86 std::cout << digest << " " << *it << std::endl; |
85 } | 87 } |
86 } | 88 } |
87 return failed; | 89 return failed; |
88 } | 90 } |
OLD | NEW |