return out;
}
+// Callback function for getting files from the database
int populate_set( void *files_v, int, char **vals, char ** ) {
file_set *files = reinterpret_cast<file_set*>( files_v );
files->insert( new FileData( vals[0][0],
for( file_set::iterator i = previous_files.begin(); i != previous_files.end(); ++i ) {
cout << (*i)->getFileName() << endl;
}
+
+ // Now divide the two sets into three sets (union and set differences)
+ FileDataPtrCmp cmp;
+
+ file_set new_set;
+ set_difference( current_files.begin(), current_files.end(),
+ previous_files.begin(), previous_files.end(),
+ inserter( new_set, new_set.begin() ),
+ cmp );
+
+ file_set deleted_set;
+ set_difference( previous_files.begin(), previous_files.end(),
+ current_files.begin(), current_files.end(),
+ inserter( deleted_set, deleted_set.begin() ),
+ cmp );
+
+ // previous_files *should* definitely be the first set here
+ file_set common_set;
+ set_difference( previous_files.begin(), previous_files.end(),
+ current_files.begin(), current_files.end(),
+ inserter( common_set, common_set.begin() ),
+ cmp );
}