Mercurial > hg > orthanc
comparison Plugins/Samples/Common/OrthancPluginCppWrapper.h @ 2059:8e67325eaa3f
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 30 Jun 2016 20:02:21 +0200 |
parents | 43cd2ab060c7 |
children | e12d83e9ee59 |
comparison
equal
deleted
inserted
replaced
2058:43cd2ab060c7 | 2059:8e67325eaa3f |
---|---|
63 { | 63 { |
64 return code_; | 64 return code_; |
65 } | 65 } |
66 | 66 |
67 const char* GetErrorDescription(OrthancPluginContext* context) const; | 67 const char* GetErrorDescription(OrthancPluginContext* context) const; |
68 | |
69 static void Check(OrthancPluginErrorCode code); | |
68 }; | 70 }; |
69 | 71 |
70 | 72 |
71 class MemoryBuffer : public boost::noncopyable | 73 class MemoryBuffer : public boost::noncopyable |
72 { | 74 { |
145 const std::string& body, | 147 const std::string& body, |
146 bool applyPlugins) | 148 bool applyPlugins) |
147 { | 149 { |
148 return RestApiPut(uri, body.empty() ? NULL : body.c_str(), body.size(), applyPlugins); | 150 return RestApiPut(uri, body.empty() ? NULL : body.c_str(), body.size(), applyPlugins); |
149 } | 151 } |
152 | |
153 void CreateDicom(const Json::Value& tags, | |
154 OrthancPluginCreateDicomFlags flags); | |
150 }; | 155 }; |
151 | 156 |
152 | 157 |
153 class OrthancString : public boost::noncopyable | 158 class OrthancString : public boost::noncopyable |
154 { | 159 { |
353 bool applyPlugins); | 358 bool applyPlugins); |
354 | 359 |
355 inline void LogError(OrthancPluginContext* context, | 360 inline void LogError(OrthancPluginContext* context, |
356 const std::string& message) | 361 const std::string& message) |
357 { | 362 { |
358 OrthancPluginLogError(context, message.c_str()); | 363 if (context != NULL) |
364 { | |
365 OrthancPluginLogError(context, message.c_str()); | |
366 } | |
359 } | 367 } |
360 | 368 |
361 inline void LogWarning(OrthancPluginContext* context, | 369 inline void LogWarning(OrthancPluginContext* context, |
362 const std::string& message) | 370 const std::string& message) |
363 { | 371 { |
364 OrthancPluginLogWarning(context, message.c_str()); | 372 if (context != NULL) |
373 { | |
374 OrthancPluginLogWarning(context, message.c_str()); | |
375 } | |
365 } | 376 } |
366 | 377 |
367 inline void LogInfo(OrthancPluginContext* context, | 378 inline void LogInfo(OrthancPluginContext* context, |
368 const std::string& message) | 379 const std::string& message) |
369 { | 380 { |
370 OrthancPluginLogInfo(context, message.c_str()); | 381 if (context != NULL) |
382 { | |
383 OrthancPluginLogInfo(context, message.c_str()); | |
384 } | |
371 } | 385 } |
372 | 386 |
373 | 387 |
374 namespace Internals | 388 namespace Internals |
375 { | 389 { |