| 222 | } |
| 223 | |
| 224 | void TitleCatalog::exportTitleListCache(std::vector<Title>& list, const std::u16string& path, IconStore& icons) |
| 225 | { |
| 226 | const size_t bytes = list.size() * TitleCache::ENTRY_SIZE; |
| 227 | std::unique_ptr<u8[]> cache = std::unique_ptr<u8[]>(new u8[bytes]()); |
| 228 | for (size_t i = 0; i < list.size(); i++) { |
| 229 | TitleCache::encode(cache.get() + i * TitleCache::ENTRY_SIZE, list.at(i), icons); |
| 230 | } |
| 231 | |
| 232 | FSUSER_DeleteFile(Archive::sdmc(), fsMakePath(PATH_UTF16, path.data())); |
| 233 | FSStream output(Archive::sdmc(), path, FS_OPEN_WRITE, bytes); |
| 234 | output.write(cache.get(), bytes); |
| 235 | output.close(); |
| 236 | } |
| 237 | |
| 238 | void TitleCatalog::importTitleListCache(std::vector<Title>& saves, std::vector<Title>& extdatas, IconStore& icons) |
| 239 | { |