Listing 6: Printing filenames
#include <iostream> #include <stdexcept> #include "DirWalk.h" class PrintWalk : public DirWalk { public: inline PrintWalk() throw() : DirWalk() {} inline virtual void FoundFile() { DirWalk::FoundFile(); cout << endl; } }; int main() { PrintWalk pw; try { pw.Walk(); } catch(exception& e) { cout << e.what() << endl; return 1; } catch(...) { return 1; } return 0; } //End of File