Flat Iteration Example
void ls (const char* s)
{
// Path
RWCString path (s);
std::cout << "Listing content of : " << s << std::endl;
// Create the iterator
RWDirectoryIterator<const char*> it (s);
// Iterate until the iterator compares equal with the end
// iterator (RWDirectoryIterator<const char*> ())
for(; it != RWDirectoryIterator<const char*> (); ++it) {
std::cout << std::setw (40) << std::left << *it;
RWCString filename (path);
filename += PATH_SEPARATOR;
filename += *it;
// Print the filename
std::cout << filename << "\n";
}
std::cout << std::endl;
}