Mercurial > hg > orthanc
comparison Plugins/Samples/Common/OrthancPluginConnection.cpp @ 2237:403d92d8df83
cont
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 16 Dec 2016 14:45:40 +0100 |
parents | 1d0838b8e9c5 |
children | a3a65de1840f |
comparison
equal
deleted
inserted
replaced
2236:55843d0139d3 | 2237:403d92d8df83 |
---|---|
45 { | 45 { |
46 buffer.ToString(result); | 46 buffer.ToString(result); |
47 } | 47 } |
48 else | 48 else |
49 { | 49 { |
50 ORTHANC_PLUGINS_THROW_EXCEPTION(OrthancPluginErrorCode_UnknownResource); | 50 ORTHANC_PLUGINS_THROW_EXCEPTION(UnknownResource); |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 | 54 |
55 void OrthancPluginConnection::RestApiPost(std::string& result, | 55 void OrthancPluginConnection::RestApiPost(std::string& result, |
62 { | 62 { |
63 buffer.ToString(result); | 63 buffer.ToString(result); |
64 } | 64 } |
65 else | 65 else |
66 { | 66 { |
67 ORTHANC_PLUGINS_THROW_EXCEPTION(OrthancPluginErrorCode_UnknownResource); | 67 ORTHANC_PLUGINS_THROW_EXCEPTION(UnknownResource); |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 | 71 |
72 void OrthancPluginConnection::RestApiPut(std::string& result, | 72 void OrthancPluginConnection::RestApiPut(std::string& result, |
79 { | 79 { |
80 buffer.ToString(result); | 80 buffer.ToString(result); |
81 } | 81 } |
82 else | 82 else |
83 { | 83 { |
84 ORTHANC_PLUGINS_THROW_EXCEPTION(OrthancPluginErrorCode_UnknownResource); | 84 ORTHANC_PLUGINS_THROW_EXCEPTION(UnknownResource); |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 | 88 |
89 void OrthancPluginConnection::RestApiDelete(const std::string& uri) | 89 void OrthancPluginConnection::RestApiDelete(const std::string& uri) |
90 { | 90 { |
91 OrthancPlugins::MemoryBuffer buffer(context_); | 91 OrthancPlugins::MemoryBuffer buffer(context_); |
92 | 92 |
93 if (!::OrthancPlugins::RestApiDelete(context_, uri, false)) | 93 if (!::OrthancPlugins::RestApiDelete(context_, uri, false)) |
94 { | 94 { |
95 ORTHANC_PLUGINS_THROW_EXCEPTION(OrthancPluginErrorCode_UnknownResource); | 95 ORTHANC_PLUGINS_THROW_EXCEPTION(UnknownResource); |
96 } | 96 } |
97 } | 97 } |
98 } | 98 } |