/////////////////////////////////////////////////// // demo.cpp - help session 2008 demonstration // // ver 2.1 - fixed bug, found by Dusan Palider, in getFiles by adding call // to fileInfo::setPath(path). // ver 2.0 - Uses only ASCII chars and strings. You need to set // Properties/General/Character Set to "Use Multi-byte character set" #include #include #include "fileInfo.h" std::vector getFiles(const std::string& path) { std::vector files; fileInfo f; f.setPath(path); files.push_back(std::string("Search Path is: ") + path); if(f.firstFile("*.*")) files.push_back(f.name()); while(f.nextFile()) files.push_back(f.name()); return files; } void main(int argc, char* argv[]) { std::cout << "\n Hello CSE687\n\n"; for(int i=0; i files = getFiles("c:/temp"); std::cout << "\n Number of files = " << files.size(); for(size_t i=0; i