Mercurial > hg > orthanc-databases
comparison Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp @ 491:711b136e8fe8
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 22 Mar 2024 14:42:36 +0100 |
parents | ecd0b719cff5 |
children | 54d518dcd74a |
comparison
equal
deleted
inserted
replaced
490:b3876cbb93a2 | 491:711b136e8fe8 |
---|---|
4024 for (uint32_t i = 0; i < request->headersCount; ++i) | 4024 for (uint32_t i = 0; i < request->headersCount; ++i) |
4025 { | 4025 { |
4026 result[request->headersKeys[i]] = request->headersValues[i]; | 4026 result[request->headersKeys[i]] = request->headersValues[i]; |
4027 } | 4027 } |
4028 } | 4028 } |
4029 | |
4030 #if !ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4) | |
4031 static void SetPluginProperty(const std::string& pluginIdentifier, | |
4032 _OrthancPluginProperty property, | |
4033 const std::string& value) | |
4034 { | |
4035 _OrthancPluginSetPluginProperty params; | |
4036 params.plugin = pluginIdentifier.c_str(); | |
4037 params.property = property; | |
4038 params.value = value.c_str(); | |
4039 | |
4040 GetGlobalContext()->InvokeService(GetGlobalContext(), _OrthancPluginService_SetPluginProperty, ¶ms); | |
4041 } | |
4042 #endif | |
4043 | |
4044 void SetRootUri(const std::string& pluginIdentifier, | |
4045 const std::string& uri) | |
4046 { | |
4047 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4) | |
4048 OrthancPluginSetRootUri2(GetGlobalContext(), pluginIdentifier.c_str(), uri.c_str()); | |
4049 #else | |
4050 SetPluginProperty(pluginIdentifier, _OrthancPluginProperty_RootUri, uri); | |
4051 #endif | |
4052 } | |
4053 | |
4054 void SetDescription(const std::string& pluginIdentifier, | |
4055 const std::string& description) | |
4056 { | |
4057 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4) | |
4058 OrthancPluginSetDescription2(GetGlobalContext(), pluginIdentifier.c_str(), description.c_str()); | |
4059 #else | |
4060 SetPluginProperty(pluginIdentifier, _OrthancPluginProperty_Description, description); | |
4061 #endif | |
4062 } | |
4063 | |
4064 void ExtendOrthancExplorer(const std::string& pluginIdentifier, | |
4065 const std::string& javascript) | |
4066 { | |
4067 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4) | |
4068 OrthancPluginExtendOrthancExplorer2(GetGlobalContext(), pluginIdentifier.c_str(), javascript.c_str()); | |
4069 #else | |
4070 SetPluginProperty(pluginIdentifier, _OrthancPluginProperty_OrthancExplorer, javascript); | |
4071 #endif | |
4072 } | |
4029 } | 4073 } |