MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / folderMapToJson

Function folderMapToJson

3ds/source/configuration.cpp:398–409  ·  view source on GitHub ↗

Rebuilds a json object { " ": { "folders": [ ... ] } } from the map.

Source from the content-addressed store, hash-verified

396
397// Rebuilds a json object { "<hexid>": { "folders": [ ... ] } } from the map.
398static 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
411void Configuration::addFavorite(u64 id)
412{

Callers 4

addSaveFolderMethod · 0.85
addExtdataFolderMethod · 0.85
removeSaveFolderMethod · 0.85
removeExtdataFolderMethod · 0.85

Calls 1

push_backMethod · 0.45

Tested by

no test coverage detected