diff options
| author | Brian Potchik <brian@vector35.com> | 2019-05-27 00:51:39 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2019-05-27 00:51:39 -0400 |
| commit | 312950417858a9d89446889fdee2e5988a699861 (patch) | |
| tree | 6cda347356c12d81327ae7b7adcf3b0ddc178645 /settings.cpp | |
| parent | a3b1547175eb776498f15ff662ecf309a7af8009 (diff) | |
Add API to query settings properties.
Diffstat (limited to 'settings.cpp')
| -rw-r--r-- | settings.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/settings.cpp b/settings.cpp index 6f1640a6..1c7bc819 100644 --- a/settings.cpp +++ b/settings.cpp @@ -18,6 +18,21 @@ bool Settings::RegisterSetting(const string& id, const string& properties) } +template<> vector<string> Settings::QueryProperty<vector<string>>(const string& id, const string& property) +{ + size_t size = 0; + char** outBuffer = (char**)BNSettingsQueryPropertyStringList(m_registry.c_str(), id.c_str(), property.c_str(), &size); + + vector<string> result; + result.reserve(size); + for (size_t i = 0; i < size; i++) + result.emplace_back(outBuffer[i]); + + BNFreeStringList(outBuffer, size); + return result; +} + + bool Settings::UpdateProperty(const std::string& id, const std::string& property) { return BNSettingsUpdateProperty(m_registry.c_str(), id.c_str(), property.c_str()); |
