Mercurial > hg > orthanc-stone
comparison RenderingPlugin/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h @ 2077:07964689cb0b
upgrade to year 2023
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 12 Jul 2023 21:20:22 +0200 |
parents | c0aa4b03f219 |
children | 517ef20aef74 |
comparison
equal
deleted
inserted
replaced
2076:990f396484b1 | 2077:07964689cb0b |
---|---|
1 /** | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
4 * Department, University Hospital of Liege, Belgium | 4 * Department, University Hospital of Liege, Belgium |
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium | 5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | 6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
7 * | 7 * |
8 * This program is free software: you can redistribute it and/or | 8 * This program is free software: you can redistribute it and/or |
9 * modify it under the terms of the GNU General Public License as | 9 * modify it under the terms of the GNU General Public License as |
10 * published by the Free Software Foundation, either version 3 of the | 10 * published by the Free Software Foundation, either version 3 of the |
11 * License, or (at your option) any later version. | 11 * License, or (at your option) any later version. |
344 std::string GetPath(const std::string& key) const; | 344 std::string GetPath(const std::string& key) const; |
345 | 345 |
346 void LoadConfiguration(); | 346 void LoadConfiguration(); |
347 | 347 |
348 public: | 348 public: |
349 OrthancConfiguration(); | 349 OrthancConfiguration(); // loads the full Orthanc configuration |
350 | 350 |
351 explicit OrthancConfiguration(bool load); | 351 explicit OrthancConfiguration(bool load); |
352 | |
353 explicit OrthancConfiguration(const Json::Value& configuration, const std::string& path); // e.g. to load a section from a default json content | |
352 | 354 |
353 const Json::Value& GetJson() const | 355 const Json::Value& GetJson() const |
354 { | 356 { |
355 return configuration_; | 357 return configuration_; |
356 } | 358 } |
529 void WriteStyledJson(std::string& target, | 531 void WriteStyledJson(std::string& target, |
530 const Json::Value& source); | 532 const Json::Value& source); |
531 | 533 |
532 bool RestApiGet(Json::Value& result, | 534 bool RestApiGet(Json::Value& result, |
533 const std::string& uri, | 535 const std::string& uri, |
536 bool applyPlugins); | |
537 | |
538 bool RestApiGet(Json::Value& result, | |
539 const std::string& uri, | |
540 const std::map<std::string, std::string>& httpHeaders, | |
534 bool applyPlugins); | 541 bool applyPlugins); |
535 | 542 |
536 bool RestApiGetString(std::string& result, | 543 bool RestApiGetString(std::string& result, |
537 const std::string& uri, | 544 const std::string& uri, |
538 bool applyPlugins); | 545 bool applyPlugins); |
831 | 838 |
832 static void CallbackFinalize(void* job); | 839 static void CallbackFinalize(void* job); |
833 | 840 |
834 static float CallbackGetProgress(void* job); | 841 static float CallbackGetProgress(void* job); |
835 | 842 |
843 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 11, 3) | |
844 static OrthancPluginErrorCode CallbackGetContent(OrthancPluginMemoryBuffer* target, | |
845 void* job); | |
846 #else | |
836 static const char* CallbackGetContent(void* job); | 847 static const char* CallbackGetContent(void* job); |
837 | 848 #endif |
849 | |
850 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 11, 3) | |
851 static int32_t CallbackGetSerialized(OrthancPluginMemoryBuffer* target, | |
852 void* job); | |
853 #else | |
838 static const char* CallbackGetSerialized(void* job); | 854 static const char* CallbackGetSerialized(void* job); |
855 #endif | |
839 | 856 |
840 static OrthancPluginJobStepStatus CallbackStep(void* job); | 857 static OrthancPluginJobStepStatus CallbackStep(void* job); |
841 | 858 |
842 static OrthancPluginErrorCode CallbackStop(void* job, | 859 static OrthancPluginErrorCode CallbackStop(void* job, |
843 OrthancPluginJobStopReason reason); | 860 OrthancPluginJobStopReason reason); |
1245 size_t size); | 1262 size_t size); |
1246 #endif | 1263 #endif |
1247 | 1264 |
1248 ~DicomInstance(); | 1265 ~DicomInstance(); |
1249 | 1266 |
1267 const OrthancPluginDicomInstance* GetObject() const | |
1268 { | |
1269 return instance_; | |
1270 } | |
1271 | |
1250 std::string GetRemoteAet() const; | 1272 std::string GetRemoteAet() const; |
1251 | 1273 |
1252 const void* GetBuffer() const | 1274 const void* GetBuffer() const |
1253 { | 1275 { |
1254 return OrthancPluginGetInstanceData(GetGlobalContext(), instance_); | 1276 return OrthancPluginGetInstanceData(GetGlobalContext(), instance_); |
1298 | 1320 |
1299 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 7, 0) | 1321 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 7, 0) |
1300 static DicomInstance* Transcode(const void* buffer, | 1322 static DicomInstance* Transcode(const void* buffer, |
1301 size_t size, | 1323 size_t size, |
1302 const std::string& transferSyntax); | 1324 const std::string& transferSyntax); |
1325 #endif | |
1326 | |
1327 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 1) | |
1328 static DicomInstance* Load(const std::string& instanceId, | |
1329 OrthancPluginLoadDicomInstanceMode mode); | |
1303 #endif | 1330 #endif |
1304 }; | 1331 }; |
1305 | 1332 |
1306 // helper method to convert Http headers from the plugin SDK to a std::map | 1333 // helper method to convert Http headers from the plugin SDK to a std::map |
1307 void GetHttpHeaders(std::map<std::string, std::string>& result, const OrthancPluginHttpRequest* request); | 1334 void GetHttpHeaders(std::map<std::string, std::string>& result, const OrthancPluginHttpRequest* request); |