Recursive Iteration Example
void ls_R (const char* s, int depth = 0)
{
std::cout << "Recursively listing content of : " << s
<< " (depth: " << depth << ")\n";
// Create the iterator
RWDirectoryIterator<RWCString> it (s, depth);
// Iterate until iterator compares equal with end iterator
// (RWDirectoryIterator<RWCString> ())
for (; it != RWDirectoryIterator<RWCString> (); ++it) {
std::cout << std::setw (60) << std::left << *it;
// Print the filename
std::cout << *it << "\n";
}
std::cout << std::endl;
}