+ 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 );
+ }
+
+ // Now divide the two sets into three sets (added, deleted and common )
+ file_set added, deleted, common, old_common;
+ partition_sets( current, backed_up, added, common, old_common, deleted );
+