From 6812c973c9fa9b4ad642ab81856c05f87bd6fcc4 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Thu, 27 Jan 2022 22:43:28 -0500 Subject: Format All Files --- settings.cpp | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'settings.cpp') diff --git a/settings.cpp b/settings.cpp index e963a6d1..5c244435 100644 --- a/settings.cpp +++ b/settings.cpp @@ -73,7 +73,8 @@ vector Settings::Keys() } -template<> vector Settings::QueryProperty>(const string& key, const string& property) +template <> +vector Settings::QueryProperty>(const string& key, const string& property) { size_t size = 0; char** outBuffer = (char**)BNSettingsQueryPropertyStringList(m_object, key.c_str(), property.c_str(), &size); @@ -136,7 +137,8 @@ bool Settings::UpdateProperty(const std::string& key, const std::string& propert } -bool Settings::UpdateProperty(const std::string& key, const std::string& property, const std::vector& value) +bool Settings::UpdateProperty( + const std::string& key, const std::string& property, const std::vector& value) { char** buffer = new char*[value.size()]; if (!buffer) @@ -145,7 +147,8 @@ bool Settings::UpdateProperty(const std::string& key, const std::string& propert for (size_t i = 0; i < value.size(); i++) buffer[i] = BNAllocString(value[i].c_str()); - bool result = BNSettingsUpdateStringListProperty(m_object, key.c_str(), property.c_str(), (const char**)buffer, value.size()); + bool result = + BNSettingsUpdateStringListProperty(m_object, key.c_str(), property.c_str(), (const char**)buffer, value.size()); BNFreeStringList(buffer, value.size()); return result; } @@ -193,31 +196,36 @@ bool Settings::ResetAll(Ref view, BNSettingsScope scope, bool schema } -template<> bool Settings::Get(const string& key, Ref view, BNSettingsScope* scope) +template <> +bool Settings::Get(const string& key, Ref view, BNSettingsScope* scope) { return BNSettingsGetBool(m_object, key.c_str(), view ? view->GetObject() : nullptr, scope); } -template<> double Settings::Get(const string& key, Ref view, BNSettingsScope* scope) +template <> +double Settings::Get(const string& key, Ref view, BNSettingsScope* scope) { return BNSettingsGetDouble(m_object, key.c_str(), view ? view->GetObject() : nullptr, scope); } -template<> int64_t Settings::Get(const string& key, Ref view, BNSettingsScope* scope) +template <> +int64_t Settings::Get(const string& key, Ref view, BNSettingsScope* scope) { return BNSettingsGetInt64(m_object, key.c_str(), view ? view->GetObject() : nullptr, scope); } -template<> uint64_t Settings::Get(const string& key, Ref view, BNSettingsScope* scope) +template <> +uint64_t Settings::Get(const string& key, Ref view, BNSettingsScope* scope) { return BNSettingsGetUInt64(m_object, key.c_str(), view ? view->GetObject() : nullptr, scope); } -template<> string Settings::Get(const string& key, Ref view, BNSettingsScope* scope) +template <> +string Settings::Get(const string& key, Ref view, BNSettingsScope* scope) { char* tmpStr = BNSettingsGetString(m_object, key.c_str(), view ? view->GetObject() : nullptr, scope); string result(tmpStr); @@ -226,10 +234,12 @@ template<> string Settings::Get(const string& key, Ref view, } -template<> vector Settings::Get>(const string& key, Ref view, BNSettingsScope* scope) +template <> +vector Settings::Get>(const string& key, Ref view, BNSettingsScope* scope) { size_t size = 0; - char** outBuffer = (char**)BNSettingsGetStringList(m_object, key.c_str(), view ? view->GetObject() : nullptr, scope, &size); + char** outBuffer = + (char**)BNSettingsGetStringList(m_object, key.c_str(), view ? view->GetObject() : nullptr, scope, &size); vector result; result.reserve(size); @@ -301,7 +311,8 @@ bool Settings::Set(const string& key, const vector& value, RefGetObject() : nullptr, scope, key.c_str(), (const char**)buffer, value.size()); + bool result = BNSettingsSetStringList( + m_object, view ? view->GetObject() : nullptr, scope, key.c_str(), (const char**)buffer, value.size()); BNFreeStringList(buffer, value.size()); return result; } -- cgit v1.3.1