Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void dispheadDups(linkedList<linkedList<string>> fList) {
- linkedList<string> uniqueHList;
- //This section prepares the unique Header List of names to scan through.
- if (fList.getHead() != NULL) {
- node<linkedList<string>> *currentFile = fList.getHead();
- while (currentFile != NULL) { // if there's at at least 1 file, go through the files.
- node<string> *currentHeader = currentFile->getData().getHead();
- while (currentHeader != NULL) { // loop while there are still headers to check.
- node<string> *tempUHL = uniqueHList.getHead();
- bool foundCopy = false;
- while (tempUHL != NULL) {
- cout << "comparing " << tempUHL->getData() << " to " << currentHeader->getData() << endl;
- if (tempUHL->getData().compare(currentHeader->getData()) == 0) {
- cout << "they're equal!" << endl;
- foundCopy = true;
- }
- tempUHL = tempUHL->getNext();
- }
- if (!foundCopy) { //Means I haven't worked on this header name yet.
- int count = countCopies(currentHeader->getData());
- if (count > 1) {
- cout << "about to add " << currentHeader->getData() << " to unique list" << endl;
- uniqueHList.Append(currentHeader->getData());
- }
- dispDirect(currentHeader->getData(), fList);
- }
- currentHeader = currentHeader->getNext();
- }
- currentFile = currentFile->getNext();
- }
- }
- ////This section below uses the unique Header List of names to scan for duplicates.
- ////There are two steps to scanning for duplicates.
- ////(1) If a file indirectly includes the header through another file.
- ////(2) If a file directly includes the header.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement