All pastes #1582632 Raw Edit

Stuff

public cpp v1 · immutable
#1582632 ·published 2009-09-28 15:04 UTC
rendered paste body
std::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;}