// getFiles.cpp - demonstrate package to find files on a path #include "../FileInfo/fileInfo.h" #include "getFiles.h" //----< check if file or dir . or .. >----------------------------- bool isFile(const std::string& name) { if(name[0] == '.') return false; return true; } //----< return files matching pattern on path >-------------------- std::vector getFiles(const std::string& path, const std::string& pattern) { std::vector temp; fileInfo fi; fi.setPath(path); if(fi.firstFile(pattern)) { std::string test = fi.name(); if(isFile(test)) temp.push_back(test); while(fi.nextFile()) { test = fi.name(); if(isFile(test)) temp.push_back(fi.name()); } } return temp; }