| 336 | } |
| 337 | |
| 338 | void GatherInfos(const FileSelector& select, const std::string& base_path, |
| 339 | const Directory& base_dir, int32_t nesting_depth, |
| 340 | std::vector<FileInfo>* infos) { |
| 341 | for (const auto& pair : base_dir.entries) { |
| 342 | Entry* child = pair.second.get(); |
| 343 | infos->push_back(child->GetInfo(base_path)); |
| 344 | if (select.recursive && nesting_depth < select.max_recursion && child->is_dir()) { |
| 345 | Directory& child_dir = child->as_dir(); |
| 346 | std::string child_path = infos->back().path(); |
| 347 | GatherInfos(select, std::move(child_path), child_dir, nesting_depth + 1, infos); |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | void DumpDirs(const std::string& prefix, const Directory& dir, |
| 353 | std::vector<MockDirInfo>* out) { |