summaryrefslogtreecommitdiff
path: root/settings.cpp
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2019-09-21 21:56:03 -0400
committerBrian Potchik <brian@vector35.com>2019-09-21 21:56:03 -0400
commit895972365e11346bf9cfcab1e73b882366f5b9bb (patch)
tree2f10ab593c3919b3ce1f047ef7da7ee59f2dc8ad /settings.cpp
parentaedcef7c44c6aab17ba7b2962fc1c347847ad2af (diff)
Access Settings Values as Json.
Diffstat (limited to 'settings.cpp')
-rw-r--r--settings.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/settings.cpp b/settings.cpp
index 46119905..62d928e1 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -249,7 +249,7 @@ template<> vector<string> Settings::Get<vector<string>>(const string& key, Ref<B
string Settings::GetJson(const string& key, Ref<BinaryView> view, BNSettingsScope* scope)
{
- char* tmpStr = BNSettingsGetJsonString(m_object, key.c_str(), view ? view->GetObject() : nullptr, scope);
+ char* tmpStr = BNSettingsGetJson(m_object, key.c_str(), view ? view->GetObject() : nullptr, scope);
string result(tmpStr);
BNFreeString(tmpStr);
return result;
@@ -311,3 +311,9 @@ bool Settings::Set(const string& key, const vector<string>& value, Ref<BinaryVie
BNFreeStringList(buffer, value.size());
return result;
}
+
+
+bool Settings::SetJson(const string& key, const string& value, Ref<BinaryView> view, BNSettingsScope scope)
+{
+ return BNSettingsSetJson(m_object, view ? view->GetObject() : nullptr, scope, key.c_str(), value.c_str());
+}