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:
while(iter_vsDirectory != v_sDirectories.end())
{
while(FindNextFile(hFind, &foundFileInfo))
{
cout << foundFileInfo.cFileName;
if(foundFileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
cout << " dir" << endl;
if(s_currentDir.compare(foundFileInfo.cFileName) && s_parrentDir.compare(foundFileInfo.cFileName))
{
path = foundFileInfo.cFileName;
path.append("\\*");
v_sDirectories.push_back(path);
cout << "Pushed back to dir vector: " << v_sDirectories.back() << endl;
}
}
else
{
cout << " file";
v_sFiles.push_back(foundFileInfo.cFileName);
}
cout << endl;
}
iter_vsDirectory++;
}
In meantime I'll try make this code readable.