| 365 | } |
| 366 | |
| 367 | void DumpFiles(const std::string& prefix, const Directory& dir, |
| 368 | std::vector<MockFileInfo>* out) { |
| 369 | std::string path = prefix + dir.name; |
| 370 | if (!path.empty()) { |
| 371 | path += "/"; |
| 372 | } |
| 373 | for (const auto& pair : dir.entries) { |
| 374 | Entry* child = pair.second.get(); |
| 375 | if (child->is_file()) { |
| 376 | auto& file = child->as_file(); |
| 377 | out->push_back({path + file.name, file.mtime, std::string_view(file)}); |
| 378 | } else if (child->is_dir()) { |
| 379 | DumpFiles(path, child->as_dir(), out); |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | Result<std::shared_ptr<io::OutputStream>> OpenOutputStream( |
| 385 | const std::string& path, bool append, |