Mercurial > hg > orthanc
diff Plugins/Samples/Common/OrthancPluginCppWrapper.cpp @ 2266:a344e47e9c9a
OrthancConfiguration::LookupSetOfStrings
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 14 Feb 2017 16:03:18 +0100 |
parents | e46b0ee6c19d |
children | f915aff7a866 |
line wrap: on
line diff
--- 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<std::string>& target, + const std::string& key, + bool allowSingleString) const + { + std::list<std::string> lst; + + if (LookupListOfStrings(lst, key, allowSingleString)) + { + target.clear(); + + for (std::list<std::string>::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