1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
...snip...
/* Get the contents of both the vendor-main and vendor-drop directories
* sorted into two sets, one for files an one for sub directories */
ReadInDirContentsAsRelativeNames(vendorMainRootDir, vendorMainFileSet, vendorMainDirSet);
ReadInDirContentsAsRelativeNames(vendorDropRootDir, vendorDropFileSet, vendorDropDirSet);
/* Get the sub dirs that are common to both the current directories in
* the vendor-main and vendor-drop trees */
set_intersection(
vendorMainDirSet.begin(), vendorMainDirSet.end(),
vendorDropDirSet.begin(), vendorDropDirSet.end(),
std::insert_iterator<PathSet_t>(commonDirSet, commonDirSet.begin()) );
/* Get the files that are common to both the current directories in
* the vendor-main and vendor-drop trees */
set_intersection(
vendorMainFileSet.begin(), vendorMainFileSet.end(),
vendorDropFileSet.begin(), vendorDropFileSet.end(),
std::insert_iterator<PathSet_t>(commonFileSet, commonFileSet.begin()) );
for(PathSet_t::const_iterator it = commonFileSet.begin(); it != commonFileSet.end(); ++it)
{
PathSet_t::iterator elem = find(vendorMainFileSet.begin(),vendorMainFileSet.end(), *it);
if( elem != vendorMainFileSet.end() )
{
vendorMainFileSet.erase(it);
}
elem = find(vendorDropFileSet.begin(),vendorDropFileSet.end(), *it);
if( elem != vendorDropFileSet.end() )
{
vendorDropFileSet.erase(it);
}
...snip...
}
| |