comparison Samples/Common/RtViewerApp.cpp @ 1427:cecedf0b1be6

fix for msvc2008
author s.jodogne@gmail.com
date Fri, 15 May 2020 14:15:14 +0200
parents 07fac4fdbe07
children dad6a2fe6fc7
comparison
equal deleted inserted replaced
1426:1e132fe7090e 1427:cecedf0b1be6
225 OrthancStoneHelpers::SetLogLevel(value); 225 OrthancStoneHelpers::SetLogLevel(value);
226 else 226 else
227 arguments_[key] = value; 227 arguments_[key] = value;
228 } 228 }
229 229
230 const std::string& RtViewerApp::GetArgument(const std::string& key) const 230 std::string RtViewerApp::GetArgument(const std::string& key) const
231 { 231 {
232 ORTHANC_ASSERT(HasArgument(key)); 232 std::map<std::string, std::string>::const_iterator found = arguments_.find(key);
233 return arguments_.at(key); 233 if (found == arguments_.end())
234 {
235 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
236 }
237 else
238 {
239 return found->second;
240 }
234 } 241 }
235 242
236 bool RtViewerApp::HasArgument(const std::string& key) const 243 bool RtViewerApp::HasArgument(const std::string& key) const
237 { 244 {
238 return (arguments_.find(key) != arguments_.end()); 245 return (arguments_.find(key) != arguments_.end());