void forEachFile(VisitorFunc visitor, const char* root) { if(root[0] == '\0') { if(visitor.directory("textures/", 1)) return; } else if(strcmp(root, "textures/") != 0) { return; } for(files_t::iterator i = m_files.begin(); i != m_files.end(); ++i) visitor.file(i->first.c_str()); }
path::files_t files_by_prefix(std::string const& path) { using namespace details; files_t files; std::string folder(parent_path(path)); std::string prefix = filename(path); files_t out_files; const files_t all_files = files_in_folder(folder); for (auto it = all_files.begin(); it != all_files.end(); ++it) // no std::copy_if before C++11 if (boost::starts_with(filename(*it), prefix)) out_files.push_back(*it); return out_files; }