# HG changeset patch # User Sebastien Jodogne # Date 1487084598 -3600 # Node ID a344e47e9c9acd106da2a9ad84d07b37f867bd16 # Parent e46b0ee6c19de2e2633798ec41ff7dd02287e849 OrthancConfiguration::LookupSetOfStrings diff -r e46b0ee6c19d -r a344e47e9c9a Plugins/Samples/Common/OrthancPluginCppWrapper.cpp --- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Tue Feb 14 15:59:19 2017 +0100 +++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Tue Feb 14 16:03:18 2017 +0100 @@ -659,6 +659,31 @@ ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat); } + + bool OrthancConfiguration::LookupSetOfStrings(std::set& target, + const std::string& key, + bool allowSingleString) const + { + std::list lst; + + if (LookupListOfStrings(lst, key, allowSingleString)) + { + target.clear(); + + for (std::list::const_iterator + it = lst.begin(); it != lst.end(); ++it) + { + target.insert(*it); + } + + return true; + } + else + { + return false; + } + } + std::string OrthancConfiguration::GetStringValue(const std::string& key, const std::string& defaultValue) const diff -r e46b0ee6c19d -r a344e47e9c9a Plugins/Samples/Common/OrthancPluginCppWrapper.h --- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h Tue Feb 14 15:59:19 2017 +0100 +++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h Tue Feb 14 16:03:18 2017 +0100 @@ -40,6 +40,7 @@ #include #include #include +#include #if (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER >= 2 || \ @@ -253,6 +254,10 @@ const std::string& key, bool allowSingleString) const; + bool LookupSetOfStrings(std::set& target, + const std::string& key, + bool allowSingleString) const; + std::string GetStringValue(const std::string& key, const std::string& defaultValue) const;