- file_set updated;
- set_union( current.begin(), current.end(),
- backed_up.begin(), backed_up.end(),
- inserter( updated, updated.begin() ),
- cmp );
-
- { // This little block will copy the last_backup_date from the second set to the first
- file_set updated_mirror;
- set_union( current.begin(), current.end(),
- backed_up.begin(), backed_up.end(),
- inserter( updated_mirror, updated_mirror.begin() ),
- cmp );
-
- // TODO Now we need to copy the last_backup_date from
- file_set::iterator i = updated.begin(), j = updated_mirror.begin();
- for( ; i != updated.end(); ++i, ++j ) {
- (*i)->setLastBackupDate( (*j)->getLastBackupDate() );
- }
+ set_union( current.begin(), current.end(),
+ old.begin(), old.end(),
+ inserter( common, common.begin() ),
+ cmp );
+
+ set_union( old.begin(), old.end(),
+ common.begin(), common.end(),
+ inserter( old_common, old_common.begin() ),
+ cmp );
+}
+
+int main() {
+ // Parse the list of current files on stdin
+ file_set current;
+ populate_set( cin, current );
+
+ file_set backed_up;
+ ifstream db( "test.db" );
+ if( db && db.good() ) {
+ populate_set( db, backed_up );