| 83 | } |
| 84 | |
| 85 | static Result collectTreeImpl(FS_Archive arch, const std::u16string& root, const std::u16string& sub, std::vector<io::TreeEntry>& out) |
| 86 | { |
| 87 | Directory items(arch, root + sub); |
| 88 | if (!items.good()) { |
| 89 | return items.error(); |
| 90 | } |
| 91 | for (size_t i = 0, sz = items.size(); i < sz; i++) { |
| 92 | std::u16string rel = sub + items.entry(i); |
| 93 | if (items.folder(i)) { |
| 94 | out.push_back({rel, true}); |
| 95 | Result res = collectTreeImpl(arch, root, rel + StringUtils::UTF8toUTF16("/"), out); |
| 96 | if (R_FAILED(res)) { |
| 97 | return res; |
| 98 | } |
| 99 | } |
| 100 | else { |
| 101 | out.push_back({rel, false}); |
| 102 | } |
| 103 | } |
| 104 | return 0; |
| 105 | } |
| 106 | |
| 107 | Result io::collectTree(FS_Archive arch, const std::u16string& path, std::vector<TreeEntry>& out) |
| 108 | { |