std::vector<MazeCellNode *> MazePathSearcher::foundCellNodePath() const{ std::vector<MazeCellNode *> nodes; std::vector<PathNode *>path = foundPath(); for(std::vector<PathNode *>::iterator it = path.begin();it!=path.end();it++){ MazeCellNode *node = dynamic_cast<MazeCellNode *>(*it); nodes.push_back(node); } return nodes; }
/** * Recursively processes directory structure, storing the relative path to each file found. */ void CDiskResource::ProcessDirectory(std::wstring path) { // Determine the package-relative resource path. std::wstring findPath(m_path); if (path.length() > 0) findPath.append(std::wstring(_T("\\"))).append(path); std::wstring search(findPath); search.append(_T("\\*")); WIN32_FIND_DATA fd; HANDLE ff = FindFirstFile(search.c_str(),&fd); if (ff != INVALID_HANDLE_VALUE) { do { if (_tcscmp(fd.cFileName,_T(".")) != 0 && _tcscmp(fd.cFileName,_T("..")) != 0 && _tcscmp(fd.cFileName,_T(".svn")) != 0) { std::wstring foundPath(path); if (foundPath.length() > 0) foundPath.append(_T("\\")).append(fd.cFileName); else foundPath = fd.cFileName; if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) { // Recurse into this sub-directory. ProcessDirectory(foundPath); } else { m_files.push_back(foundPath); } } } while (FindNextFile(ff,&fd) != 0); FindClose(ff); } }