View Single Post
Join Date: Apr 2008
Posts: 47
Reputation: Cybulski is an unknown quantity at this point 
Solved Threads: 3
Cybulski's Avatar
Cybulski Cybulski is offline Offline
C++ wannabe

Iterator assertion failure. How?

 
0
  #1
May 14th, 2008
Hello everyone. Welcome to my first post.

I have problem, it didn't brough me here, but maybe someone figure it out, I'm staring at this piece of code for hour. I'm trying to make directory listing class. It puts filenames and directories to vectors. It's not finished, yet not working loop:

  1. while(iter_vsDirectory != v_sDirectories.end())
  2. {
  3. while(FindNextFile(hFind, &foundFileInfo))
  4. {
  5. cout << foundFileInfo.cFileName;
  6. if(foundFileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
  7. {
  8. cout << " dir" << endl;
  9. if(s_currentDir.compare(foundFileInfo.cFileName) && s_parrentDir.compare(foundFileInfo.cFileName))
  10. {
  11. path = foundFileInfo.cFileName;
  12. path.append("\\*");
  13. v_sDirectories.push_back(path);
  14. cout << "Pushed back to dir vector: " << v_sDirectories.back() << endl;
  15. }
  16. }
  17. else
  18. {
  19. cout << " file";
  20. v_sFiles.push_back(foundFileInfo.cFileName);
  21. }
  22. cout << endl;
  23. }
  24. iter_vsDirectory++;
  25. }

In meantime I'll try make this code readable.
Last edited by Cybulski; May 14th, 2008 at 8:42 am.
Reply With Quote