Mercurial > hg > orthanc
changeset 6132:38c388f7eaed attach-custom-data
fix
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Wed, 21 May 2025 23:45:42 +0200 |
parents | 24bf08f02e55 |
children | ffed14a83433 |
files | OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Wed May 21 21:31:14 2025 +0200 +++ b/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Wed May 21 23:45:42 2025 +0200 @@ -4425,7 +4425,7 @@ { OrthancPluginErrorCode code = OrthancPluginStoreKeyValue(OrthancPlugins::GetGlobalContext(), storeId_.c_str(), key.c_str(), value.c_str(), value.size()); - if (code == OrthancPluginErrorCode_Success) + if (code != OrthancPluginErrorCode_Success) { ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); } @@ -4437,16 +4437,16 @@ bool KeyValueStore::GetValue(std::string& value, const std::string& key) { - uint8_t found = false; + uint8_t isExisting = false; OrthancPlugins::MemoryBuffer valueBuffer; - OrthancPluginErrorCode code = OrthancPluginGetKeyValue(OrthancPlugins::GetGlobalContext(), &found, + OrthancPluginErrorCode code = OrthancPluginGetKeyValue(OrthancPlugins::GetGlobalContext(), &isExisting, *valueBuffer, storeId_.c_str(), key.c_str()); if (code != OrthancPluginErrorCode_Success) { ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); } - else if (found) + else if (isExisting) { valueBuffer.ToString(value); return true; @@ -4499,17 +4499,17 @@ bool Queue::PopInternal(std::string& value, OrthancPluginQueueOrigin origin) { - uint8_t found = false; + uint8_t isExisting = false; OrthancPlugins::MemoryBuffer valueBuffer; - OrthancPluginErrorCode code = OrthancPluginDequeueValue(OrthancPlugins::GetGlobalContext(), &found, + OrthancPluginErrorCode code = OrthancPluginDequeueValue(OrthancPlugins::GetGlobalContext(), &isExisting, *valueBuffer, queueId_.c_str(), origin); if (code != OrthancPluginErrorCode_Success) { ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); } - else if (found) + else if (isExisting) { valueBuffer.ToString(value); return true;