Mercurial > hg > orthanc-databases
comparison Framework/Common/Integer32Value.cpp @ 522:c49136b34891 large-queries
use a prepared statement for InsertOrUpdateMetadata
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Fri, 05 Jul 2024 09:15:54 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
521:2ab3d45c0b3c | 522:c49136b34891 |
---|---|
1 /** | |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium | |
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium | |
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | |
8 * | |
9 * This program is free software: you can redistribute it and/or | |
10 * modify it under the terms of the GNU Affero General Public License | |
11 * as published by the Free Software Foundation, either version 3 of | |
12 * the License, or (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, but | |
15 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 * Affero General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU Affero General Public License | |
20 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
21 **/ | |
22 | |
23 | |
24 #include "Integer32Value.h" | |
25 | |
26 #include "BinaryStringValue.h" | |
27 #include "NullValue.h" | |
28 #include "Utf8StringValue.h" | |
29 | |
30 #include <OrthancException.h> | |
31 | |
32 #include <boost/lexical_cast.hpp> | |
33 | |
34 namespace OrthancDatabases | |
35 { | |
36 IValue* Integer32Value::Convert(ValueType target) const | |
37 { | |
38 std::string s = boost::lexical_cast<std::string>(value_); | |
39 | |
40 switch (target) | |
41 { | |
42 case ValueType_Null: | |
43 return new NullValue; | |
44 | |
45 case ValueType_BinaryString: | |
46 return new BinaryStringValue(s); | |
47 | |
48 case ValueType_Utf8String: | |
49 return new Utf8StringValue(s); | |
50 | |
51 default: | |
52 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | |
53 } | |
54 } | |
55 } |