comparison OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.h @ 5049:8c9a1cce076e

CPP Wrapper: new helpers
author Alain Mazy <am@osimis.io>
date Wed, 29 Jun 2022 15:32:44 +0200
parents 501411a67f10
children fcb2ed6c88ff
comparison
equal deleted inserted replaced
5048:22966345eaba 5049:8c9a1cce076e
113 # define HAS_ORTHANC_PLUGIN_STORAGE_COMMITMENT_SCP 1 113 # define HAS_ORTHANC_PLUGIN_STORAGE_COMMITMENT_SCP 1
114 #else 114 #else
115 # define HAS_ORTHANC_PLUGIN_STORAGE_COMMITMENT_SCP 0 115 # define HAS_ORTHANC_PLUGIN_STORAGE_COMMITMENT_SCP 0
116 #endif 116 #endif
117 117
118 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 9, 2)
119 # define HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API 1
120 #else
121 # define HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API 0
122 #endif
123
118 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 10, 1) 124 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 10, 1)
119 # define HAS_ORTHANC_PLUGIN_WEBDAV 1 125 # define HAS_ORTHANC_PLUGIN_WEBDAV 1
120 #else 126 #else
121 # define HAS_ORTHANC_PLUGIN_WEBDAV 0 127 # define HAS_ORTHANC_PLUGIN_WEBDAV 0
122 #endif 128 #endif
221 bool applyPlugins); 227 bool applyPlugins);
222 228
223 bool RestApiPost(const std::string& uri, 229 bool RestApiPost(const std::string& uri,
224 const Json::Value& body, 230 const Json::Value& body,
225 bool applyPlugins); 231 bool applyPlugins);
232
233 #if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1
234 bool RestApiPost(const std::string& uri,
235 const Json::Value& body,
236 const std::map<std::string, std::string>& httpHeaders,
237 bool applyPlugins);
238
239 bool RestApiPost(const std::string& uri,
240 const void* body,
241 size_t bodySize,
242 const std::map<std::string, std::string>& httpHeaders,
243 bool applyPlugins);
244 #endif
226 245
227 bool RestApiPut(const std::string& uri, 246 bool RestApiPut(const std::string& uri,
228 const Json::Value& body, 247 const Json::Value& body,
229 bool applyPlugins); 248 bool applyPlugins);
230 249
532 bool RestApiPost(Json::Value& result, 551 bool RestApiPost(Json::Value& result,
533 const std::string& uri, 552 const std::string& uri,
534 const void* body, 553 const void* body,
535 size_t bodySize, 554 size_t bodySize,
536 bool applyPlugins); 555 bool applyPlugins);
556
557 #if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1
558 bool RestApiPost(Json::Value& result,
559 const std::string& uri,
560 const Json::Value& body,
561 const std::map<std::string, std::string>& httpHeaders,
562 bool applyPlugins);
563 #endif
537 564
538 bool RestApiPost(Json::Value& result, 565 bool RestApiPost(Json::Value& result,
539 const std::string& uri, 566 const std::string& uri,
540 const Json::Value& body, 567 const Json::Value& body,
541 bool applyPlugins); 568 bool applyPlugins);
1262 size_t size, 1289 size_t size,
1263 const std::string& transferSyntax); 1290 const std::string& transferSyntax);
1264 #endif 1291 #endif
1265 }; 1292 };
1266 1293
1267 1294 // helper method to convert Http headers from the plugin SDK to a std::map
1295 void GetHttpHeaders(std::map<std::string, std::string>& result, const OrthancPluginHttpRequest* request);
1268 1296
1269 #if HAS_ORTHANC_PLUGIN_WEBDAV == 1 1297 #if HAS_ORTHANC_PLUGIN_WEBDAV == 1
1270 class IWebDavCollection : public boost::noncopyable 1298 class IWebDavCollection : public boost::noncopyable
1271 { 1299 {
1272 public: 1300 public: