Mercurial > hg > orthanc-databases
diff 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 |
line wrap: on
line diff
--- a/Framework/Common/NullValue.cpp Thu Jul 01 11:31:16 2021 +0200 +++ b/Framework/Common/NullValue.cpp Thu Jul 01 14:39:27 2021 +0200 @@ -21,19 +21,24 @@ #include "NullValue.h" +#include "Utf8StringValue.h" + #include <OrthancException.h> namespace OrthancDatabases { IValue* NullValue::Convert(ValueType target) const { - if (target == ValueType_Null) + switch (target) { - return new NullValue; - } - else - { - throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); + case ValueType_Null: + return new NullValue; + + case ValueType_Utf8String: + return new Utf8StringValue("(null)"); + + default: + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } } }