comparison OrthancServer/OrthancInitialization.cpp @ 1326:59b603763f43

removal of 2 unused functions
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 13 Feb 2015 16:02:05 +0100
parents 6e7e5ed91c2d
children a3559b66fba7
comparison
equal deleted inserted replaced
1325:a761deb85729 1326:59b603763f43
184 } 184 }
185 } 185 }
186 } 186 }
187 187
188 188
189 static std::string GetStringValue(const Json::Value& configuration,
190 const std::string& key,
191 const std::string& defaultValue)
192 {
193 if (configuration.type() != Json::objectValue)
194 {
195 throw OrthancException(ErrorCode_BadFileFormat);
196 }
197
198 if (!configuration.isMember(key))
199 {
200 return defaultValue;
201 }
202
203 if (configuration[key].type() != Json::stringValue)
204 {
205 throw OrthancException(ErrorCode_BadFileFormat);
206 }
207
208 return configuration[key].asString();
209 }
210
211
212 static int GetIntegerValue(const Json::Value& configuration,
213 const std::string& key,
214 int defaultValue)
215 {
216 if (configuration.type() != Json::objectValue)
217 {
218 throw OrthancException(ErrorCode_BadFileFormat);
219 }
220
221 if (!configuration.isMember(key))
222 {
223 return defaultValue;
224 }
225
226 if (configuration[key].type() != Json::intValue)
227 {
228 throw OrthancException(ErrorCode_BadFileFormat);
229 }
230
231 return configuration[key].asInt();
232 }
233
234
235 void OrthancInitialize(const char* configurationFile) 189 void OrthancInitialize(const char* configurationFile)
236 { 190 {
237 boost::mutex::scoped_lock lock(globalMutex_); 191 boost::mutex::scoped_lock lock(globalMutex_);
238 192
239 InitializeServerEnumerations(); 193 InitializeServerEnumerations();