@ -19,30 +19,41 @@ Tagmanifest::Tagmanifest( string basedir ) {
possible_manifest_files [ sha1 ] = " tagmanifest-sha1.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 ;
// cout << it->first << " => " << it->second << endl;
// test if file exists
string filename = basedir + it - > second ;
fs : : path p { filename } ;
fs : : file_status s = fs : : status ( p ) ;
cout < < " path " < < p . string ( ) < < endl ;
cout < < " is file: " < < fs : : is_regular_file ( s ) < < endl ;
//cout << "path "<< p.string() << endl;
//cout << "is file: "<< fs::is_regular_file( s) << endl;
if ( fs : : is_regular_file ( s ) ) {
Tagmanifest : : manifest_algorithm_files [ it - > first ] = filename ;
// debug
cout < < " TAGMANIFEST: alg= " < < it - > first < < " => filename= " < < it - > second < < endl ;
//cout << "TAGMANIFEST: alg="<< it->first << " => filename=" << it->second << endl;
//cout << "TAGMANIFEST2: alg="<< it->first << " => filename=" << filename << endl;
}
}
this - > exist_manifest_files = possible_manifest_files . empty ( ) ;
//cout << "TAGMANIFEST constructor, calling debug()" << endl;
//this->debug();
//cout << "TAGMANIFEST constructor, finished" << endl;
}
map < string , string > Tagmanifest : : get_checksum_file_pairs ( checksum_algorithms alg ) {
map < string , string > checksum_file_pairs = Manifest : : get_checksum_file_pairs ( alg ) ;
multimap < checksum_string_t , filename_t > Tagmanifest : : get_checksum_file_pairs ( checksum_algorithms alg ) {
//cout << "DEBUG: begin Tagmanifest::get_checksum_file_pairs" << endl;
multimap < checksum_string_t , filename_t > checksum_file_pairs = Manifest : : get_checksum_file_pairs ( alg ) ;
//cout << "DEBUG: called super->get_checksum_file_pairs" << endl;
for ( map < string , string > : : iterator it = checksum_file_pairs . begin ( ) ; it ! = checksum_file_pairs . end ( ) ; + + it ) {
for ( multimap < checksum_string_t , filename_t > : : iterator it = checksum_file_pairs . begin ( ) ; it ! = checksum_file_pairs . end ( ) ; + + it ) {
// cout << "DEBUG: TAGMANIFEST found 'data/' in the beginning of file '"<<it->second<<"' in tagmanifest file '"<< this->manifest_algorithm_files[ alg] << endl;
if ( it - > second . find ( " data/ " ) = = 0 ) {
cout < < " found 'data/' in the beginning of file ' " < < it - > second < < " ' in tagmanifest file ' " < < this - > manifest_algorithm_files [ alg ] < < endl ;
}
}
//cout << "TAGMANIFEST get_checksum_file_pairs, calling debug()" << endl;
//this->debug();
//cout << "TAGMANIFEST get_checksum_file_pairs, finished" << endl;
return checksum_file_pairs ;
}