Rebuilds a json object { " ": { "folders": [ ... ] } } from the map.
| 396 | |
| 397 | // Rebuilds a json object { "<hexid>": { "folders": [ ... ] } } from the map. |
| 398 | static nlohmann::json folderMapToJson(const std::unordered_map<u64, std::vector<std::u16string>>& map) |
| 399 | { |
| 400 | auto obj = nlohmann::json::object(); |
| 401 | for (auto& entry : map) { |
| 402 | auto folders = nlohmann::json::array(); |
| 403 | for (auto& folder : entry.second) { |
| 404 | folders.push_back(StringUtils::UTF16toUTF8(folder)); |
| 405 | } |
| 406 | obj[StringUtils::format("%016llX", entry.first)]["folders"] = folders; |
| 407 | } |
| 408 | return obj; |
| 409 | } |
| 410 | |
| 411 | void Configuration::addFavorite(u64 id) |
| 412 | { |
no test coverage detected