void GetFiles(const char* srcPath, vector<string> &filesPath, vector<string>& filesName)
{
WIN32_FIND_DATAA ffd;
memset(&ffd, 0, sizeof(ffd));
string path = srcPath;
path.append("\\*");
HANDLE hFind = FindFirstFileA(path.c_str(), &ffd);
do {
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if (!strcmp(ffd.cFileName,".") || !strcmp(ffd.cFileName, ".."))
continue;
string newPath;
newPath.append(srcPath).append("\\").append(ffd.cFileName);
getFileName(files, newPath.c_str(), imageName);
}
else
{
char filePath[MAX_LEN_256] = { 0 };
sprintf_s(filePath, "%s/%s", srcPath, ffd.cFileName);
imageName.push_back(ffd.cFileName);
files.push_back(filePath);
}
} while (FindNextFileA(hFind, &ffd) != 0);
FindClose(hFind);
}
void GetFiles(const char* srcPath, vector<string> &filesPath, vector<string>& filesName)
{
WIN32_FIND_DATAA ffd;
memset(&ffd, 0, sizeof(ffd));
string path = srcPath;
path.append("\\*");
HANDLE hFind = FindFirstFileA(path.c_str(), &ffd);
do {
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if (!strcmp(ffd.cFileName,".") || !strcmp(ffd.cFileName, ".."))
continue;
string newPath;
newPath.append(srcPath).append("\\").append(ffd.cFileName);
getFileName(files, newPath.c_str(), imageName);
}
else
{
char filePath[MAX_LEN_256] = { 0 };
sprintf_s(filePath, "%s/%s", srcPath, ffd.cFileName);
imageName.push_back(ffd.cFileName);
files.push_back(filePath);
}
} while (FindNextFileA(hFind, &ffd) != 0);
FindClose(hFind);
}
{
WIN32_FIND_DATAA ffd;
memset(&ffd, 0, sizeof(ffd));
string path = srcPath;
path.append("\\*");
HANDLE hFind = FindFirstFileA(path.c_str(), &ffd);
do {
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if (!strcmp(ffd.cFileName,".") || !strcmp(ffd.cFileName, ".."))
continue;
string newPath;
newPath.append(srcPath).append("\\").append(ffd.cFileName);
getFileName(files, newPath.c_str(), imageName);
}
else
{
char filePath[MAX_LEN_256] = { 0 };
sprintf_s(filePath, "%s/%s", srcPath, ffd.cFileName);
imageName.push_back(ffd.cFileName);
files.push_back(filePath);
}
} while (FindNextFileA(hFind, &ffd) != 0);
FindClose(hFind);
}