From a21af1a6d10074774315c6510d98920fb83338a2 Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Wed, 17 Jun 2020 17:25:55 -0400 Subject: ResetAll settings API resets settings in the active schema by default. --- binaryninjaapi.h | 2 +- binaryninjacore.h | 2 +- python/settings.py | 4 ++-- settings.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 95575d41..3d48b6b4 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -5072,7 +5072,7 @@ __attribute__ ((format (printf, 1, 2))) bool CopyValuesFrom(Ref source, BNSettingsScope scope = SettingsAutoScope); bool Reset(const std::string& key, Ref view = nullptr, BNSettingsScope scope = SettingsAutoScope); - bool ResetAll(Ref view = nullptr, BNSettingsScope scope = SettingsAutoScope); + bool ResetAll(Ref view = nullptr, BNSettingsScope scope = SettingsAutoScope, bool schemaOnly = true); template T Get(const std::string& key, Ref view = nullptr, BNSettingsScope* scope = nullptr); std::string GetJson(const std::string& key, Ref view = nullptr, BNSettingsScope* scope = nullptr); diff --git a/binaryninjacore.h b/binaryninjacore.h index 54f3ffbb..384e30f3 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -4528,7 +4528,7 @@ __attribute__ ((format (printf, 1, 2))) BINARYNINJACOREAPI bool BNSettingsCopyValuesFrom(BNSettings* settings, BNSettings* source, BNSettingsScope scope); BINARYNINJACOREAPI bool BNSettingsReset(BNSettings* settings, const char* key, BNBinaryView* view, BNSettingsScope scope); - BINARYNINJACOREAPI bool BNSettingsResetAll(BNSettings* settings, BNBinaryView* view, BNSettingsScope scope); + BINARYNINJACOREAPI bool BNSettingsResetAll(BNSettings* settings, BNBinaryView* view, BNSettingsScope scope, bool schemaOnly); BINARYNINJACOREAPI bool BNSettingsGetBool(BNSettings* settings, const char* key, BNBinaryView* view, BNSettingsScope* scope); BINARYNINJACOREAPI double BNSettingsGetDouble(BNSettings* settings, const char* key, BNBinaryView* view, BNSettingsScope* scope); diff --git a/python/settings.py b/python/settings.py index 3b92ec5d..a83898af 100644 --- a/python/settings.py +++ b/python/settings.py @@ -208,10 +208,10 @@ class Settings(object): view = view.handle return core.BNSettingsReset(self.handle, key, view, scope) - def reset_all(self, view = None, scope = SettingsScope.SettingsAutoScope): + def reset_all(self, view = None, scope = SettingsScope.SettingsAutoScope, schema_only = True): if view is not None: view = view.handle - return core.BNSettingsResetAll(self.handle, view, scope) + return core.BNSettingsResetAll(self.handle, view, scope, schema_only) def get_bool(self, key, view = None): if view is not None: diff --git a/settings.cpp b/settings.cpp index 62d928e1..26448937 100644 --- a/settings.cpp +++ b/settings.cpp @@ -193,9 +193,9 @@ bool Settings::Reset(const string& key, Ref view, BNSettingsScope sc } -bool Settings::ResetAll(Ref view, BNSettingsScope scope) +bool Settings::ResetAll(Ref view, BNSettingsScope scope, bool schemaOnly) { - return BNSettingsResetAll(m_object, view ? view->GetObject() : nullptr, scope); + return BNSettingsResetAll(m_object, view ? view->GetObject() : nullptr, scope, schemaOnly); } -- cgit v1.3.1