| 53 | } |
| 54 | |
| 55 | void DB::load(std::filesystem::path &filepath) { |
| 56 | std::ifstream istream(filepath); |
| 57 | if (!istream.is_open()) { |
| 58 | return; |
| 59 | } |
| 60 | |
| 61 | nlohmann::json json; |
| 62 | istream >> json; |
| 63 | _root = json.get<Root>(); |
| 64 | |
| 65 | //Labels |
| 66 | for (auto &idaFunc : _root.functions) { |
| 67 | for (auto &idaLabel : idaFunc.labels) { |
| 68 | idaLabel.name = idaFunc.name + ":::" + idaLabel.name; |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | void DB::Save(std::filesystem::path &filepath) { |
| 74 | nlohmann::json json = _root; |