comparison OrthancServer/Sources/ServerEnumerations.cpp @ 4273:0034f855c023

tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Nov 2020 12:24:50 +0100
parents 05b8fd21089c
children d9473bd5ed43
comparison
equal deleted inserted replaced
4272:1661544ea94d 4273:0034f855c023
235 throw OrthancException(ErrorCode_ParameterOutOfRange, 235 throw OrthancException(ErrorCode_ParameterOutOfRange,
236 "Configuration option \"BuiltinDecoderTranscoderOrder\" " 236 "Configuration option \"BuiltinDecoderTranscoderOrder\" "
237 "should be \"After\", \"Before\" or \"Disabled\": " + value); 237 "should be \"After\", \"Before\" or \"Disabled\": " + value);
238 } 238 }
239 } 239 }
240
241
242 Verbosity StringToVerbosity(const std::string& str)
243 {
244 if (str == "default")
245 {
246 return Verbosity_Default;
247 }
248 else if (str == "verbose")
249 {
250 return Verbosity_Verbose;
251 }
252 else if (str == "trace")
253 {
254 return Verbosity_Trace;
255 }
256 else
257 {
258 throw OrthancException(ErrorCode_ParameterOutOfRange,
259 "Verbosity can be \"default\", \"verbose\" or \"trace\": " + str);
260 }
261 }
240 262
241 263
242 std::string GetBasePath(ResourceType type, 264 std::string GetBasePath(ResourceType type,
243 const std::string& publicId) 265 const std::string& publicId)
244 { 266 {
365 default: 387 default:
366 throw OrthancException(ErrorCode_ParameterOutOfRange); 388 throw OrthancException(ErrorCode_ParameterOutOfRange);
367 } 389 }
368 } 390 }
369 391
392
393 const char* EnumerationToString(Verbosity verbosity)
394 {
395 switch (verbosity)
396 {
397 case Verbosity_Default:
398 return "default";
399
400 case Verbosity_Verbose:
401 return "verbose";
402
403 case Verbosity_Trace:
404 return "trace";
405
406 default:
407 throw OrthancException(ErrorCode_ParameterOutOfRange);
408 }
409 }
410
370 411
371 bool IsUserMetadata(MetadataType metadata) 412 bool IsUserMetadata(MetadataType metadata)
372 { 413 {
373 return (metadata >= MetadataType_StartUser && 414 return (metadata >= MetadataType_StartUser &&
374 metadata <= MetadataType_EndUser); 415 metadata <= MetadataType_EndUser);