comparison Plugins/Engine/PluginsHttpHandler.cpp @ 907:9b8298234254 plugins

documentation
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 19 Jun 2014 14:28:43 +0200
parents 2732b5f57d9c
children e078ea944089
comparison
equal deleted inserted replaced
906:cbc0ea03dffe 907:9b8298234254
188 return true; 188 return true;
189 } 189 }
190 } 190 }
191 191
192 192
193 bool PluginsHttpHandler::InvokeService(OrthancPluginService service, 193 bool PluginsHttpHandler::InvokeService(_OrthancPluginService service,
194 const void* parameters) 194 const void* parameters)
195 { 195 {
196 switch (service) 196 switch (service)
197 { 197 {
198 case OrthancPluginService_RegisterRestCallback: 198 case _OrthancPluginService_RegisterRestCallback:
199 { 199 {
200 const _OrthancPluginRestCallback& p = 200 const _OrthancPluginRestCallback& p =
201 *reinterpret_cast<const _OrthancPluginRestCallback*>(parameters); 201 *reinterpret_cast<const _OrthancPluginRestCallback*>(parameters);
202 202
203 LOG(INFO) << "Plugin has registered a REST callback on: " << p.pathRegularExpression; 203 LOG(INFO) << "Plugin has registered a REST callback on: " << p.pathRegularExpression;
204 pimpl_->callbacks_.push_back(std::make_pair(new boost::regex(p.pathRegularExpression), p.callback)); 204 pimpl_->callbacks_.push_back(std::make_pair(new boost::regex(p.pathRegularExpression), p.callback));
205 205
206 return true; 206 return true;
207 } 207 }
208 208
209 case OrthancPluginService_AnswerBuffer: 209 case _OrthancPluginService_AnswerBuffer:
210 { 210 {
211 const _OrthancPluginAnswerBuffer& p = 211 const _OrthancPluginAnswerBuffer& p =
212 *reinterpret_cast<const _OrthancPluginAnswerBuffer*>(parameters); 212 *reinterpret_cast<const _OrthancPluginAnswerBuffer*>(parameters);
213 213
214 HttpOutput* translatedOutput = reinterpret_cast<HttpOutput*>(p.output); 214 HttpOutput* translatedOutput = reinterpret_cast<HttpOutput*>(p.output);
215 translatedOutput->AnswerBufferWithContentType(p.answer, p.answerSize, p.mimeType); 215 translatedOutput->AnswerBufferWithContentType(p.answer, p.answerSize, p.mimeType);
216 216
217 return true; 217 return true;
218 } 218 }
219 219
220 case OrthancPluginService_CompressAndAnswerPngImage: 220 case _OrthancPluginService_CompressAndAnswerPngImage:
221 { 221 {
222 const _OrthancPluginCompressAndAnswerPngImage& p = 222 const _OrthancPluginCompressAndAnswerPngImage& p =
223 *reinterpret_cast<const _OrthancPluginCompressAndAnswerPngImage*>(parameters); 223 *reinterpret_cast<const _OrthancPluginCompressAndAnswerPngImage*>(parameters);
224 224
225 HttpOutput* translatedOutput = reinterpret_cast<HttpOutput*>(p.output); 225 HttpOutput* translatedOutput = reinterpret_cast<HttpOutput*>(p.output);
261 translatedOutput->AnswerBufferWithContentType(png, "image/png"); 261 translatedOutput->AnswerBufferWithContentType(png, "image/png");
262 262
263 return true; 263 return true;
264 } 264 }
265 265
266 case OrthancPluginService_GetDicomForInstance: 266 case _OrthancPluginService_GetDicomForInstance:
267 { 267 {
268 const _OrthancPluginGetDicomForInstance& p = 268 const _OrthancPluginGetDicomForInstance& p =
269 *reinterpret_cast<const _OrthancPluginGetDicomForInstance*>(parameters); 269 *reinterpret_cast<const _OrthancPluginGetDicomForInstance*>(parameters);
270 270
271 std::string dicom; 271 std::string dicom;