Mercurial > hg > orthanc-dicomweb
changeset 780:83ef6cd2e724
sync
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Tue, 18 Aug 2026 10:18:24 +0200 |
| parents | c3e479690bf5 |
| children | 90a382c163ee |
| files | Plugin/Configuration.cpp Plugin/DicomWebClient.cpp Plugin/DicomWebFormatter.cpp Plugin/DicomWebServers.cpp Plugin/Plugin.cpp Plugin/QidoRs.cpp Plugin/StowRs.cpp Plugin/WadoRs.cpp Plugin/WadoRsRetrieveFrames.cpp Plugin/WadoRsRetrieveRendered.cpp Plugin/WadoUri.cpp Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h Resources/Orthanc/Plugins/OrthancPluginException.h |
| diffstat | 14 files changed, 260 insertions(+), 248 deletions(-) [+] |
line wrap: on
line diff
--- a/Plugin/Configuration.cpp Mon Aug 17 09:32:26 2026 +0200 +++ b/Plugin/Configuration.cpp Tue Aug 18 10:18:24 2026 +0200 @@ -223,7 +223,7 @@ { if (json.type() != Json::objectValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadFileFormat); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadFileFormat); } else if (!json.isMember(key)) { @@ -232,7 +232,7 @@ else if (json[key].type() != Json::intValue && json[key].type() != Json::uintValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadFileFormat); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadFileFormat); } else { @@ -248,7 +248,7 @@ { if (json.type() != Json::objectValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadFileFormat); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadFileFormat); } else if (!json.isMember(key)) { @@ -256,7 +256,7 @@ } else if (json[key].type() != Json::booleanValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadFileFormat); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadFileFormat); } else { @@ -761,7 +761,7 @@ break; default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_ParameterOutOfRange); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_ParameterOutOfRange); } std::string value = GetStringValue(key, FULL); @@ -828,7 +828,7 @@ break; default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_ParameterOutOfRange); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_ParameterOutOfRange); } }
--- a/Plugin/DicomWebClient.cpp Mon Aug 17 09:32:26 2026 +0200 +++ b/Plugin/DicomWebClient.cpp Tue Aug 18 10:18:24 2026 +0200 @@ -118,7 +118,7 @@ if (factory_ != NULL) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadSequenceOfCalls); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadSequenceOfCalls); } else { @@ -281,7 +281,7 @@ { if (factory_ == NULL) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadSequenceOfCalls); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadSequenceOfCalls); } FunctionResult result; @@ -307,7 +307,7 @@ return OrthancPluginJobStepStatus_Failure; default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } } @@ -526,7 +526,7 @@ { if (resources[i].type() != Json::stringValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadFileFormat); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_BadFileFormat); } std::string resource = resources[i].asString(); @@ -553,7 +553,7 @@ { if (tmpInstances.type() != Json::arrayValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } AddResourceForJobContent(resourcesForJobContent, Orthanc::StringToResourceType(tmpResource["Type"].asString().c_str()), resource); @@ -1068,7 +1068,7 @@ } else { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } if (debug_) @@ -1116,7 +1116,7 @@ } else if (state_ != State_Headers) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } if (boost::iequals(key, "Content-Type")) @@ -1299,7 +1299,7 @@ const Resource* resource = resources_[position_++]; if (resource == NULL) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } const std::map<std::string, std::string>& headers = resource->GetAdditionalHeaders();
--- a/Plugin/DicomWebFormatter.cpp Mon Aug 17 09:32:26 2026 +0200 +++ b/Plugin/DicomWebFormatter.cpp Tue Aug 18 10:18:24 2026 +0200 @@ -104,7 +104,7 @@ } default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_ParameterOutOfRange); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_ParameterOutOfRange); } } @@ -206,7 +206,7 @@ if (context_ == NULL || (isXml_ && output_ == NULL)) // allow no output when working with Json output. { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NullPointer); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NullPointer); } if (isXml_)
--- a/Plugin/DicomWebServers.cpp Mon Aug 17 09:32:26 2026 +0200 +++ b/Plugin/DicomWebServers.cpp Tue Aug 18 10:18:24 2026 +0200 @@ -321,7 +321,7 @@ if (json.type() != Json::objectValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } Json::Value::Members members = json.getMemberNames(); @@ -331,7 +331,7 @@ if (json[key].type() != Json::stringValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } else {
--- a/Plugin/Plugin.cpp Mon Aug 17 09:32:26 2026 +0200 +++ b/Plugin/Plugin.cpp Tue Aug 18 10:18:24 2026 +0200 @@ -737,7 +737,7 @@ root[0] != '/' || root[root.size() - 1] != '/') { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } std::map<std::string, std::string> dictionary;
--- a/Plugin/QidoRs.cpp Mon Aug 17 09:32:26 2026 +0200 +++ b/Plugin/QidoRs.cpp Tue Aug 18 10:18:24 2026 +0200 @@ -113,7 +113,7 @@ break; default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } } @@ -275,7 +275,7 @@ break; default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } bool caseSensitive; @@ -413,7 +413,7 @@ if (!OrthancPlugins::RestApiPost(resources, "/tools/find", find, httpHeaders, true) || resources.type() != Json::arrayValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } std::string wadoBasePublicUrl = OrthancPlugins::Configuration::GetBasePublicUrl(request);
--- a/Plugin/StowRs.cpp Mon Aug 17 09:32:26 2026 +0200 +++ b/Plugin/StowRs.cpp Tue Aug 18 10:18:24 2026 +0200 @@ -300,7 +300,7 @@ if (request->method != OrthancPluginHttpMethod_Post) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } std::map<std::string, std::string> headers;
--- a/Plugin/WadoRs.cpp Mon Aug 17 09:32:26 2026 +0200 +++ b/Plugin/WadoRs.cpp Tue Aug 18 10:18:24 2026 +0200 @@ -118,7 +118,7 @@ return "/instances/" + publicId; default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } } @@ -790,7 +790,7 @@ context, output, reinterpret_cast<const char*>(dicom->GetBuffer()), dicom->GetSize()) != 0) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } perfTotalSizeInBytes += dicom->GetSize(); @@ -971,7 +971,7 @@ if (value.type() != Json::objectValue || !value.isMember(MAIN_DICOM_TAGS)) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } dicom.FromDicomAsJson(value[MAIN_DICOM_TAGS], false /* append */, true /* parseSequences */); @@ -984,7 +984,7 @@ } else { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } } @@ -997,7 +997,7 @@ } else { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } } @@ -1031,7 +1031,7 @@ if (!value.isMember(INSTANCES) || value[INSTANCES].type() != Json::arrayValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } else { @@ -1039,7 +1039,7 @@ { if (value[INSTANCES][i].type() != Json::stringValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } else { @@ -1057,7 +1057,7 @@ { if (tmp.type() != Json::arrayValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } for (Json::Value::ArrayIndex i = 0; i < tmp.size(); i++) @@ -1066,7 +1066,7 @@ !tmp[i].isMember("ID") || tmp[i]["ID"].type() != Json::stringValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } else { @@ -1079,7 +1079,7 @@ } default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } @@ -1237,7 +1237,7 @@ } default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } @@ -1346,7 +1346,7 @@ if (!OrthancPlugins::RestApiPost(resources, "/tools/find", payload, httpHeaders, true) || resources.type() != Json::arrayValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } if (resources.size() == 0) @@ -1729,7 +1729,7 @@ { if (instancesQueue == NULL) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NullPointer); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NullPointer); } } @@ -1762,7 +1762,7 @@ std::unique_ptr<InstanceToLoad> instanceToLoad(data->Dequeue()); if (instanceToLoad.get() == NULL) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } if (instanceToLoad->GetOrthancId() == EXIT_WORKER_MESSAGE) @@ -2222,7 +2222,7 @@ if (frames.type() != Json::arrayValue || OrthancPluginStartMultipartAnswer(context, output, "related", "application/octet-stream") != 0) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_Plugin); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_Plugin); } for (Json::Value::ArrayIndex i = 0; i < frames.size(); i++) @@ -2233,7 +2233,7 @@ !OrthancPlugins::RestApiGetString(frame, orthanc + "/" + frames[i].asString(), false) || OrthancPluginSendMultipartItem(context, output, frame.c_str(), frame.size()) != 0) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_Plugin); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_Plugin); } } } @@ -2275,7 +2275,7 @@ if (OrthancPluginStartMultipartAnswer(context, output, "related", "application/octet-stream") != 0 || OrthancPluginSendMultipartItem(context, output, result.c_str(), result.size()) != 0) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_Plugin); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_Plugin); } } else
--- a/Plugin/WadoRsRetrieveFrames.cpp Mon Aug 17 09:32:26 2026 +0200 +++ b/Plugin/WadoRsRetrieveFrames.cpp Tue Aug 18 10:18:24 2026 +0200 @@ -594,7 +594,7 @@ if (instance.get() == NULL) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NullPointer); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NullPointer); } if (allFrames)
--- a/Plugin/WadoRsRetrieveRendered.cpp Mon Aug 17 09:32:26 2026 +0200 +++ b/Plugin/WadoRsRetrieveRendered.cpp Tue Aug 18 10:18:24 2026 +0200 @@ -688,7 +688,7 @@ } default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } Orthanc::ImageTraits<Orthanc::PixelFormat_Grayscale8>::SetFloatPixel(target, b, x, y); @@ -751,14 +751,14 @@ break; default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } break; } default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } if (parameters.IsFlipX()) @@ -1048,7 +1048,7 @@ break; default: - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } }
--- a/Plugin/WadoUri.cpp Mon Aug 17 09:32:26 2026 +0200 +++ b/Plugin/WadoUri.cpp Tue Aug 18 10:18:24 2026 +0200 @@ -106,7 +106,7 @@ if (!OrthancPlugins::RestApiPost(resources, "/tools/find", payload, httpHeaders, true) || resources.type() != Json::arrayValue) { - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_InternalError); } if (resources.size() == 0) @@ -171,7 +171,7 @@ else { LOG(ERROR) << "WADO-URI: Unable to generate a preview image for " << uri; - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_Plugin); + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_Plugin); } }
--- a/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Mon Aug 17 09:32:26 2026 +0200 +++ b/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Tue Aug 18 10:18:24 2026 +0200 @@ -61,6 +61,13 @@ #endif +#ifdef _MSC_VER +# define ORTHANC_SCANF sscanf_s +#else +# define ORTHANC_SCANF sscanf +#endif + + namespace OrthancPlugins { static OrthancPluginContext* globalContext_ = NULL; @@ -117,7 +124,7 @@ } -#if HAS_ORTHANC_PLUGIN_LOG_MESSAGE == 1 +#if HAS_ORTHANC_PLUGINS_LOG_MESSAGE == 1 void LogMessage(OrthancPluginLogLevel level, const char* file, uint32_t line, @@ -125,7 +132,7 @@ { if (HasGlobalContext()) { -#if HAS_ORTHANC_PLUGIN_LOG_MESSAGE == 1 +#if HAS_ORTHANC_PLUGINS_LOG_MESSAGE == 1 const char* pluginName = (pluginName_.empty() ? NULL : pluginName_.c_str()); OrthancPluginLogMessage(GetGlobalContext(), message.c_str(), pluginName, file, line, OrthancPluginLogCategory_Generic, level); #else @@ -184,7 +191,7 @@ // Prevent using garbage information buffer_.data = NULL; buffer_.size = 0; - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } } @@ -209,7 +216,7 @@ } else { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } } @@ -365,7 +372,7 @@ } -#if (HAS_ORTHANC_PLUGIN_PEERS == 1) || (HAS_ORTHANC_PLUGIN_HTTP_CLIENT == 1) || (HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1) +#if (HAS_ORTHANC_PLUGINS_PEERS == 1) || (HAS_ORTHANC_PLUGINS_HTTP_CLIENT == 1) || (HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1) static void DecodeHttpHeaders(HttpHeaders& target, const MemoryBuffer& source) { @@ -465,7 +472,7 @@ } } -#if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1 +#if HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1 bool MemoryBuffer::RestApiPost(const std::string& uri, const void* body, @@ -839,7 +846,7 @@ } else { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(error); + ORTHANC_PLUGINS_THROW_ERROR_CODE(error); } } @@ -1481,7 +1488,7 @@ } -#if HAS_ORTHANC_PLUGIN_FIND_MATCHER == 1 +#if HAS_ORTHANC_PLUGINS_FIND_MATCHER == 1 FindMatcher::FindMatcher(const OrthancPluginWorklistQuery* worklist) : matcher_(NULL), worklist_(worklist) @@ -1550,18 +1557,18 @@ } } -#endif /* HAS_ORTHANC_PLUGIN_FIND_MATCHER == 1 */ +#endif /* HAS_ORTHANC_PLUGINS_FIND_MATCHER == 1 */ static void CheckAnswerSizeIsLessThan4GB(const std::string& answer) { if (answer.size() > static_cast<size_t>(std::numeric_limits<uint32_t>::max())) { - #if HAS_ORTHANC_EXCEPTION == 1 +#if HAS_ORTHANC_EXCEPTION == 1 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange, "Cannot send HTTP response larger than 4GB"); - #else +#else ORTHANC_PLUGINS_LOG_ERROR("Cannot send HTTP response larger than 4GB"); - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); - #endif + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); +#endif } } @@ -1734,7 +1741,7 @@ } } -#if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1 +#if HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1 bool RestApiPost(Json::Value& result, const std::string& uri, const Json::Value& body, @@ -1829,7 +1836,7 @@ } else { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(error); + ORTHANC_PLUGINS_THROW_ERROR_CODE(error); } } @@ -1858,12 +1865,6 @@ return true; } -#ifdef _MSC_VER -#define ORTHANC_SCANF sscanf_s -#else -#define ORTHANC_SCANF sscanf -#endif - // Parse the version int aa, bb, cc = 0; if ((ORTHANC_SCANF(version, "%4d.%4d.%4d", &aa, &bb, &cc) != 3 && @@ -1951,7 +1952,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_PEERS == 1 +#if HAS_ORTHANC_PLUGINS_PEERS == 1 size_t OrthancPeers::GetPeerIndex(const std::string& name) const { size_t index; @@ -1975,7 +1976,7 @@ if (peers_ == NULL) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_Plugin); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_Plugin); } uint32_t count = OrthancPluginGetPeersCount(GetGlobalContext(), peers_); @@ -1986,7 +1987,7 @@ if (name == NULL) { OrthancPluginFreePeers(GetGlobalContext(), peers_); - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_Plugin); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_Plugin); } index_[name] = i; @@ -2024,14 +2025,14 @@ { if (index >= index_.size()) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); } else { const char* s = OrthancPluginGetPeerName(GetGlobalContext(), peers_, static_cast<uint32_t>(index)); if (s == NULL) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_Plugin); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_Plugin); } else { @@ -2045,14 +2046,14 @@ { if (index >= index_.size()) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); } else { const char* s = OrthancPluginGetPeerUrl(GetGlobalContext(), peers_, static_cast<uint32_t>(index)); if (s == NULL) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_Plugin); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_Plugin); } else { @@ -2074,7 +2075,7 @@ { if (index >= index_.size()) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); } else { @@ -2107,7 +2108,7 @@ { if (index >= index_.size()) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); } OrthancPlugins::MemoryBuffer answer; @@ -2305,7 +2306,7 @@ { if (index >= index_.size()) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); } if (body.size() > 0xffffffffu) @@ -2345,7 +2346,7 @@ { if (index >= index_.size()) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); } if (body.size() > 0xffffffffu) @@ -2391,7 +2392,7 @@ { if (index >= index_.size()) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); } OrthancPlugins::MemoryBuffer answer; @@ -2432,7 +2433,7 @@ ** JOBS ******************************************************************/ -#if HAS_ORTHANC_PLUGIN_JOB == 1 +#if HAS_ORTHANC_PLUGINS_JOB == 1 void OrthancJob::CallbackFinalize(void* job) { if (job != NULL) @@ -2630,7 +2631,7 @@ if (content.type() != Json::objectValue) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_BadFileFormat); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_BadFileFormat); } else { @@ -2650,7 +2651,7 @@ { if (serialized.type() != Json::objectValue) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_BadFileFormat); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_BadFileFormat); } else { @@ -2665,7 +2666,7 @@ if (progress < 0 || progress > 1) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_ParameterOutOfRange); } progress_ = progress; @@ -2685,7 +2686,7 @@ { if (job == NULL) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_NullPointer); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_NullPointer); } OrthancPluginJob* orthanc = @@ -2700,7 +2701,7 @@ if (orthanc == NULL) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_Plugin); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_Plugin); } else { @@ -2714,7 +2715,7 @@ { if (job == NULL) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_NullPointer); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_NullPointer); } OrthancPluginJob* orthanc = Create(job); @@ -2725,7 +2726,7 @@ { ORTHANC_PLUGINS_LOG_ERROR("Plugin cannot submit job"); OrthancPluginFreeJob(GetGlobalContext(), orthanc); - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_Plugin); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_Plugin); } else { @@ -2753,7 +2754,7 @@ !status.isMember("State") || status["State"].type() != Json::stringValue) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_InexistentItem); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_InexistentItem); } const std::string state = status["State"].asString(); @@ -2782,30 +2783,30 @@ if (!status.isMember("ErrorCode") || status["ErrorCode"].type() != Json::intValue) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_InternalError); } else { if (!status.isMember("ErrorDescription") || status["ErrorDescription"].type() != Json::stringValue) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(status["ErrorCode"].asInt()); + ORTHANC_PLUGINS_THROW_ERROR_CODE(status["ErrorCode"].asInt()); } else { - #if HAS_ORTHANC_EXCEPTION == 1 +#if HAS_ORTHANC_EXCEPTION == 1 throw Orthanc::OrthancException(static_cast<Orthanc::ErrorCode>(status["ErrorCode"].asInt()), status["ErrorDescription"].asString()); - #else +#else ORTHANC_PLUGINS_LOG_ERROR("Exception while executing the job: " + status["ErrorDescription"].asString()); - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(status["ErrorCode"].asInt()); - #endif + ORTHANC_PLUGINS_THROW_ERROR_CODE(status["ErrorCode"].asInt()); +#endif } } } else { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(OrthancPluginErrorCode_InternalError); + ORTHANC_PLUGINS_THROW_ERROR_CODE(OrthancPluginErrorCode_InternalError); } } } @@ -2922,7 +2923,7 @@ ** METRICS ******************************************************************/ -#if HAS_ORTHANC_PLUGIN_METRICS == 1 +#if HAS_ORTHANC_PLUGINS_METRICS == 1 MetricsTimer::MetricsTimer(const char* name) : name_(name) { @@ -2945,7 +2946,7 @@ ** HTTP CLIENT ******************************************************************/ -#if HAS_ORTHANC_PLUGIN_HTTP_CLIENT == 1 +#if HAS_ORTHANC_PLUGINS_HTTP_CLIENT == 1 class HttpClient::RequestBodyWrapper : public boost::noncopyable { private: @@ -3009,7 +3010,7 @@ }; -#if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT == 1 +#if HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_CLIENT == 1 static OrthancPluginErrorCode AnswerAddHeaderCallback(void* answer, const char* key, const char* value) @@ -3033,7 +3034,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT == 1 +#if HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_CLIENT == 1 static OrthancPluginErrorCode AnswerAddChunkCallback(void* answer, const void* data, uint32_t size) @@ -3297,7 +3298,7 @@ }; -#if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT == 1 +#if HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_CLIENT == 1 class MemoryAnswer : public HttpClient::IAnswer { private: @@ -3331,7 +3332,7 @@ } -#if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT == 1 +#if HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_CLIENT == 1 void HttpClient::ExecuteWithStream(uint16_t& httpStatus, IAnswer& answer, IRequestBody& body) const @@ -3387,7 +3388,7 @@ if (error != OrthancPluginErrorCode_Success) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(error); + ORTHANC_PLUGINS_THROW_ERROR_CODE(error); } } #endif @@ -3429,7 +3430,7 @@ if (error != OrthancPluginErrorCode_Success) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(error); + ORTHANC_PLUGINS_THROW_ERROR_CODE(error); } DecodeHttpHeaders(answerHeaders, answerHeadersBuffer); @@ -3439,7 +3440,7 @@ void HttpClient::Execute(IAnswer& answer) { -#if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT == 1 +#if HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_CLIENT == 1 if (allowChunkedTransfers_) { if (chunkedBody_ != NULL) @@ -3480,7 +3481,7 @@ void HttpClient::Execute(HttpHeaders& answerHeaders /* out */, std::string& answerBody /* out */) { -#if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT == 1 +#if HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_CLIENT == 1 if (allowChunkedTransfers_) { MemoryAnswer answer; @@ -3538,7 +3539,7 @@ Execute(answerHeaders, body); } -#endif /* HAS_ORTHANC_PLUGIN_HTTP_CLIENT == 1 */ +#endif /* HAS_ORTHANC_PLUGINS_HTTP_CLIENT == 1 */ @@ -3563,7 +3564,7 @@ } -#if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_SERVER == 1 +#if HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_SERVER == 1 OrthancPluginErrorCode ChunkedRequestReaderAddChunk( OrthancPluginServerChunkedRequestReader* reader, @@ -3758,7 +3759,7 @@ } catch (ORTHANC_PLUGINS_EXCEPTION_CLASS& e) { -#if HAS_ORTHANC_EXCEPTION == 1 && HAS_ORTHANC_PLUGIN_EXCEPTION_DETAILS == 1 +#if HAS_ORTHANC_EXCEPTION == 1 && HAS_ORTHANC_PLUGINS_EXCEPTION_DETAILS == 1 if (HasGlobalContext() && e.HasDetails()) { @@ -3785,7 +3786,7 @@ } -#if HAS_ORTHANC_PLUGIN_STORAGE_COMMITMENT_SCP == 1 +#if HAS_ORTHANC_PLUGINS_STORAGE_COMMITMENT_SCP == 1 OrthancPluginErrorCode IStorageCommitmentScpHandler::Lookup( OrthancPluginStorageCommitmentFailureReason* target, void* rawHandler, @@ -3813,7 +3814,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_STORAGE_COMMITMENT_SCP == 1 +#if HAS_ORTHANC_PLUGINS_STORAGE_COMMITMENT_SCP == 1 void IStorageCommitmentScpHandler::Destructor(void* rawHandler) { assert(rawHandler != NULL); @@ -3937,7 +3938,7 @@ } else { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } } #endif @@ -3974,7 +3975,7 @@ } else { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } } #endif @@ -4023,7 +4024,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_WEBDAV == 1 +#if HAS_ORTHANC_PLUGINS_WEBDAV == 1 static std::vector<std::string> WebDavConvertPath(uint32_t pathSize, const char* const* pathItems) { @@ -4039,7 +4040,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_WEBDAV == 1 +#if HAS_ORTHANC_PLUGINS_WEBDAV == 1 static OrthancPluginErrorCode WebDavIsExistingFolder(uint8_t* isExisting, uint32_t pathSize, const char* const* pathItems, @@ -4064,7 +4065,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_WEBDAV == 1 +#if HAS_ORTHANC_PLUGINS_WEBDAV == 1 static OrthancPluginErrorCode WebDavListFolder(uint8_t* isExisting, OrthancPluginWebDavCollection* collection, OrthancPluginWebDavAddFile addFile, @@ -4128,7 +4129,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_WEBDAV == 1 +#if HAS_ORTHANC_PLUGINS_WEBDAV == 1 static OrthancPluginErrorCode WebDavRetrieveFile(OrthancPluginWebDavCollection* collection, OrthancPluginWebDavRetrieveFile retrieveFile, uint32_t pathSize, @@ -4164,7 +4165,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_WEBDAV == 1 +#if HAS_ORTHANC_PLUGINS_WEBDAV == 1 static OrthancPluginErrorCode WebDavStoreFileCallback(uint8_t* isReadOnly, /* out */ uint32_t pathSize, const char* const* pathItems, @@ -4197,7 +4198,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_WEBDAV == 1 +#if HAS_ORTHANC_PLUGINS_WEBDAV == 1 static OrthancPluginErrorCode WebDavCreateFolderCallback(uint8_t* isReadOnly, /* out */ uint32_t pathSize, const char* const* pathItems, @@ -4222,7 +4223,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_WEBDAV == 1 +#if HAS_ORTHANC_PLUGINS_WEBDAV == 1 static OrthancPluginErrorCode WebDavDeleteItemCallback(uint8_t* isReadOnly, /* out */ uint32_t pathSize, const char* const* pathItems, @@ -4247,7 +4248,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_WEBDAV == 1 +#if HAS_ORTHANC_PLUGINS_WEBDAV == 1 void IWebDavCollection::Register(const std::string& uri, IWebDavCollection& collection) { @@ -4257,7 +4258,7 @@ if (code != OrthancPluginErrorCode_Success) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } } #endif @@ -4347,7 +4348,7 @@ } -#if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1 +#if HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1 RestApiClient::RestApiClient() : method_(OrthancPluginHttpMethod_Get), path_("/"), @@ -4381,7 +4382,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1 +#if HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1 void RestApiClient::AddRequestHeader(const std::string& key, const std::string& value) { @@ -4397,7 +4398,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1 +#if HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1 void RestApiClient::SetRequestHeader(const std::string& key, const std::string& value) { @@ -4406,7 +4407,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1 +#if HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1 bool RestApiClient::Execute() { if (requestBody_.size() > 0xffffffffu) @@ -4448,7 +4449,7 @@ } else { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } } } @@ -4489,7 +4490,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1 +#if HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1 uint16_t RestApiClient::GetHttpStatus() const { if (httpStatus_ == 0) @@ -4504,7 +4505,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1 +#if HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1 bool RestApiClient::LookupAnswerHeader(std::string& value, const std::string& key) const { @@ -4529,7 +4530,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1 +#if HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1 const std::string& RestApiClient::GetAnswerBody() const { if (httpStatus_ == 0) @@ -4544,7 +4545,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_KEY_VALUE_STORES == 1 +#if HAS_ORTHANC_PLUGINS_KEY_VALUE_STORES == 1 KeyValueStore::Iterator::Iterator(OrthancPluginKeysValuesIterator *iterator) : iterator_(iterator) { @@ -4556,7 +4557,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_KEY_VALUE_STORES == 1 +#if HAS_ORTHANC_PLUGINS_KEY_VALUE_STORES == 1 KeyValueStore::Iterator::~Iterator() { OrthancPluginFreeKeysValuesIterator(OrthancPlugins::GetGlobalContext(), iterator_); @@ -4564,7 +4565,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_KEY_VALUE_STORES == 1 +#if HAS_ORTHANC_PLUGINS_KEY_VALUE_STORES == 1 bool KeyValueStore::Iterator::Next() { uint8_t done; @@ -4572,7 +4573,7 @@ if (code != OrthancPluginErrorCode_Success) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } else { @@ -4582,7 +4583,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_KEY_VALUE_STORES == 1 +#if HAS_ORTHANC_PLUGINS_KEY_VALUE_STORES == 1 std::string KeyValueStore::Iterator::GetKey() const { const char* s = OrthancPluginKeysValuesIteratorGetKey(OrthancPlugins::GetGlobalContext(), iterator_); @@ -4598,7 +4599,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_KEY_VALUE_STORES == 1 +#if HAS_ORTHANC_PLUGINS_KEY_VALUE_STORES == 1 void KeyValueStore::Iterator::GetValue(std::string& value) const { OrthancPlugins::MemoryBuffer valueBuffer; @@ -4606,7 +4607,7 @@ if (code != OrthancPluginErrorCode_Success) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } else { @@ -4616,7 +4617,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_KEY_VALUE_STORES == 1 +#if HAS_ORTHANC_PLUGINS_KEY_VALUE_STORES == 1 void KeyValueStore::Store(const std::string& key, const void* value, size_t valueSize) @@ -4630,13 +4631,13 @@ key.c_str(), value, static_cast<uint32_t>(valueSize)); if (code != OrthancPluginErrorCode_Success) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } } #endif -#if HAS_ORTHANC_PLUGIN_KEY_VALUE_STORES == 1 +#if HAS_ORTHANC_PLUGINS_KEY_VALUE_STORES == 1 bool KeyValueStore::GetValue(std::string& value, const std::string& key) { @@ -4647,7 +4648,7 @@ if (code != OrthancPluginErrorCode_Success) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } else if (found) { @@ -4662,7 +4663,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_KEY_VALUE_STORES == 1 +#if HAS_ORTHANC_PLUGINS_KEY_VALUE_STORES == 1 void KeyValueStore::DeleteKey(const std::string& key) { OrthancPluginErrorCode code = OrthancPluginDeleteKeyValue(OrthancPlugins::GetGlobalContext(), @@ -4670,13 +4671,13 @@ if (code != OrthancPluginErrorCode_Success) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } } #endif -#if HAS_ORTHANC_PLUGIN_KEY_VALUE_STORES == 1 +#if HAS_ORTHANC_PLUGINS_KEY_VALUE_STORES == 1 KeyValueStore::Iterator* KeyValueStore::CreateIterator() { return new Iterator(OrthancPluginCreateKeysValuesIterator(OrthancPlugins::GetGlobalContext(), storeId_.c_str())); @@ -4684,7 +4685,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_QUEUES == 1 +#if HAS_ORTHANC_PLUGINS_QUEUES == 1 void Queue::Enqueue(const void* value, size_t valueSize) { @@ -4698,13 +4699,13 @@ if (code != OrthancPluginErrorCode_Success) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } } #endif -#if HAS_ORTHANC_PLUGIN_QUEUES == 1 +#if HAS_ORTHANC_PLUGINS_QUEUES == 1 bool Queue::DequeueInternal(std::string& value, OrthancPluginQueueOrigin origin) { @@ -4719,7 +4720,7 @@ if (code != OrthancPluginErrorCode_Success) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } else if (found) { @@ -4734,7 +4735,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_QUEUES == 1 +#if HAS_ORTHANC_PLUGINS_QUEUES == 1 uint64_t Queue::GetSize() { uint64_t size = 0; @@ -4742,7 +4743,7 @@ if (code != OrthancPluginErrorCode_Success) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } else { @@ -4752,7 +4753,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_RESERVE_QUEUE_VALUE == 1 +#if HAS_ORTHANC_PLUGINS_RESERVE_QUEUE_VALUE == 1 bool Queue::ReserveInternal(std::string& value, uint64_t& valueId, OrthancPluginQueueOrigin origin, uint32_t releaseTimeout) { uint8_t found = false; @@ -4763,7 +4764,7 @@ if (code != OrthancPluginErrorCode_Success) { - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); + ORTHANC_PLUGINS_THROW_ERROR_CODE(code); } else if (found) { @@ -4778,7 +4779,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_RESERVE_QUEUE_VALUE == 1 +#if HAS_ORTHANC_PLUGINS_RESERVE_QUEUE_VALUE == 1 bool Queue::ReserveBack(std::string& value, uint64_t& valueId, uint32_t releaseTimeout) { return ReserveInternal(value, valueId, OrthancPluginQueueOrigin_Back, releaseTimeout); @@ -4786,7 +4787,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_RESERVE_QUEUE_VALUE == 1 +#if HAS_ORTHANC_PLUGINS_RESERVE_QUEUE_VALUE == 1 bool Queue::ReserveFront(std::string& value, uint64_t& valueId, uint32_t releaseTimeout) { return ReserveInternal(value, valueId, OrthancPluginQueueOrigin_Front, releaseTimeout); @@ -4794,7 +4795,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_RESERVE_QUEUE_VALUE == 1 +#if HAS_ORTHANC_PLUGINS_RESERVE_QUEUE_VALUE == 1 void Queue::Acknowledge(uint64_t valueId) { OrthancPluginAcknowledgeQueueValue(OrthancPlugins::GetGlobalContext(), queueId_.c_str(), valueId);
--- a/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h Mon Aug 17 09:32:26 2026 +0200 +++ b/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h Tue Aug 18 10:18:24 2026 +0200 @@ -66,98 +66,98 @@ #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 2, 0) // The "OrthancPluginFindMatcher()" primitive was introduced in Orthanc 1.2.0 -# define HAS_ORTHANC_PLUGIN_FIND_MATCHER 1 +# define HAS_ORTHANC_PLUGINS_FIND_MATCHER 1 #else -# define HAS_ORTHANC_PLUGIN_FIND_MATCHER 0 +# define HAS_ORTHANC_PLUGINS_FIND_MATCHER 0 #endif #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 4, 2) -# define HAS_ORTHANC_PLUGIN_PEERS 1 -# define HAS_ORTHANC_PLUGIN_JOB 1 +# define HAS_ORTHANC_PLUGINS_PEERS 1 +# define HAS_ORTHANC_PLUGINS_JOB 1 #else -# define HAS_ORTHANC_PLUGIN_PEERS 0 -# define HAS_ORTHANC_PLUGIN_JOB 0 +# define HAS_ORTHANC_PLUGINS_PEERS 0 +# define HAS_ORTHANC_PLUGINS_JOB 0 #endif #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 0) -# define HAS_ORTHANC_PLUGIN_EXCEPTION_DETAILS 1 +# define HAS_ORTHANC_PLUGINS_EXCEPTION_DETAILS 1 #else -# define HAS_ORTHANC_PLUGIN_EXCEPTION_DETAILS 0 +# define HAS_ORTHANC_PLUGINS_EXCEPTION_DETAILS 0 #endif #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 4) -# define HAS_ORTHANC_PLUGIN_METRICS 1 +# define HAS_ORTHANC_PLUGINS_METRICS 1 #else -# define HAS_ORTHANC_PLUGIN_METRICS 0 +# define HAS_ORTHANC_PLUGINS_METRICS 0 #endif #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 1, 0) -# define HAS_ORTHANC_PLUGIN_HTTP_CLIENT 1 +# define HAS_ORTHANC_PLUGINS_HTTP_CLIENT 1 #else -# define HAS_ORTHANC_PLUGIN_HTTP_CLIENT 0 +# define HAS_ORTHANC_PLUGINS_HTTP_CLIENT 0 #endif #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 7) -# define HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT 1 +# define HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_CLIENT 1 #else -# define HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT 0 +# define HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_CLIENT 0 #endif #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 7) -# define HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_SERVER 1 +# define HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_SERVER 1 #else -# define HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_SERVER 0 +# define HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_SERVER 0 #endif #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 6, 0) -# define HAS_ORTHANC_PLUGIN_STORAGE_COMMITMENT_SCP 1 +# define HAS_ORTHANC_PLUGINS_STORAGE_COMMITMENT_SCP 1 #else -# define HAS_ORTHANC_PLUGIN_STORAGE_COMMITMENT_SCP 0 +# define HAS_ORTHANC_PLUGINS_STORAGE_COMMITMENT_SCP 0 #endif #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 9, 2) -# define HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API 1 +# define HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API 1 #else -# define HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API 0 +# define HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API 0 #endif #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 10, 1) -# define HAS_ORTHANC_PLUGIN_WEBDAV 1 +# define HAS_ORTHANC_PLUGINS_WEBDAV 1 #else -# define HAS_ORTHANC_PLUGIN_WEBDAV 0 +# define HAS_ORTHANC_PLUGINS_WEBDAV 0 #endif #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4) -# define HAS_ORTHANC_PLUGIN_LOG_MESSAGE 1 +# define HAS_ORTHANC_PLUGINS_LOG_MESSAGE 1 #else -# define HAS_ORTHANC_PLUGIN_LOG_MESSAGE 0 +# define HAS_ORTHANC_PLUGINS_LOG_MESSAGE 0 #endif #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 8) -# define HAS_ORTHANC_PLUGIN_KEY_VALUE_STORES 1 -# define HAS_ORTHANC_PLUGIN_QUEUES 1 +# define HAS_ORTHANC_PLUGINS_KEY_VALUE_STORES 1 +# define HAS_ORTHANC_PLUGINS_QUEUES 1 #else -# define HAS_ORTHANC_PLUGIN_KEY_VALUE_STORES 0 -# define HAS_ORTHANC_PLUGIN_QUEUES 0 +# define HAS_ORTHANC_PLUGINS_KEY_VALUE_STORES 0 +# define HAS_ORTHANC_PLUGINS_QUEUES 0 #endif #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 10) -# define HAS_ORTHANC_PLUGIN_RESERVE_QUEUE_VALUE 1 +# define HAS_ORTHANC_PLUGINS_RESERVE_QUEUE_VALUE 1 #else -# define HAS_ORTHANC_PLUGIN_RESERVE_QUEUE_VALUE 0 +# define HAS_ORTHANC_PLUGINS_RESERVE_QUEUE_VALUE 0 #endif // Macro to tag a function as having been deprecated #if (__cplusplus >= 201402L) // C++14 -# define ORTHANC_PLUGIN_CPP_WRAPPER_DEPRECATED(f) [[deprecated]] f +# define ORTHANC_PLUGINS_CPP_WRAPPER_DEPRECATED(f) [[deprecated]] f #elif defined(__GNUC__) || defined(__clang__) -# define ORTHANC_PLUGIN_CPP_WRAPPER_DEPRECATED(f) f __attribute__((deprecated)) +# define ORTHANC_PLUGINS_CPP_WRAPPER_DEPRECATED(f) f __attribute__((deprecated)) #elif defined(_MSC_VER) -# define ORTHANC_PLUGIN_CPP_WRAPPER_DEPRECATED(f) __declspec(deprecated) f +# define ORTHANC_PLUGINS_CPP_WRAPPER_DEPRECATED(f) __declspec(deprecated) f #else -# define ORTHANC_PLUGIN_CPP_WRAPPER_DEPRECATED +# define ORTHANC_PLUGINS_CPP_WRAPPER_DEPRECATED #endif @@ -171,7 +171,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_LOG_MESSAGE == 1 +#if HAS_ORTHANC_PLUGINS_LOG_MESSAGE == 1 # define ORTHANC_PLUGINS_LOG_ERROR(msg) ::OrthancPlugins::LogMessage(OrthancPluginLogLevel_Error, __ORTHANC_FILE__, __LINE__, msg) # define ORTHANC_PLUGINS_LOG_WARNING(msg) ::OrthancPlugins::LogMessage(OrthancPluginLogLevel_Warning, __ORTHANC_FILE__, __LINE__, msg) # define ORTHANC_PLUGINS_LOG_INFO(msg) ::OrthancPlugins::LogMessage(OrthancPluginLogLevel_Info, __ORTHANC_FILE__, __LINE__, msg) @@ -296,7 +296,7 @@ const Json::Value& body, bool applyPlugins); -#if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1 +#if HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1 bool RestApiPost(const std::string& uri, const Json::Value& body, const HttpHeaders& httpHeaders, @@ -395,7 +395,7 @@ void ToJson(Json::Value& target) const; void ToJsonWithoutComments(Json::Value& target) const; -}; + }; class OrthancConfiguration : public boost::noncopyable @@ -534,7 +534,7 @@ }; -#if HAS_ORTHANC_PLUGIN_FIND_MATCHER == 1 +#if HAS_ORTHANC_PLUGINS_FIND_MATCHER == 1 class FindMatcher : public boost::noncopyable { private: @@ -621,7 +621,7 @@ size_t bodySize, bool applyPlugins); -#if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1 +#if HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1 bool RestApiPost(Json::Value& result, const std::string& uri, const Json::Value& body, @@ -700,30 +700,30 @@ const char* AutodetectMimeType(const std::string& path); #endif -#if HAS_ORTHANC_PLUGIN_LOG_MESSAGE == 1 +#if HAS_ORTHANC_PLUGINS_LOG_MESSAGE == 1 void LogMessage(OrthancPluginLogLevel level, const char* file, uint32_t line, const std::string& message); #endif -#if HAS_ORTHANC_PLUGIN_LOG_MESSAGE == 1 +#if HAS_ORTHANC_PLUGINS_LOG_MESSAGE == 1 // Use macro ORTHANC_PLUGINS_LOG_ERROR() instead - ORTHANC_PLUGIN_CPP_WRAPPER_DEPRECATED(void LogError(const std::string& message)); + ORTHANC_PLUGINS_CPP_WRAPPER_DEPRECATED(void LogError(const std::string& message)); #else void LogError(const std::string& message); #endif -#if HAS_ORTHANC_PLUGIN_LOG_MESSAGE == 1 +#if HAS_ORTHANC_PLUGINS_LOG_MESSAGE == 1 // Use macro ORTHANC_PLUGINS_LOG_WARNING() instead - ORTHANC_PLUGIN_CPP_WRAPPER_DEPRECATED(void LogWarning(const std::string& message)); + ORTHANC_PLUGINS_CPP_WRAPPER_DEPRECATED(void LogWarning(const std::string& message)); #else void LogWarning(const std::string& message); #endif -#if HAS_ORTHANC_PLUGIN_LOG_MESSAGE == 1 +#if HAS_ORTHANC_PLUGINS_LOG_MESSAGE == 1 // Use macro ORTHANC_PLUGINS_LOG_INFO() instead - ORTHANC_PLUGIN_CPP_WRAPPER_DEPRECATED(void LogInfo(const std::string& message)); + ORTHANC_PLUGINS_CPP_WRAPPER_DEPRECATED(void LogInfo(const std::string& message)); #else void LogInfo(const std::string& message); #endif @@ -755,7 +755,7 @@ } catch (ORTHANC_PLUGINS_EXCEPTION_CLASS& e) { -#if HAS_ORTHANC_EXCEPTION == 1 && HAS_ORTHANC_PLUGIN_EXCEPTION_DETAILS == 1 +#if HAS_ORTHANC_EXCEPTION == 1 && HAS_ORTHANC_PLUGINS_EXCEPTION_DETAILS == 1 if (HasGlobalContext() && e.HasDetails()) { @@ -798,7 +798,7 @@ } -#if HAS_ORTHANC_PLUGIN_PEERS == 1 +#if HAS_ORTHANC_PLUGINS_PEERS == 1 class OrthancPeers : public boost::noncopyable { private: @@ -943,7 +943,7 @@ -#if HAS_ORTHANC_PLUGIN_JOB == 1 +#if HAS_ORTHANC_PLUGINS_JOB == 1 class OrthancJob : public boost::noncopyable { private: @@ -1022,7 +1022,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_METRICS == 1 +#if HAS_ORTHANC_PLUGINS_METRICS == 1 inline void SetMetricsValue(const char* name, float value) { @@ -1042,7 +1042,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_METRICS == 1 +#if HAS_ORTHANC_PLUGINS_METRICS == 1 class MetricsTimer : public boost::noncopyable { private: @@ -1057,7 +1057,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_HTTP_CLIENT == 1 +#if HAS_ORTHANC_PLUGINS_HTTP_CLIENT == 1 class HttpClient : public boost::noncopyable { public: @@ -1105,7 +1105,7 @@ IRequestBody* chunkedBody_; bool allowChunkedTransfers_; -#if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_CLIENT == 1 +#if HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_CLIENT == 1 void ExecuteWithStream(uint16_t& httpStatus, // out IAnswer& answer, // out IRequestBody& body) const; @@ -1235,11 +1235,11 @@ const OrthancPluginHttpRequest* request); -#if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_SERVER == 1 +#if HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_SERVER == 1 template <ChunkedRestCallback Callback> static OrthancPluginErrorCode ChunkedProtect(OrthancPluginServerChunkedRequestReader** reader, - const char* url, - const OrthancPluginHttpRequest* request) + const char* url, + const OrthancPluginHttpRequest* request) { try { @@ -1327,7 +1327,7 @@ public: static void Apply(const std::string& uri) { -#if HAS_ORTHANC_PLUGIN_CHUNKED_HTTP_SERVER == 1 +#if HAS_ORTHANC_PLUGINS_CHUNKED_HTTP_SERVER == 1 OrthancPluginRegisterChunkedRestCallback( GetGlobalContext(), uri.c_str(), GetHandler == Internals::NullRestCallback ? NULL : Internals::Protect<GetHandler>, @@ -1347,7 +1347,7 @@ -#if HAS_ORTHANC_PLUGIN_STORAGE_COMMITMENT_SCP == 1 +#if HAS_ORTHANC_PLUGINS_STORAGE_COMMITMENT_SCP == 1 class IStorageCommitmentScpHandler : public boost::noncopyable { public: @@ -1460,15 +1460,15 @@ }; // helper method to convert Http headers from the plugin SDK to a std::map -void GetHttpHeaders(HttpHeaders& result, const OrthancPluginHttpRequest* request); + void GetHttpHeaders(HttpHeaders& result, const OrthancPluginHttpRequest* request); // helper method to re-serialize the get arguments from the SDK into a string -void SerializeGetArguments(std::string& output, const OrthancPluginHttpRequest* request); + void SerializeGetArguments(std::string& output, const OrthancPluginHttpRequest* request); // helper method to convert Get arguments from the plugin SDK to a std::map -void GetGetArguments(GetArguments& result, const OrthancPluginHttpRequest* request); + void GetGetArguments(GetArguments& result, const OrthancPluginHttpRequest* request); -#if HAS_ORTHANC_PLUGIN_WEBDAV == 1 +#if HAS_ORTHANC_PLUGINS_WEBDAV == 1 class IWebDavCollection : public boost::noncopyable { public: @@ -1579,7 +1579,7 @@ const std::string& javascript); -#if HAS_ORTHANC_PLUGIN_GENERIC_CALL_REST_API == 1 +#if HAS_ORTHANC_PLUGINS_GENERIC_CALL_REST_API == 1 class RestApiClient : public boost::noncopyable { private: @@ -1679,7 +1679,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_KEY_VALUE_STORES == 1 +#if HAS_ORTHANC_PLUGINS_KEY_VALUE_STORES == 1 class KeyValueStore : public boost::noncopyable { public: @@ -1734,7 +1734,7 @@ #endif -#if HAS_ORTHANC_PLUGIN_QUEUES == 1 +#if HAS_ORTHANC_PLUGINS_QUEUES == 1 class Queue : public boost::noncopyable { private: @@ -1742,7 +1742,7 @@ bool DequeueInternal(std::string& value, OrthancPluginQueueOrigin origin); -#if HAS_ORTHANC_PLUGIN_RESERVE_QUEUE_VALUE == 1 +#if HAS_ORTHANC_PLUGINS_RESERVE_QUEUE_VALUE == 1 bool ReserveInternal(std::string& value, uint64_t& valueId, OrthancPluginQueueOrigin origin, uint32_t releaseTimeout); #endif @@ -1765,7 +1765,7 @@ Enqueue(value.empty() ? NULL : value.c_str(), value.size()); } -#if HAS_ORTHANC_PLUGIN_RESERVE_QUEUE_VALUE == 1 +#if HAS_ORTHANC_PLUGINS_RESERVE_QUEUE_VALUE == 1 // Use ReserveBack() instead ORTHANC_PLUGIN_DEPRECATED #endif @@ -1774,7 +1774,7 @@ return DequeueInternal(value, OrthancPluginQueueOrigin_Back); } -#if HAS_ORTHANC_PLUGIN_RESERVE_QUEUE_VALUE == 1 +#if HAS_ORTHANC_PLUGINS_RESERVE_QUEUE_VALUE == 1 // Use ReserveFront() instead ORTHANC_PLUGIN_DEPRECATED #endif @@ -1785,15 +1785,15 @@ uint64_t GetSize(); -#if HAS_ORTHANC_PLUGIN_RESERVE_QUEUE_VALUE == 1 +#if HAS_ORTHANC_PLUGINS_RESERVE_QUEUE_VALUE == 1 bool ReserveBack(std::string& value, uint64_t& valueId, uint32_t releaseTimeout); #endif -#if HAS_ORTHANC_PLUGIN_RESERVE_QUEUE_VALUE == 1 +#if HAS_ORTHANC_PLUGINS_RESERVE_QUEUE_VALUE == 1 bool ReserveFront(std::string& value, uint64_t& valueId, uint32_t releaseTimeout); #endif -#if HAS_ORTHANC_PLUGIN_RESERVE_QUEUE_VALUE == 1 +#if HAS_ORTHANC_PLUGINS_RESERVE_QUEUE_VALUE == 1 void Acknowledge(uint64_t valueId); #endif };
--- a/Resources/Orthanc/Plugins/OrthancPluginException.h Mon Aug 17 09:32:26 2026 +0200 +++ b/Resources/Orthanc/Plugins/OrthancPluginException.h Tue Aug 18 10:18:24 2026 +0200 @@ -40,36 +40,47 @@ # define ORTHANC_PLUGINS_GET_ERROR_CODE(code) ::OrthancPluginErrorCode_ ## code #endif -#if HAS_ORTHANC_EXCEPTION == 1 && defined(__ORTHANC_FILE__) // the OrthancException accepts a detail argument -> add the file and line number -# define PLUGIN_ORTHANC_EXCEPTION_STRINGIFY_LINE_HELPER(line) #line -# define PLUGIN_ORTHANC_EXCEPTION_STRINGIFY_LINE(line) PLUGIN_ORTHANC_EXCEPTION_STRINGIFY_LINE_HELPER(line) -# define PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(errorCode) \ - throw ::Orthanc::OrthancException( \ - errorCode, #errorCode " triggered from " __ORTHANC_FILE__ ":" \ - PLUGIN_ORTHANC_EXCEPTION_STRINGIFY_LINE(__LINE__)) + +#if HAS_ORTHANC_EXCEPTION == 1 && defined(__ORTHANC_FILE__) // the OrthancException class accepts a "details" argument -> add the file and line number + +# include <boost/lexical_cast.hpp> -# define PLUGIN_THROW_WITH_FILE_AND_LINE_INFO_HELPER(errorCode, errorCodeStr) \ - throw ::Orthanc::OrthancException( \ - errorCode, "Plugin error code " + errorCodeStr + " triggered from " __ORTHANC_FILE__ ":" \ - PLUGIN_ORTHANC_EXCEPTION_STRINGIFY_LINE(__LINE__)) +# define ORTHANC_PLUGINS_EXCEPTION_STRINGIFY_LINE_HELPER(line) #line +# define ORTHANC_PLUGINS_EXCEPTION_STRINGIFY_LINE(line) ORTHANC_PLUGINS_EXCEPTION_STRINGIFY_LINE_HELPER(line) +# define ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO_HELPER(errorCode, errorCodeStr) \ + throw ::Orthanc::OrthancException( \ + errorCode, "Plugin error code " + errorCodeStr + " triggered from " __ORTHANC_FILE__ ":" \ + ORTHANC_PLUGINS_EXCEPTION_STRINGIFY_LINE(__LINE__)) + +# define ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(errorCode) \ + throw ::Orthanc::OrthancException( \ + errorCode, #errorCode " triggered from " __ORTHANC_FILE__ ":" \ + ORTHANC_PLUGINS_EXCEPTION_STRINGIFY_LINE(__LINE__)) -# define ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code) \ - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO_HELPER(static_cast<ORTHANC_PLUGINS_ERROR_ENUMERATION>(code), boost::lexical_cast<std::string>(code)) +# define ORTHANC_PLUGINS_THROW_ERROR_CODE(code) \ + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO_HELPER( \ + static_cast<ORTHANC_PLUGINS_ERROR_ENUMERATION>(code), \ + boost::lexical_cast<std::string>(code)) -# define ORTHANC_PLUGINS_THROW_EXCEPTION(code) \ - PLUGIN_THROW_WITH_FILE_AND_LINE_INFO_HELPER(ORTHANC_PLUGINS_GET_ERROR_CODE(code), boost::lexical_cast<std::string>(ORTHANC_PLUGINS_GET_ERROR_CODE(code))) +# define ORTHANC_PLUGINS_THROW_EXCEPTION(code) \ + ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO_HELPER( \ + ORTHANC_PLUGINS_GET_ERROR_CODE(code), \ + boost::lexical_cast<std::string>(ORTHANC_PLUGINS_GET_ERROR_CODE(code))) + +#else // the PluginException does not accept a "details" argument -#else // the PluginException does not accept a detail argument -# define ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code) \ - throw ORTHANC_PLUGINS_EXCEPTION_CLASS(static_cast<ORTHANC_PLUGINS_ERROR_ENUMERATION>(code)); +# define ORTHANC_PLUGINS_THROW_ERROR_CODE(code) \ + throw ORTHANC_PLUGINS_EXCEPTION_CLASS(static_cast<ORTHANC_PLUGINS_ERROR_ENUMERATION>(code)); + +# define ORTHANC_PLUGINS_THROW_WITH_FILE_AND_LINE_INFO(errorCode) \ + ORTHANC_PLUGINS_THROW_ERROR_CODE(errorCode) -# define PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(errorCode) \ - ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(errorCode) +# define ORTHANC_PLUGINS_THROW_EXCEPTION(code) \ + throw ORTHANC_PLUGINS_EXCEPTION_CLASS(ORTHANC_PLUGINS_GET_ERROR_CODE(code)); -# define ORTHANC_PLUGINS_THROW_EXCEPTION(code) \ - throw ORTHANC_PLUGINS_EXCEPTION_CLASS(ORTHANC_PLUGINS_GET_ERROR_CODE(code)); #endif + #define ORTHANC_PLUGINS_CHECK_ERROR(code) \ if (code != ORTHANC_PLUGINS_GET_ERROR_CODE(Success)) \ { \
