Mercurial > hg > orthanc
comparison Plugins/Engine/OrthancPlugins.cpp @ 3397:9019279dbfd7
new plugin c++ wrapper: MultipartRestCallback
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 07 Jun 2019 11:26:34 +0200 |
parents | 4981405e6c5c |
children | 4e8205871967 |
comparison
equal
deleted
inserted
replaced
3396:4981405e6c5c | 3397:9019279dbfd7 |
---|---|
4140 size_t size) | 4140 size_t size) |
4141 { | 4141 { |
4142 assert(handler_ != NULL); | 4142 assert(handler_ != NULL); |
4143 | 4143 |
4144 // TODO => multipart parsing | 4144 // TODO => multipart parsing |
4145 | |
4146 OrthancPluginErrorCode error = | |
4147 parameters_.addPart(handler_, "content-type", 0 /* headers */, NULL, NULL, | |
4148 data, size); | |
4149 | |
4150 if (error != OrthancPluginErrorCode_Success) | |
4151 { | |
4152 errorDictionary_.LogError(error, true); | |
4153 throw OrthancException(static_cast<ErrorCode>(error)); | |
4154 } | |
4145 } | 4155 } |
4146 | 4156 |
4147 virtual void Execute(HttpOutput& output) | 4157 virtual void Execute(HttpOutput& output) |
4148 { | 4158 { |
4149 assert(handler_ != NULL); | 4159 assert(handler_ != NULL); |
4193 throw OrthancException(ErrorCode_ParameterOutOfRange); | 4203 throw OrthancException(ErrorCode_ParameterOutOfRange); |
4194 } | 4204 } |
4195 | 4205 |
4196 std::string contentType = "TODO"; // TODO | 4206 std::string contentType = "TODO"; // TODO |
4197 | 4207 |
4198 OrthancPluginMultipartRestHandler* handler = (*it)->GetParameters().factory( | 4208 OrthancPluginMultipartRestHandler* handler = (*it)->GetParameters().createHandler( |
4209 (*it)->GetParameters().factory, | |
4199 convertedMethod, matcher.GetFlatUri().c_str(), contentType.c_str(), | 4210 convertedMethod, matcher.GetFlatUri().c_str(), contentType.c_str(), |
4200 matcher.GetGroupsCount(), matcher.GetGroups(), headers.size(), | 4211 matcher.GetGroupsCount(), matcher.GetGroups(), headers.size(), |
4201 headers.empty() ? NULL : &headersKeys[0], | 4212 headers.empty() ? NULL : &headersKeys[0], |
4202 headers.empty() ? NULL : &headersValues[0]); | 4213 headers.empty() ? NULL : &headersValues[0]); |
4203 | 4214 |