rendered paste bodystd::vector<std::string> findFile(const std::string& path){ std::vector<std::string> fileList; HANDLE hSearch; WIN32_FIND_DATA findData; std::string findPath; std::string fileName; hSearch = FindFirstFile((path + "\\*").c_str(), &findData); if (hSearch == INVALID_HANDLE_VALUE) { std::cerr << "ファイルの検索に失敗しました" << std::endl; return fileList; } do { fileName = std::string(findData.cFileName); if (fileName != "." && fileName != "..") { if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { std::vector<std::string> temp; temp = findFile(path + "\\" + fileName); fileList.insert(fileList.end(), temp.begin(), temp.end()); }else{ fileList.push_back(path + "\\" + fileName); } } } while (FindNextFile(hSearch, &findData)); FindClose(hSearch); return fileList;}