24#include <unordered_map>
52 while (*filter && *str)
56 if (*++filter ==
'\0')
68 else if (*filter != *str)
75 return ((*filter ==
'\0' || (*filter ==
'*' && *++filter ==
'\0')) && *str ==
'\0');
88 WIN32_FIND_DATA findFileInfo;
89 std::string directory;
91 directory = dirpath +
"/" + filter;
93 hFind = FindFirstFile(directory.c_str(), &findFileInfo);
95 if (hFind == INVALID_HANDLE_VALUE)
99 if (strcmp(findFileInfo.cFileName,
".") != 0 && strcmp(findFileInfo.cFileName,
"..") != 0)
100 fileList.push_back(std::string(findFileInfo.cFileName));
102 while (FindNextFile(hFind, &findFileInfo));
107 const char *p = dirpath.c_str();
108 DIR * dirp = opendir(p);
114 if ((dp = readdir(dirp)) !=
nullptr)
116 if (strcmp(dp->d_name,
".") != 0 && strcmp(dp->d_name,
"..") != 0 &&
matchWildcardFilter(filter.c_str(), dp->d_name))
117 fileList.push_back(std::string(dp->d_name));
140 extern std::unordered_map<uint32, MapEntry>
sMapStore;
142 namespace VMapFactory
std::unique_ptr< VMAP::VMapManager2 > CreateVMapManager()
@ LISTFILE_DIRECTORY_NOT_FOUND
ListFilesResult getDirContents(std::vector< std::string > &fileList, std::string dirpath=".", std::string filter="*")
bool matchWildcardFilter(char const *filter, char const *str)
std::unordered_map< uint32, MapEntry > sMapStore