comparison OrthancServer/ServerEnumerations.cpp @ 3677:4182cde57afb

refactoring FindStorageAccessMode
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 19 Feb 2020 17:17:27 +0100
parents 94f4a18a79cc
children e6606d3ec892
comparison
equal deleted inserted replaced
3676:231b46ce1984 3677:4182cde57afb
190 { 190 {
191 boost::mutex::scoped_lock lock(enumerationsMutex_); 191 boost::mutex::scoped_lock lock(enumerationsMutex_);
192 return dictContentType_.Translate(str); 192 return dictContentType_.Translate(str);
193 } 193 }
194 194
195
196 FindStorageAccessMode StringToFindStorageAccessMode(const std::string& value)
197 {
198 if (value == "Always")
199 {
200 return FindStorageAccessMode_DiskOnLookupAndAnswer;
201 }
202 else if (value == "Never")
203 {
204 return FindStorageAccessMode_DatabaseOnly;
205 }
206 else if (value == "Answers")
207 {
208 return FindStorageAccessMode_DiskOnAnswer;
209 }
210 else
211 {
212 throw OrthancException(ErrorCode_ParameterOutOfRange,
213 "Configuration option \"StorageAccessOnFind\" "
214 "should be \"Always\", \"Never\" or \"Answers\": " + value);
215 }
216 }
217
218
195 std::string GetBasePath(ResourceType type, 219 std::string GetBasePath(ResourceType type,
196 const std::string& publicId) 220 const std::string& publicId)
197 { 221 {
198 switch (type) 222 switch (type)
199 { 223 {