// Now find the list of files to backup.
file_set backups;
- insert_iterator<file_set> backups_i( backups, backups.begin() );
// backup all added files
- copy( added.begin(), added.end(), backups_i );
+ copy( added.begin(), added.end(), inserter( backups, backups.begin() ) );
// Track the total size of added files
unsigned long long added_blocks, added_bytes;
sizes( added.begin(), added.end(), added_blocks, added_bytes );
- file_vector modified_files;
+ file_vector modified_v;
// Backup files that have been modified
file_set::iterator i = common.begin(), j = old_common.begin();
for( ; i != common.end(); ++i, ++j ) {
(*i)->setLastBackupDate( (*j)->getLastBackupDate() );
- if( needs_backup( *j, *i ) ) modified_files.push_back( *i );
+ if( needs_backup( *j, *i ) ) modified_v.push_back( *i );
}
- copy( modified_files.begin(), modified_files.end(), backups_i );
+ copy( modified_v.begin(), modified_v.end(), inserter( backups, backups.begin() ) );
// Track the total size of modified files
unsigned long long modified_blocks, modified_bytes;
- sizes( modified_files.begin(), modified_files.end(), modified_blocks, modified_bytes );
+ sizes( modified_v.begin(), modified_v.end(), modified_blocks, modified_bytes );
// Now, sort the backups by filesize and build a list that'll fit on a DVD
file_vector backups_s;
sort( backups_s.begin(), backups_s.end(), sizecmp );
file_set final;
- unsigned long long space = 0x100000000ULL; // After looking at how big the ISO can be and how many 1K blocks are left after formatting the filesystem I decided on an even 4GB target
+ unsigned long long space = 0x100000000ULL;
insert_iterator<file_set> final_i( final, final.begin() );