Rather than old-style C++:
{
DirectoryIterator iter (file, ...);
while (iter.next())
something (iter.getFile());
}
It would be much nicer and more consistent to have:
for (auto c : file.iterateChildFiles (...))
something (c);
Vote if you agree! As for myself I’ve already used up my votes for more important things…
1 Like
reuk
3
Can you just use std::filesystem?
for(auto& p: std::filesystem::recursive_directory_iterator("my_dir"))
std::cout << p.path() << '\n';
1 Like
Thanks, just tried, and apparently I can’t
reuk
5
JUCE6 will include a new RangedDirectoryIterator which has ranged-for support, and which replaces the current DirectoryIterator.
3 Likes