Mercurial > hg > orthanc-databases
annotate Framework/Common/ResultFileValue.cpp @ 263:29d2b76516f6
fix mysql and postgresql builds
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 20 Apr 2021 15:08:09 +0200 |
parents | 483af3f35a4b |
children | 16aac0287485 |
rev | line source |
---|---|
0 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
193
3236894320d6
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
245
9d00e5e073e8
rename FileValue as ResultFileValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
243
diff
changeset
|
22 #include "ResultFileValue.h" |
0 | 23 |
24 #include "BinaryStringValue.h" | |
25 #include "NullValue.h" | |
26 | |
152 | 27 #include <OrthancException.h> |
0 | 28 |
29 #include <boost/lexical_cast.hpp> | |
30 | |
31 namespace OrthancDatabases | |
32 { | |
245
9d00e5e073e8
rename FileValue as ResultFileValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
243
diff
changeset
|
33 IValue* ResultFileValue::Convert(ValueType target) const |
0 | 34 { |
35 switch (target) | |
36 { | |
37 case ValueType_BinaryString: | |
246
483af3f35a4b
turning ResultFileValue into a base class, and implement its primitives for PostgreSQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
245
diff
changeset
|
38 { |
483af3f35a4b
turning ResultFileValue into a base class, and implement its primitives for PostgreSQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
245
diff
changeset
|
39 std::string content; |
483af3f35a4b
turning ResultFileValue into a base class, and implement its primitives for PostgreSQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
245
diff
changeset
|
40 ReadWhole(content); |
483af3f35a4b
turning ResultFileValue into a base class, and implement its primitives for PostgreSQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
245
diff
changeset
|
41 return new BinaryStringValue(content); |
483af3f35a4b
turning ResultFileValue into a base class, and implement its primitives for PostgreSQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
245
diff
changeset
|
42 } |
0 | 43 |
44 default: | |
45 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadParameterType); | |
46 } | |
47 } | |
48 } |