annotate Common/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h @ 140:40efe821932a

fix LSB build
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 01 Mar 2024 16:17:51 +0100
parents 12ea59c97c40
children 82ab647f7e73
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
140
40efe821932a fix LSB build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 120
diff changeset
5 * Copyright (C) 2017-2024 Osimis S.A., Belgium
40efe821932a fix LSB build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 120
diff changeset
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * modify it under the terms of the GNU General Public License as
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * published by the Free Software Foundation, either version 3 of the
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * License, or (at your option) any later version.
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * General Public License for more details.
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 *
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #pragma once
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "OrthancPluginException.h"
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include <orthanc/OrthancCPlugin.h>
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 #include <boost/noncopyable.hpp>
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #include <boost/lexical_cast.hpp>
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include <boost/date_time/posix_time/posix_time.hpp>
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 #include <json/value.h>
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 #include <vector>
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #include <list>
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #include <set>
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include <map>
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 /**
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 * The definition of ORTHANC_PLUGINS_VERSION_IS_ABOVE below is for
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 * backward compatibility with Orthanc SDK <= 1.3.0.
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 *
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 * $ hg diff -r Orthanc-1.3.0:Orthanc-1.3.1 ../../../Plugins/Include/orthanc/OrthancCPlugin.h
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 *
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 **/
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 #define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 #if !defined(ORTHANC_FRAMEWORK_VERSION_IS_ABOVE)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 #define ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(major, minor, revision) \
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 (ORTHANC_VERSION_MAJOR > major || \
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 (ORTHANC_VERSION_MAJOR == major && \
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 (ORTHANC_VERSION_MINOR > minor || \
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 (ORTHANC_VERSION_MINOR == minor && \
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 ORTHANC_VERSION_REVISION >= revision))))
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 2, 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 // The "OrthancPluginFindMatcher()" primitive was introduced in Orthanc 1.2.0
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 # define HAS_ORTHANC_PLUGIN_FIND_MATCHER 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 #else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 # define HAS_ORTHANC_PLUGIN_FIND_MATCHER 0
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 4, 2)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 # define HAS_ORTHANC_PLUGIN_PEERS 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 # define HAS_ORTHANC_PLUGIN_JOB 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 #else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 # define HAS_ORTHANC_PLUGIN_PEERS 0
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 # define HAS_ORTHANC_PLUGIN_JOB 0
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 # define HAS_ORTHANC_PLUGIN_EXCEPTION_DETAILS 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 #else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 # define HAS_ORTHANC_PLUGIN_EXCEPTION_DETAILS 0
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 4)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 # define HAS_ORTHANC_PLUGIN_METRICS 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 #else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 # define HAS_ORTHANC_PLUGIN_METRICS 0
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 1, 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 # define HAS_ORTHANC_PLUGIN_HTTP_CLIENT 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 #else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 # define HAS_ORTHANC_PLUGIN_HTTP_CLIENT 0
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 7)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 # define HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 #else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 # define HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT 0
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 7)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 # define HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_SERVER 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 #else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 # define HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_SERVER 0
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 6, 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 # define HAS_ORTHANC_PLUGIN_STORAGE_COMMITMENT_SCP 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 #else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 # define HAS_ORTHANC_PLUGIN_STORAGE_COMMITMENT_SCP 0
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
118 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 9, 2)
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
119 # define HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API 1
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
120 #else
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
121 # define HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API 0
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
122 #endif
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
123
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
124 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 10, 1)
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
125 # define HAS_ORTHANC_PLUGIN_WEBDAV 1
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
126 #else
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
127 # define HAS_ORTHANC_PLUGIN_WEBDAV 0
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
128 #endif
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
129
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 namespace OrthancPlugins
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 typedef void (*RestCallback) (OrthancPluginRestOutput* output,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 const char* url,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 const OrthancPluginHttpRequest* request);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 void SetGlobalContext(OrthancPluginContext* context);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139
120
12ea59c97c40 sync orthanc folder + show timings + EnableAwsSdkLogs
Alain Mazy <am@osimis.io>
parents: 110
diff changeset
140 void ResetGlobalContext();
12ea59c97c40 sync orthanc folder + show timings + EnableAwsSdkLogs
Alain Mazy <am@osimis.io>
parents: 110
diff changeset
141
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 bool HasGlobalContext();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 OrthancPluginContext* GetGlobalContext();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 class OrthancImage;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 class MemoryBuffer : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 private:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 OrthancPluginMemoryBuffer buffer_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 void Check(OrthancPluginErrorCode code);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 bool CheckHttp(OrthancPluginErrorCode code);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 MemoryBuffer();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 7, 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 // This constructor makes a copy of the given buffer in the memory
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 // handled by the Orthanc core
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 MemoryBuffer(const void* buffer,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 size_t size);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 ~MemoryBuffer()
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 Clear();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 OrthancPluginMemoryBuffer* operator*()
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 return &buffer_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 // This transfers ownership from "other" to "this"
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 void Assign(OrthancPluginMemoryBuffer& other);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 void Swap(MemoryBuffer& other);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 OrthancPluginMemoryBuffer Release();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 const char* GetData() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 if (buffer_.size > 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 return reinterpret_cast<const char*>(buffer_.data);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 return NULL;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 size_t GetSize() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 return buffer_.size;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 bool IsEmpty() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 return GetSize() == 0 || GetData() == NULL;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 void Clear();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 void ToString(std::string& target) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 void ToJson(Json::Value& target) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 bool RestApiGet(const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 bool RestApiGet(const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 const std::map<std::string, std::string>& httpHeaders,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 bool RestApiPost(const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 const void* body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 size_t bodySize,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 bool RestApiPut(const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 const void* body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 size_t bodySize,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 bool RestApiPost(const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 const Json::Value& body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
235 #if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
236 bool RestApiPost(const std::string& uri,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
237 const Json::Value& body,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
238 const std::map<std::string, std::string>& httpHeaders,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
239 bool applyPlugins);
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
240
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
241 bool RestApiPost(const std::string& uri,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
242 const void* body,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
243 size_t bodySize,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
244 const std::map<std::string, std::string>& httpHeaders,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
245 bool applyPlugins);
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
246 #endif
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
247
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 bool RestApiPut(const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 const Json::Value& body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 bool RestApiPost(const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 const std::string& body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 bool applyPlugins)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 return RestApiPost(uri, body.empty() ? NULL : body.c_str(), body.size(), applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 bool RestApiPut(const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 const std::string& body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 bool applyPlugins)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 return RestApiPut(uri, body.empty() ? NULL : body.c_str(), body.size(), applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 void CreateDicom(const Json::Value& tags,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 OrthancPluginCreateDicomFlags flags);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 void CreateDicom(const Json::Value& tags,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 const OrthancImage& pixelData,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 OrthancPluginCreateDicomFlags flags);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 void ReadFile(const std::string& path);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 void GetDicomQuery(const OrthancPluginWorklistQuery* query);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 void DicomToJson(Json::Value& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 OrthancPluginDicomToJsonFormat format,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 OrthancPluginDicomToJsonFlags flags,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 uint32_t maxStringLength);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 bool HttpGet(const std::string& url,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 const std::string& username,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 const std::string& password);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 bool HttpPost(const std::string& url,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 const std::string& body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 const std::string& username,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 const std::string& password);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 bool HttpPut(const std::string& url,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 const std::string& body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 const std::string& username,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 const std::string& password);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 void GetDicomInstance(const std::string& instanceId);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 class OrthancString : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 private:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303 char* str_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 void Clear();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 OrthancString() :
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 str_(NULL)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
313 ~OrthancString()
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315 Clear();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 // This transfers ownership, warning: The string must have been
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319 // allocated by the Orthanc core
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 void Assign(char* str);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322 const char* GetContent() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324 return str_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
327 bool IsNullOrEmpty() const
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
328 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
329 return str_ == NULL || str_[0] == 0;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
330 }
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
331
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 void ToString(std::string& target) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 void ToJson(Json::Value& target) const;
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
335
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
336 void ToJsonWithoutComments(Json::Value& target) const;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
337 };
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 class OrthancConfiguration : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342 private:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 Json::Value configuration_; // Necessarily a Json::objectValue
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 std::string path_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346 std::string GetPath(const std::string& key) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348 void LoadConfiguration();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350 public:
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
351 OrthancConfiguration(); // loads the full Orthanc configuration
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353 explicit OrthancConfiguration(bool load);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
355 explicit OrthancConfiguration(const Json::Value& configuration, const std::string& path); // e.g. to load a section from a default json content
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
356
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 const Json::Value& GetJson() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359 return configuration_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362 bool IsSection(const std::string& key) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364 void GetSection(OrthancConfiguration& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 const std::string& key) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 bool LookupStringValue(std::string& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368 const std::string& key) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370 bool LookupIntegerValue(int& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371 const std::string& key) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 bool LookupUnsignedIntegerValue(unsigned int& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 const std::string& key) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 bool LookupBooleanValue(bool& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 const std::string& key) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 bool LookupFloatValue(float& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 const std::string& key) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382 bool LookupListOfStrings(std::list<std::string>& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383 const std::string& key,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384 bool allowSingleString) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 bool LookupSetOfStrings(std::set<std::string>& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 const std::string& key,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 bool allowSingleString) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 std::string GetStringValue(const std::string& key,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 const std::string& defaultValue) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393 int GetIntegerValue(const std::string& key,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394 int defaultValue) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 unsigned int GetUnsignedIntegerValue(const std::string& key,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397 unsigned int defaultValue) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 bool GetBooleanValue(const std::string& key,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 bool defaultValue) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 float GetFloatValue(const std::string& key,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 float defaultValue) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 void GetDictionary(std::map<std::string, std::string>& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 const std::string& key) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 class OrthancImage : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 private:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 OrthancPluginImage* image_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 void Clear();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416 void CheckImageAvailable() const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 OrthancImage();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 explicit OrthancImage(OrthancPluginImage* image);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423 OrthancImage(OrthancPluginPixelFormat format,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 uint32_t width,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425 uint32_t height);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 OrthancImage(OrthancPluginPixelFormat format,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 uint32_t width,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429 uint32_t height,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 uint32_t pitch,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431 void* buffer);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 ~OrthancImage()
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435 Clear();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 void UncompressPngImage(const void* data,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 size_t size);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441 void UncompressJpegImage(const void* data,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 size_t size);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444 void DecodeDicomImage(const void* data,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445 size_t size,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446 unsigned int frame);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448 OrthancPluginPixelFormat GetPixelFormat() const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
449
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
450 unsigned int GetWidth() const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452 unsigned int GetHeight() const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454 unsigned int GetPitch() const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456 void* GetBuffer() const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458 const OrthancPluginImage* GetObject() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 return image_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463 void CompressPngImage(MemoryBuffer& target) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465 void CompressJpegImage(MemoryBuffer& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466 uint8_t quality) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468 void AnswerPngImage(OrthancPluginRestOutput* output) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 void AnswerJpegImage(OrthancPluginRestOutput* output,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471 uint8_t quality) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473 void* GetWriteableBuffer();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 OrthancPluginImage* Release();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
476 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479 #if HAS_ORTHANC_PLUGIN_FIND_MATCHER == 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480 class FindMatcher : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482 private:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483 OrthancPluginFindMatcher* matcher_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 const OrthancPluginWorklistQuery* worklist_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486 void SetupDicom(const void* query,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 uint32_t size);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490 explicit FindMatcher(const OrthancPluginWorklistQuery* worklist);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
491
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
492 FindMatcher(const void* query,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
493 uint32_t size)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
494 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
495 SetupDicom(query, size);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
496 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
497
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
498 explicit FindMatcher(const MemoryBuffer& dicom)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
499 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
500 SetupDicom(dicom.GetData(), dicom.GetSize());
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
501 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503 ~FindMatcher();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
504
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
505 bool IsMatch(const void* dicom,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
506 uint32_t size) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
507
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
508 bool IsMatch(const MemoryBuffer& dicom) const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
509 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510 return IsMatch(dicom.GetData(), dicom.GetSize());
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
513 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
514
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
515
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
516 bool ReadJson(Json::Value& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
517 const std::string& source);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
518
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
519 bool ReadJson(Json::Value& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
520 const void* buffer,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
521 size_t size);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
522
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
523 bool ReadJsonWithoutComments(Json::Value& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
524 const std::string& source);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
525
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
526 bool ReadJsonWithoutComments(Json::Value& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
527 const void* buffer,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
528 size_t size);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
529
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530 void WriteFastJson(std::string& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531 const Json::Value& source);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533 void WriteStyledJson(std::string& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534 const Json::Value& source);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
535
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
536 bool RestApiGet(Json::Value& result,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
537 const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
538 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
539
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
540 bool RestApiGet(Json::Value& result,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
541 const std::string& uri,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
542 const std::map<std::string, std::string>& httpHeaders,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
543 bool applyPlugins);
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
544
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
545 bool RestApiGetString(std::string& result,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
546 const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
547 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
548
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
549 bool RestApiGetString(std::string& result,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
550 const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
551 const std::map<std::string, std::string>& httpHeaders,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
552 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
553
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
554 bool RestApiPost(std::string& result,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
555 const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
556 const void* body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
557 size_t bodySize,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
558 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
559
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
560 bool RestApiPost(Json::Value& result,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
561 const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
562 const void* body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
563 size_t bodySize,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
564 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
565
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
566 #if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
567 bool RestApiPost(Json::Value& result,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
568 const std::string& uri,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
569 const Json::Value& body,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
570 const std::map<std::string, std::string>& httpHeaders,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
571 bool applyPlugins);
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
572 #endif
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
573
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
574 bool RestApiPost(Json::Value& result,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
575 const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
576 const Json::Value& body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
577 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
578
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
579 inline bool RestApiPost(Json::Value& result,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
580 const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
581 const std::string& body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
582 bool applyPlugins)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
583 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
584 return RestApiPost(result, uri, body.empty() ? NULL : body.c_str(),
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
585 body.size(), applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
586 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
587
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
588 inline bool RestApiPost(Json::Value& result,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
589 const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
590 const MemoryBuffer& body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
591 bool applyPlugins)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
592 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
593 return RestApiPost(result, uri, body.GetData(),
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
594 body.GetSize(), applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
595 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
596
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
597 bool RestApiPut(Json::Value& result,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
598 const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
599 const void* body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
600 size_t bodySize,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
601 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
602
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
603 bool RestApiPut(Json::Value& result,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
604 const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
605 const Json::Value& body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
606 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
607
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
608 inline bool RestApiPut(Json::Value& result,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
609 const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
610 const std::string& body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
611 bool applyPlugins)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
612 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
613 return RestApiPut(result, uri, body.empty() ? NULL : body.c_str(),
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
614 body.size(), applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
615 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
616
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
617 bool RestApiDelete(const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
618 bool applyPlugins);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
619
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
620 bool HttpDelete(const std::string& url,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
621 const std::string& username,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
622 const std::string& password);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
623
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
624 void AnswerJson(const Json::Value& value,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
625 OrthancPluginRestOutput* output);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
626
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
627 void AnswerString(const std::string& answer,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
628 const char* mimeType,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
629 OrthancPluginRestOutput* output);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
630
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
631 void AnswerHttpError(uint16_t httpError,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
632 OrthancPluginRestOutput* output);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
633
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
634 void AnswerMethodNotAllowed(OrthancPluginRestOutput* output, const char* allowedMethods);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
635
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
636 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
637 const char* AutodetectMimeType(const std::string& path);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
638 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
639
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
640 void LogError(const std::string& message);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
641
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
642 void LogWarning(const std::string& message);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
643
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
644 void LogInfo(const std::string& message);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
645
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
646 void ReportMinimalOrthancVersion(unsigned int major,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
647 unsigned int minor,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
648 unsigned int revision);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
649
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
650 bool CheckMinimalOrthancVersion(unsigned int major,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
651 unsigned int minor,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
652 unsigned int revision);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
653
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
654 bool CheckMinimalVersion(const char* version,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
655 unsigned int major,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
656 unsigned int minor,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
657 unsigned int revision);
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
658
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
659 namespace Internals
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
660 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
661 template <RestCallback Callback>
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
662 static OrthancPluginErrorCode Protect(OrthancPluginRestOutput* output,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
663 const char* url,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
664 const OrthancPluginHttpRequest* request)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
665 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
666 try
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
667 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
668 Callback(output, url, request);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
669 return OrthancPluginErrorCode_Success;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
670 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
671 catch (ORTHANC_PLUGINS_EXCEPTION_CLASS& e)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
672 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
673 #if HAS_ORTHANC_EXCEPTION == 1 && HAS_ORTHANC_PLUGIN_EXCEPTION_DETAILS == 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
674 if (HasGlobalContext() &&
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
675 e.HasDetails())
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
676 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
677 // The "false" instructs Orthanc not to log the detailed
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
678 // error message. This is to avoid duplicating the details,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
679 // because "OrthancException" already does it on construction.
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
680 OrthancPluginSetHttpErrorDetails
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
681 (GetGlobalContext(), output, e.GetDetails(), false);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
682 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
683 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
684
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
685 return static_cast<OrthancPluginErrorCode>(e.GetErrorCode());
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
686 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
687 catch (boost::bad_lexical_cast&)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
688 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
689 return OrthancPluginErrorCode_BadFileFormat;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
690 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
691 catch (...)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
692 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
693 return OrthancPluginErrorCode_Plugin;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
694 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
695 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
696 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
697
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
698
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
699 template <RestCallback Callback>
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
700 void RegisterRestCallback(const std::string& uri,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
701 bool isThreadSafe)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
702 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
703 if (isThreadSafe)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
704 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
705 OrthancPluginRegisterRestCallbackNoLock
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
706 (GetGlobalContext(), uri.c_str(), Internals::Protect<Callback>);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
707 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
708 else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
709 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
710 OrthancPluginRegisterRestCallback
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
711 (GetGlobalContext(), uri.c_str(), Internals::Protect<Callback>);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
712 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
713 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
714
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
715
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
716 #if HAS_ORTHANC_PLUGIN_PEERS == 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
717 class OrthancPeers : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
718 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
719 private:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
720 typedef std::map<std::string, uint32_t> Index;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
721
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
722 OrthancPluginPeers *peers_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
723 Index index_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
724 uint32_t timeout_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
725
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
726 size_t GetPeerIndex(const std::string& name) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
727
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
728 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
729 OrthancPeers();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
730
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
731 ~OrthancPeers();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
732
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
733 uint32_t GetTimeout() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
734 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
735 return timeout_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
736 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
737
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
738 void SetTimeout(uint32_t timeout)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
739 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
740 timeout_ = timeout;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
741 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
742
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
743 bool LookupName(size_t& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
744 const std::string& name) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
745
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
746 std::string GetPeerName(size_t index) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
747
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
748 std::string GetPeerUrl(size_t index) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
749
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
750 std::string GetPeerUrl(const std::string& name) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
751
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
752 size_t GetPeersCount() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
753 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
754 return index_.size();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
755 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
756
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
757 bool LookupUserProperty(std::string& value,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
758 size_t index,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
759 const std::string& key) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
760
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
761 bool LookupUserProperty(std::string& value,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
762 const std::string& peer,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
763 const std::string& key) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
764
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
765 bool DoGet(MemoryBuffer& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
766 size_t index,
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
767 const std::string& uri,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
768 const std::map<std::string, std::string>& headers) const;
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
769
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
770 bool DoGet(MemoryBuffer& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
771 const std::string& name,
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
772 const std::string& uri,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
773 const std::map<std::string, std::string>& headers) const;
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
774
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
775 bool DoGet(Json::Value& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
776 size_t index,
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
777 const std::string& uri,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
778 const std::map<std::string, std::string>& headers) const;
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
779
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
780 bool DoGet(Json::Value& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
781 const std::string& name,
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
782 const std::string& uri,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
783 const std::map<std::string, std::string>& headers) const;
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
784
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
785 bool DoPost(MemoryBuffer& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
786 size_t index,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
787 const std::string& uri,
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
788 const std::string& body,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
789 const std::map<std::string, std::string>& headers) const;
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
790
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
791 bool DoPost(MemoryBuffer& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
792 const std::string& name,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
793 const std::string& uri,
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
794 const std::string& body,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
795 const std::map<std::string, std::string>& headers) const;
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
796
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
797 bool DoPost(Json::Value& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
798 size_t index,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
799 const std::string& uri,
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
800 const std::string& body,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
801 const std::map<std::string, std::string>& headers) const;
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
802
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
803 bool DoPost(Json::Value& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
804 const std::string& name,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
805 const std::string& uri,
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
806 const std::string& body,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
807 const std::map<std::string, std::string>& headers) const;
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
808
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
809 bool DoPut(size_t index,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
810 const std::string& uri,
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
811 const std::string& body,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
812 const std::map<std::string, std::string>& headers) const;
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
813
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
814 bool DoPut(const std::string& name,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
815 const std::string& uri,
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
816 const std::string& body,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
817 const std::map<std::string, std::string>& headers) const;
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
818
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
819 bool DoDelete(size_t index,
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
820 const std::string& uri,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
821 const std::map<std::string, std::string>& headers) const;
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
822
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
823 bool DoDelete(const std::string& name,
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
824 const std::string& uri,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
825 const std::map<std::string, std::string>& headers) const;
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
826 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
827 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
828
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
829
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
830
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
831 #if HAS_ORTHANC_PLUGIN_JOB == 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
832 class OrthancJob : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
833 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
834 private:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
835 std::string jobType_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
836 std::string content_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
837 bool hasSerialized_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
838 std::string serialized_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
839 float progress_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
840
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
841 static void CallbackFinalize(void* job);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
842
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
843 static float CallbackGetProgress(void* job);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
844
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
845 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 11, 3)
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
846 static OrthancPluginErrorCode CallbackGetContent(OrthancPluginMemoryBuffer* target,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
847 void* job);
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
848 #else
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
849 static const char* CallbackGetContent(void* job);
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
850 #endif
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
851
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
852 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 11, 3)
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
853 static int32_t CallbackGetSerialized(OrthancPluginMemoryBuffer* target,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
854 void* job);
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
855 #else
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
856 static const char* CallbackGetSerialized(void* job);
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
857 #endif
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
858
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
859 static OrthancPluginJobStepStatus CallbackStep(void* job);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
860
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
861 static OrthancPluginErrorCode CallbackStop(void* job,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
862 OrthancPluginJobStopReason reason);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
863
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
864 static OrthancPluginErrorCode CallbackReset(void* job);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
865
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
866 protected:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
867 void ClearContent();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
868
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
869 void UpdateContent(const Json::Value& content);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
870
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
871 void ClearSerialized();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
872
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
873 void UpdateSerialized(const Json::Value& serialized);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
874
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
875 void UpdateProgress(float progress);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
876
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
877 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
878 explicit OrthancJob(const std::string& jobType);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
879
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
880 virtual ~OrthancJob()
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
881 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
882 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
883
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
884 virtual OrthancPluginJobStepStatus Step() = 0;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
885
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
886 virtual void Stop(OrthancPluginJobStopReason reason) = 0;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
887
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
888 virtual void Reset() = 0;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
889
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
890 static OrthancPluginJob* Create(OrthancJob* job /* takes ownership */);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
891
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
892 static std::string Submit(OrthancJob* job /* takes ownership */,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
893 int priority);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
894
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
895 static void SubmitAndWait(Json::Value& result,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
896 OrthancJob* job /* takes ownership */,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
897 int priority);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
898
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
899 // Submit a job from a POST on the REST API with the same
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
900 // conventions as in the Orthanc core (according to the
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
901 // "Synchronous" and "Priority" options)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
902 static void SubmitFromRestApiPost(OrthancPluginRestOutput* output,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
903 const Json::Value& body,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
904 OrthancJob* job);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
905 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
906 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
907
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
908
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
909 #if HAS_ORTHANC_PLUGIN_METRICS == 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
910 inline void SetMetricsValue(char* name,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
911 float value)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
912 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
913 OrthancPluginSetMetricsValue(GetGlobalContext(), name,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
914 value, OrthancPluginMetricsType_Default);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
915 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
916
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
917 class MetricsTimer : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
918 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
919 private:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
920 std::string name_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
921 boost::posix_time::ptime start_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
922
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
923 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
924 explicit MetricsTimer(const char* name);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
925
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
926 ~MetricsTimer();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
927 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
928 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
929
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
930
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
931 #if HAS_ORTHANC_PLUGIN_HTTP_CLIENT == 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
932 class HttpClient : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
933 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
934 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
935 typedef std::map<std::string, std::string> HttpHeaders;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
936
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
937 class IRequestBody : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
938 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
939 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
940 virtual ~IRequestBody()
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
941 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
942 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
943
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
944 virtual bool ReadNextChunk(std::string& chunk) = 0;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
945 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
946
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
947
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
948 class IAnswer : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
949 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
950 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
951 virtual ~IAnswer()
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
952 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
953 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
954
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
955 virtual void AddHeader(const std::string& key,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
956 const std::string& value) = 0;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
957
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
958 virtual void AddChunk(const void* data,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
959 size_t size) = 0;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
960 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
961
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
962
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
963 private:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
964 class RequestBodyWrapper;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
965
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
966 uint16_t httpStatus_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
967 OrthancPluginHttpMethod method_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
968 std::string url_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
969 HttpHeaders headers_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
970 std::string username_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
971 std::string password_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
972 uint32_t timeout_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
973 std::string certificateFile_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
974 std::string certificateKeyFile_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
975 std::string certificateKeyPassword_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
976 bool pkcs11_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
977 std::string fullBody_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
978 IRequestBody* chunkedBody_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
979 bool allowChunkedTransfers_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
980
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
981 #if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT == 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
982 void ExecuteWithStream(uint16_t& httpStatus, // out
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
983 IAnswer& answer, // out
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
984 IRequestBody& body) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
985 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
986
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
987 void ExecuteWithoutStream(uint16_t& httpStatus, // out
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
988 HttpHeaders& answerHeaders, // out
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
989 std::string& answerBody, // out
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
990 const std::string& body) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
991
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
992 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
993 HttpClient();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
994
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
995 uint16_t GetHttpStatus() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
996 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
997 return httpStatus_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
998 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
999
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1000 void SetMethod(OrthancPluginHttpMethod method)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1001 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1002 method_ = method;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1003 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1004
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1005 const std::string& GetUrl() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1006 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1007 return url_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1008 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1009
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1010 void SetUrl(const std::string& url)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1011 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1012 url_ = url;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1013 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1014
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1015 void SetHeaders(const HttpHeaders& headers)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1016 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1017 headers_ = headers;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1018 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1019
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1020 void AddHeader(const std::string& key,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1021 const std::string& value)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1022 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1023 headers_[key] = value;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1024 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1025
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1026 void AddHeaders(const HttpHeaders& headers);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1027
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1028 void SetCredentials(const std::string& username,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1029 const std::string& password);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1030
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1031 void ClearCredentials();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1032
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1033 void SetTimeout(unsigned int timeout) // 0 for default timeout
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1034 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1035 timeout_ = timeout;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1036 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1037
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1038 void SetCertificate(const std::string& certificateFile,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1039 const std::string& keyFile,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1040 const std::string& keyPassword);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1041
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1042 void ClearCertificate();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1043
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1044 void SetPkcs11(bool pkcs11)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1045 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1046 pkcs11_ = pkcs11;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1047 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1048
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1049 void ClearBody();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1050
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1051 void SwapBody(std::string& body);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1052
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1053 void SetBody(const std::string& body);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1054
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1055 void SetBody(IRequestBody& body);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1056
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1057 // This function can be used to disable chunked transfers if the
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1058 // remote server is Orthanc with a version <= 1.5.6.
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1059 void SetChunkedTransfersAllowed(bool allow)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1060 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1061 allowChunkedTransfers_ = allow;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1062 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1063
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1064 bool IsChunkedTransfersAllowed() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1065 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1066 return allowChunkedTransfers_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1067 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1068
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1069 void Execute(IAnswer& answer);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1070
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1071 void Execute(HttpHeaders& answerHeaders /* out */,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1072 std::string& answerBody /* out */);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1073
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1074 void Execute(HttpHeaders& answerHeaders /* out */,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1075 Json::Value& answerBody /* out */);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1076
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1077 void Execute();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1078 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1079 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1080
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1081
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1082
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1083 class IChunkedRequestReader : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1084 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1085 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1086 virtual ~IChunkedRequestReader()
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1087 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1088 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1089
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1090 virtual void AddChunk(const void* data,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1091 size_t size) = 0;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1092
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1093 virtual void Execute(OrthancPluginRestOutput* output) = 0;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1094 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1095
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1096
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1097 typedef IChunkedRequestReader* (*ChunkedRestCallback) (const char* url,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1098 const OrthancPluginHttpRequest* request);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1099
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1100
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1101 namespace Internals
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1102 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1103 void NullRestCallback(OrthancPluginRestOutput* output,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1104 const char* url,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1105 const OrthancPluginHttpRequest* request);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1106
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1107 IChunkedRequestReader *NullChunkedRestCallback(const char* url,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1108 const OrthancPluginHttpRequest* request);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1109
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1110
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1111 #if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_SERVER == 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1112 template <ChunkedRestCallback Callback>
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1113 static OrthancPluginErrorCode ChunkedProtect(OrthancPluginServerChunkedRequestReader** reader,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1114 const char* url,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1115 const OrthancPluginHttpRequest* request)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1116 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1117 try
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1118 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1119 if (reader == NULL)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1120 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1121 return OrthancPluginErrorCode_InternalError;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1122 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1123 else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1124 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1125 *reader = reinterpret_cast<OrthancPluginServerChunkedRequestReader*>(Callback(url, request));
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1126 if (*reader == NULL)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1127 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1128 return OrthancPluginErrorCode_Plugin;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1129 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1130 else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1131 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1132 return OrthancPluginErrorCode_Success;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1133 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1134 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1135 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1136 catch (ORTHANC_PLUGINS_EXCEPTION_CLASS& e)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1137 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1138 return static_cast<OrthancPluginErrorCode>(e.GetErrorCode());
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1139 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1140 catch (boost::bad_lexical_cast&)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1141 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1142 return OrthancPluginErrorCode_BadFileFormat;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1143 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1144 catch (...)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1145 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1146 return OrthancPluginErrorCode_Plugin;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1147 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1148 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1149
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1150 OrthancPluginErrorCode ChunkedRequestReaderAddChunk(
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1151 OrthancPluginServerChunkedRequestReader* reader,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1152 const void* data,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1153 uint32_t size);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1154
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1155 OrthancPluginErrorCode ChunkedRequestReaderExecute(
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1156 OrthancPluginServerChunkedRequestReader* reader,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1157 OrthancPluginRestOutput* output);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1158
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1159 void ChunkedRequestReaderFinalize(
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1160 OrthancPluginServerChunkedRequestReader* reader);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1161
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1162 #else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1163
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1164 OrthancPluginErrorCode ChunkedRestCompatibility(OrthancPluginRestOutput* output,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1165 const char* url,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1166 const OrthancPluginHttpRequest* request,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1167 RestCallback GetHandler,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1168 ChunkedRestCallback PostHandler,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1169 RestCallback DeleteHandler,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1170 ChunkedRestCallback PutHandler);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1171
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1172 template<
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1173 RestCallback GetHandler,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1174 ChunkedRestCallback PostHandler,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1175 RestCallback DeleteHandler,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1176 ChunkedRestCallback PutHandler
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1177 >
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1178 inline OrthancPluginErrorCode ChunkedRestCompatibility(OrthancPluginRestOutput* output,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1179 const char* url,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1180 const OrthancPluginHttpRequest* request)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1181 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1182 return ChunkedRestCompatibility(output, url, request, GetHandler,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1183 PostHandler, DeleteHandler, PutHandler);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1184 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1185 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1186 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1187
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1188
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1189
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1190 // NB: We use a templated class instead of a templated function, because
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1191 // default values are only available in functions since C++11
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1192 template<
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1193 RestCallback GetHandler = Internals::NullRestCallback,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1194 ChunkedRestCallback PostHandler = Internals::NullChunkedRestCallback,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1195 RestCallback DeleteHandler = Internals::NullRestCallback,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1196 ChunkedRestCallback PutHandler = Internals::NullChunkedRestCallback
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1197 >
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1198 class ChunkedRestRegistration : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1199 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1200 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1201 static void Apply(const std::string& uri)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1202 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1203 #if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_SERVER == 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1204 OrthancPluginRegisterChunkedRestCallback(
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1205 GetGlobalContext(), uri.c_str(),
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1206 GetHandler == Internals::NullRestCallback ? NULL : Internals::Protect<GetHandler>,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1207 PostHandler == Internals::NullChunkedRestCallback ? NULL : Internals::ChunkedProtect<PostHandler>,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1208 DeleteHandler == Internals::NullRestCallback ? NULL : Internals::Protect<DeleteHandler>,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1209 PutHandler == Internals::NullChunkedRestCallback ? NULL : Internals::ChunkedProtect<PutHandler>,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1210 Internals::ChunkedRequestReaderAddChunk,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1211 Internals::ChunkedRequestReaderExecute,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1212 Internals::ChunkedRequestReaderFinalize);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1213 #else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1214 OrthancPluginRegisterRestCallbackNoLock(
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1215 GetGlobalContext(), uri.c_str(),
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1216 Internals::ChunkedRestCompatibility<GetHandler, PostHandler, DeleteHandler, PutHandler>);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1217 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1218 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1219 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1220
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1221
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1222
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1223 #if HAS_ORTHANC_PLUGIN_STORAGE_COMMITMENT_SCP == 1
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1224 class IStorageCommitmentScpHandler : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1225 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1226 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1227 virtual ~IStorageCommitmentScpHandler()
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1228 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1229 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1230
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1231 virtual OrthancPluginStorageCommitmentFailureReason Lookup(const std::string& sopClassUid,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1232 const std::string& sopInstanceUid) = 0;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1233
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1234 static OrthancPluginErrorCode Lookup(OrthancPluginStorageCommitmentFailureReason* target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1235 void* rawHandler,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1236 const char* sopClassUid,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1237 const char* sopInstanceUid);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1238
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1239 static void Destructor(void* rawHandler);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1240 };
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1241 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1242
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1243
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1244 class DicomInstance : public boost::noncopyable
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1245 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1246 private:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1247 bool toFree_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1248
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1249 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 6, 1)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1250 const OrthancPluginDicomInstance* instance_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1251 #else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1252 OrthancPluginDicomInstance* instance_;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1253 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1254
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1255 public:
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1256 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 6, 1)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1257 explicit DicomInstance(const OrthancPluginDicomInstance* instance);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1258 #else
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1259 explicit DicomInstance(OrthancPluginDicomInstance* instance);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1260 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1261
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1262 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 7, 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1263 DicomInstance(const void* buffer,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1264 size_t size);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1265 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1266
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1267 ~DicomInstance();
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1268
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1269 const OrthancPluginDicomInstance* GetObject() const
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1270 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1271 return instance_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1272 }
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1273
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1274 std::string GetRemoteAet() const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1275
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1276 const void* GetBuffer() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1277 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1278 return OrthancPluginGetInstanceData(GetGlobalContext(), instance_);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1279 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1280
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1281 size_t GetSize() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1282 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1283 return static_cast<size_t>(OrthancPluginGetInstanceSize(GetGlobalContext(), instance_));
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1284 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1285
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1286 void GetJson(Json::Value& target) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1287
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1288 void GetSimplifiedJson(Json::Value& target) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1289
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1290 OrthancPluginInstanceOrigin GetOrigin() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1291 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1292 return OrthancPluginGetInstanceOrigin(GetGlobalContext(), instance_);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1293 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1294
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1295 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 6, 1)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1296 std::string GetTransferSyntaxUid() const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1297 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1298
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1299 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 6, 1)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1300 bool HasPixelData() const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1301 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1302
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1303 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 7, 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1304 unsigned int GetFramesCount() const
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1305 {
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1306 return OrthancPluginGetInstanceFramesCount(GetGlobalContext(), instance_);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1307 }
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1308 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1309
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1310 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 7, 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1311 void GetRawFrame(std::string& target,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1312 unsigned int frameIndex) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1313 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1314
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1315 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 7, 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1316 OrthancImage* GetDecodedFrame(unsigned int frameIndex) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1317 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1318
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1319 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 7, 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1320 void Serialize(std::string& target) const;
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1321 #endif
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1322
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1323 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 7, 0)
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1324 static DicomInstance* Transcode(const void* buffer,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1325 size_t size,
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1326 const std::string& transferSyntax);
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1327 #endif
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1328
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1329 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 1)
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1330 static DicomInstance* Load(const std::string& instanceId,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1331 OrthancPluginLoadDicomInstanceMode mode);
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1332 #endif
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1333 };
110
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1334
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1335 // helper method to convert Http headers from the plugin SDK to a std::map
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1336 void GetHttpHeaders(std::map<std::string, std::string>& result, const OrthancPluginHttpRequest* request);
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1337
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1338 #if HAS_ORTHANC_PLUGIN_WEBDAV == 1
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1339 class IWebDavCollection : public boost::noncopyable
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1340 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1341 public:
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1342 class FileInfo
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1343 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1344 private:
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1345 std::string name_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1346 uint64_t contentSize_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1347 std::string mime_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1348 std::string dateTime_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1349
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1350 public:
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1351 FileInfo(const std::string& name,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1352 uint64_t contentSize,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1353 const std::string& dateTime) :
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1354 name_(name),
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1355 contentSize_(contentSize),
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1356 dateTime_(dateTime)
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1357 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1358 }
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1359
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1360 const std::string& GetName() const
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1361 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1362 return name_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1363 }
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1364
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1365 uint64_t GetContentSize() const
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1366 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1367 return contentSize_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1368 }
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1369
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1370 void SetMimeType(const std::string& mime)
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1371 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1372 mime_ = mime;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1373 }
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1374
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1375 const std::string& GetMimeType() const
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1376 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1377 return mime_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1378 }
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1379
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1380 const std::string& GetDateTime() const
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1381 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1382 return dateTime_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1383 }
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1384 };
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1385
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1386 class FolderInfo
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1387 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1388 private:
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1389 std::string name_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1390 std::string dateTime_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1391
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1392 public:
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1393 FolderInfo(const std::string& name,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1394 const std::string& dateTime) :
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1395 name_(name),
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1396 dateTime_(dateTime)
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1397 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1398 }
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1399
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1400 const std::string& GetName() const
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1401 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1402 return name_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1403 }
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1404
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1405 const std::string& GetDateTime() const
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1406 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1407 return dateTime_;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1408 }
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1409 };
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1410
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1411 virtual ~IWebDavCollection()
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1412 {
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1413 }
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1414
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1415 virtual bool IsExistingFolder(const std::vector<std::string>& path) = 0;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1416
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1417 virtual bool ListFolder(std::list<FileInfo>& files,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1418 std::list<FolderInfo>& subfolders,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1419 const std::vector<std::string>& path) = 0;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1420
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1421 virtual bool GetFile(std::string& content /* out */,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1422 std::string& mime /* out */,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1423 std::string& dateTime /* out */,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1424 const std::vector<std::string>& path) = 0;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1425
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1426 virtual bool StoreFile(const std::vector<std::string>& path,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1427 const void* data,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1428 size_t size) = 0;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1429
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1430 virtual bool CreateFolder(const std::vector<std::string>& path) = 0;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1431
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1432 virtual bool DeleteItem(const std::vector<std::string>& path) = 0;
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1433
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1434 static void Register(const std::string& uri,
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1435 IWebDavCollection& collection);
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1436 };
37a4b8e2577f sync orthanc + SDK 1.12.1
Alain Mazy <am@osimis.io>
parents: 59
diff changeset
1437 #endif
59
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1438 }