Mercurial > hg > orthanc
comparison Plugins/Engine/OrthancPlugins.cpp @ 2823:807169f85ba9
OrthancPluginGetPeerUserProperty()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 18 Sep 2018 15:38:18 +0200 |
parents | 3e048b243d20 |
children | d4fd4614f275 |
comparison
equal
deleted
inserted
replaced
2822:a0b729ac0549 | 2823:807169f85ba9 |
---|---|
2870 *(p.target) = reinterpret_cast<const OrthancPeers*>(p.peers)->GetPeerParameters(p.peerIndex).GetUrl().c_str(); | 2870 *(p.target) = reinterpret_cast<const OrthancPeers*>(p.peers)->GetPeerParameters(p.peerIndex).GetUrl().c_str(); |
2871 return true; | 2871 return true; |
2872 } | 2872 } |
2873 } | 2873 } |
2874 | 2874 |
2875 case _OrthancPluginService_GetPeerUserProperty: | |
2876 { | |
2877 const _OrthancPluginGetPeerProperty& p = | |
2878 *reinterpret_cast<const _OrthancPluginGetPeerProperty*>(parameters); | |
2879 | |
2880 if (p.peers == NULL || | |
2881 p.userProperty == NULL) | |
2882 { | |
2883 throw OrthancException(ErrorCode_NullPointer); | |
2884 } | |
2885 else | |
2886 { | |
2887 const WebServiceParameters::Dictionary& properties = | |
2888 reinterpret_cast<const OrthancPeers*>(p.peers)->GetPeerParameters(p.peerIndex).GetUserProperties(); | |
2889 | |
2890 WebServiceParameters::Dictionary::const_iterator found = | |
2891 properties.find(p.userProperty); | |
2892 | |
2893 if (found == properties.end()) | |
2894 { | |
2895 *(p.target) = NULL; | |
2896 } | |
2897 else | |
2898 { | |
2899 *(p.target) = found->second.c_str(); | |
2900 } | |
2901 | |
2902 return true; | |
2903 } | |
2904 } | |
2905 | |
2875 case _OrthancPluginService_CallPeerApi: | 2906 case _OrthancPluginService_CallPeerApi: |
2876 CallPeerApi(parameters); | 2907 CallPeerApi(parameters); |
2877 return true; | 2908 return true; |
2878 | 2909 |
2879 case _OrthancPluginService_CreateJob: | 2910 case _OrthancPluginService_CreateJob: |