/////////////////////////////////////////////////////////////// // DemoFiles.cpp - executive for help demo #include #include #include "fileinfo.h" using namespace std; #ifdef TEST_DEMOFILES void main(int argc, char *argv[]) { cout << "\n Testing Fileinfo objects " << "\n ==========================\n"; typedef set< fileInfo > setNames; // names are unique fileInfo f; if(argc > 1) f.setPath(argv[1]); cout << " path = " << f.getPath() << endl; cout << "\n Files in FindNextFile Order\n"; setNames sn; if(!f.firstFile("f*")) return; sn.insert(f); f.showData(cout); while(f.nextFile()) { sn.insert(f); f.showData(cout); } f.closeFile(); cout << "\n Files ordered alphabetically:\n"; setNames::iterator fnIt; for(fnIt = sn.begin(); fnIt != sn.end(); fnIt++) { fnIt->showData(cout); } cout << "\n\n"; } #endif