comparison Plugins/Samples/Common/OrthancPluginCppWrapper.h @ 2231:61e0564d03bb

backwards compatibility within OrthancPluginCppWrapper
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 14 Dec 2016 16:41:58 +0100
parents 028214a95194
children a78d15509a1c
comparison
equal deleted inserted replaced
2230:40293e60f224 2231:61e0564d03bb
48 #else 48 #else
49 # define ORTHANC_PLUGINS_THROW_EXCEPTION(code) throw ::OrthancPlugins::PluginException(code) 49 # define ORTHANC_PLUGINS_THROW_EXCEPTION(code) throw ::OrthancPlugins::PluginException(code)
50 #endif 50 #endif
51 51
52 52
53 #if (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER >= 2 || \
54 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == 1 && \
55 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER >= 2))
56 // The "OrthancPluginFindMatcher()" primitive was introduced in Orthanc 1.2.0
57 # define HAS_ORTHANC_PLUGIN_FIND_MATCHER 1
58 #else
59 # define HAS_ORTHANC_PLUGIN_FIND_MATCHER 0
60 #endif
61
62
63
53 64
54 namespace OrthancPlugins 65 namespace OrthancPlugins
55 { 66 {
56 typedef void (*RestCallback) (OrthancPluginRestOutput* output, 67 typedef void (*RestCallback) (OrthancPluginRestOutput* output,
57 const char* url, 68 const char* url,
332 void AnswerJpegImage(OrthancPluginRestOutput* output, 343 void AnswerJpegImage(OrthancPluginRestOutput* output,
333 uint8_t quality); 344 uint8_t quality);
334 }; 345 };
335 346
336 347
348 #if HAS_ORTHANC_PLUGIN_FIND_MATCHER == 1
337 class FindMatcher : public boost::noncopyable 349 class FindMatcher : public boost::noncopyable
338 { 350 {
339 private: 351 private:
340 OrthancPluginContext* context_; 352 OrthancPluginContext* context_;
341 OrthancPluginFindMatcher* matcher_; 353 OrthancPluginFindMatcher* matcher_;
370 bool IsMatch(const MemoryBuffer& dicom) const 382 bool IsMatch(const MemoryBuffer& dicom) const
371 { 383 {
372 return IsMatch(dicom.GetData(), dicom.GetSize()); 384 return IsMatch(dicom.GetData(), dicom.GetSize());
373 } 385 }
374 }; 386 };
387 #endif
375 388
376 389
377 bool RestApiGet(Json::Value& result, 390 bool RestApiGet(Json::Value& result,
378 OrthancPluginContext* context, 391 OrthancPluginContext* context,
379 const std::string& uri, 392 const std::string& uri,