comparison Framework/Common/NullValue.cpp @ 298:8f655f308de9

added IResult::Print()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 01 Jul 2021 14:39:27 +0200
parents 3236894320d6
children 16aac0287485
comparison
equal deleted inserted replaced
297:86265ef5f3e3 298:8f655f308de9
19 **/ 19 **/
20 20
21 21
22 #include "NullValue.h" 22 #include "NullValue.h"
23 23
24 #include "Utf8StringValue.h"
25
24 #include <OrthancException.h> 26 #include <OrthancException.h>
25 27
26 namespace OrthancDatabases 28 namespace OrthancDatabases
27 { 29 {
28 IValue* NullValue::Convert(ValueType target) const 30 IValue* NullValue::Convert(ValueType target) const
29 { 31 {
30 if (target == ValueType_Null) 32 switch (target)
31 { 33 {
32 return new NullValue; 34 case ValueType_Null:
33 } 35 return new NullValue;
34 else 36
35 { 37 case ValueType_Utf8String:
36 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 38 return new Utf8StringValue("(null)");
39
40 default:
41 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
37 } 42 }
38 } 43 }
39 } 44 }