bookmarks: Added ability to lock bookmarks

This commit is contained in:
WerWolv
2021-02-24 21:42:18 +01:00
parent 209d33ca57
commit 4a1de5d1cb
5 changed files with 25 additions and 8 deletions

View File

@@ -8,7 +8,7 @@ using json = nlohmann::json;
namespace hex {
void to_json(json& j, const ImHexApi::Bookmarks::Entry& b) {
j = json{ { "address", b.region.address }, { "size", b.region.size }, { "name", b.name.data() }, { "comment", b.comment.data() } };
j = json{ { "address", b.region.address }, { "size", b.region.size }, { "name", b.name.data() }, { "comment", b.comment.data() }, { "locked", b.locked } };
}
void from_json(const json& j, ImHexApi::Bookmarks::Entry& b) {
@@ -18,6 +18,7 @@ namespace hex {
j.at("size").get_to(b.region.size);
j.at("name").get_to(name);
j.at("comment").get_to(comment);
j.at("locked").get_to(b.locked);
std::copy(name.begin(), name.end(), std::back_inserter(b.name));
std::copy(comment.begin(), comment.end(), std::back_inserter(b.comment));