Mercurial > hg > orthanc
comparison Plugins/Samples/Common/OrthancPluginCppWrapper.cpp @ 2979:5947aeedf41f
added C++ plugin helpers
author | am@osimis.io |
---|---|
date | Thu, 06 Dec 2018 13:10:00 +0100 |
parents | 9b734c3e1095 |
children | db8f360fcb41 |
comparison
equal
deleted
inserted
replaced
2975:e62e296a5714 | 2979:5947aeedf41f |
---|---|
1121 std::string bodyString = writer.write(value); | 1121 std::string bodyString = writer.write(value); |
1122 | 1122 |
1123 OrthancPluginAnswerBuffer(GetGlobalContext(), output, bodyString.c_str(), bodyString.size(), "application/json"); | 1123 OrthancPluginAnswerBuffer(GetGlobalContext(), output, bodyString.c_str(), bodyString.size(), "application/json"); |
1124 } | 1124 } |
1125 | 1125 |
1126 void AnswerHttpError(uint16_t httpError, OrthancPluginRestOutput *output) | |
1127 { | |
1128 OrthancPluginSendHttpStatusCode(GetGlobalContext(), output, httpError); | |
1129 } | |
1130 | |
1131 void AnswerMethodNotAllowed(OrthancPluginRestOutput *output, const char* allowedMethods) | |
1132 { | |
1133 OrthancPluginSendMethodNotAllowed(GetGlobalContext(), output, allowedMethods); | |
1134 } | |
1135 | |
1126 bool RestApiGetString(std::string& result, | 1136 bool RestApiGetString(std::string& result, |
1127 const std::string& uri, | 1137 const std::string& uri, |
1128 bool applyPlugins) | 1138 bool applyPlugins) |
1129 { | 1139 { |
1130 MemoryBuffer answer; | 1140 MemoryBuffer answer; |