Browse Source

- use enum iterator over chechsum_algorithms

master
Andreas Romeyke 3 years ago
parent
commit
b757ffb462
2 changed files with 6 additions and 4 deletions
  1. +3
    -2
      src/lib/payloadmanifest.cpp
  2. +3
    -2
      src/lib/tagmanifest.cpp

+ 3
- 2
src/lib/payloadmanifest.cpp View File

@ -15,8 +15,9 @@ using namespace std;
Payloadmanifest::Payloadmanifest( string basedir ) {
Payloadmanifest::basedir = basedir;
map<checksum_algorithms, string> possible_manifest_files;
possible_manifest_files[md5] = "manifest-md5.txt";
possible_manifest_files[sha1] = "manifest-sha1.txt";
for (checksum_algorithms alg : checksum_algorithmsList) {
possible_manifest_files[alg] = "manifest-" + string_of_algorithm( alg ) + ".txt";
}
for (map<checksum_algorithms, string>::iterator it=possible_manifest_files.begin(); it!=possible_manifest_files.end(); ++it) {
// test if file exists
string filename = basedir + it->second;


+ 3
- 2
src/lib/tagmanifest.cpp View File

@ -15,8 +15,9 @@ using namespace std;
Tagmanifest::Tagmanifest( string basedir ) {
Tagmanifest::basedir = basedir;
map<checksum_algorithms, string> possible_manifest_files;
possible_manifest_files[md5] = "tagmanifest-md5.txt";
possible_manifest_files[sha1] = "tagmanifest-sha1.txt";
for (checksum_algorithms alg : checksum_algorithmsList) {
possible_manifest_files[alg] = "tagmanifest-" + string_of_algorithm( alg ) + ".txt";
}
for (map<checksum_algorithms, string>::iterator it=possible_manifest_files.begin(); it!=possible_manifest_files.end(); ++it) {
// debug
// cout << it->first << " => " << it->second << endl;


Loading…
Cancel
Save