diff options
| author | Brian Potchik <brian@vector35.com> | 2019-01-25 09:55:33 -0500 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2019-01-25 09:55:33 -0500 |
| commit | 2c80bc959151a6b9888a8521a0efbba1a1843cb6 (patch) | |
| tree | fa15ba8aa71e53578665c0be69cbe5fe75b37e66 | |
| parent | e4bcabe6035c279502b1bf29d5b2bb431676fdc6 (diff) | |
Add CopyValue to Settings APi.
| -rw-r--r-- | binaryninjaapi.h | 1 | ||||
| -rw-r--r-- | binaryninjacore.h | 1 | ||||
| -rw-r--r-- | python/settings.py | 5 | ||||
| -rw-r--r-- | settings.cpp | 6 |
4 files changed, 12 insertions, 1 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 138d82c1..a79ad588 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -4265,6 +4265,7 @@ namespace BinaryNinja bool DeserializeSettings(const std::string& contents, Ref<BinaryView> view = nullptr, BNSettingsScope scope = SettingsAutoScope); std::string SerializeSettings(Ref<BinaryView> view = nullptr, BNSettingsScope scope = SettingsAutoScope); + bool CopyValue(const std::string& destRegistry, const std::string& id); bool Reset(const std::string& id, Ref<BinaryView> view = nullptr, BNSettingsScope scope = SettingsAutoScope); bool ResetAll(Ref<BinaryView> view = nullptr, BNSettingsScope scope = SettingsAutoScope); diff --git a/binaryninjacore.h b/binaryninjacore.h index ea7803b6..d95b311c 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -3699,6 +3699,7 @@ extern "C" BINARYNINJACOREAPI bool BNDeserializeSettings(const char* registry, const char* contents, BNBinaryView* view, BNSettingsScope scope); BINARYNINJACOREAPI char* BNSerializeSettings(const char* registry, BNBinaryView* view, BNSettingsScope scope); + BINARYNINJACOREAPI bool BNSettingsCopyValue(const char* registry, const char* destRegistry, const char* id); BINARYNINJACOREAPI bool BNSettingsReset(const char* registry, const char* id, BNBinaryView* view, BNSettingsScope scope); BINARYNINJACOREAPI bool BNSettingsResetAll(const char* registry, BNBinaryView* view, BNSettingsScope scope); diff --git a/python/settings.py b/python/settings.py index e187f2fe..61c1c771 100644 --- a/python/settings.py +++ b/python/settings.py @@ -70,7 +70,10 @@ class Settings(object): return core.BNSettingsUpdateProperty(self.registry_id, tr(), id, setting_property) def get_schema(self): - return core.BNSettingsGetSchema(self.registry_id); + return core.BNSettingsGetSchema(self.registry_id) + + def copy_value(self, dest_registry_id, id): + return core.BNSettingsCopyValue(self.registry_id, dest_registry_id, id) def reset(self, id, view = None, scope = SettingsScope.SettingsAutoScope): if view is not None: diff --git a/settings.cpp b/settings.cpp index df95a56c..6f1640a6 100644 --- a/settings.cpp +++ b/settings.cpp @@ -105,6 +105,12 @@ string Settings::SerializeSettings(Ref<BinaryView> view, BNSettingsScope scope) } +bool Settings::CopyValue(const string& destRegistry, const string& id) +{ + return BNSettingsCopyValue(m_registry.c_str(), destRegistry.c_str(), id.c_str()); +} + + bool Settings::Reset(const string& id, Ref<BinaryView> view, BNSettingsScope scope) { return BNSettingsReset(m_registry.c_str(), id.c_str(), view ? view->GetObject() : nullptr, scope); |
