comparison Plugins/Samples/Common/OrthancPluginCppWrapper.cpp @ 3039:0293cb3d8a37

fix for msvc
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 Dec 2018 09:26:09 +0100
parents ff65c925f57a
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
3035:3254b36a5f9b 3039:0293cb3d8a37
209 { 209 {
210 Clear(); 210 Clear();
211 211
212 std::vector<const char*> headersKeys; 212 std::vector<const char*> headersKeys;
213 std::vector<const char*> headersValues; 213 std::vector<const char*> headersValues;
214 for (std::map<std::string, std::string>::const_iterator it = httpHeaders.begin(); it != httpHeaders.end(); it++) 214
215 for (std::map<std::string, std::string>::const_iterator
216 it = httpHeaders.begin(); it != httpHeaders.end(); it++)
215 { 217 {
216 headersKeys.push_back(it->first.c_str()); 218 headersKeys.push_back(it->first.c_str());
217 headersValues.push_back(it->second.c_str()); 219 headersValues.push_back(it->second.c_str());
218 } 220 }
219 221
220 return CheckHttp(OrthancPluginRestApiGet2(GetGlobalContext(), &buffer_, uri.c_str(), httpHeaders.size(), headersKeys.data(), headersValues.data(), applyPlugins)); 222 return CheckHttp(OrthancPluginRestApiGet2(
223 GetGlobalContext(), &buffer_, uri.c_str(), httpHeaders.size(),
224 (headersKeys.empty() ? NULL : &headersKeys[0]),
225 (headersValues.empty() ? NULL : &headersValues[0]), applyPlugins));
221 } 226 }
222 227
223 bool MemoryBuffer::RestApiPost(const std::string& uri, 228 bool MemoryBuffer::RestApiPost(const std::string& uri,
224 const char* body, 229 const char* body,
225 size_t bodySize, 230 size_t bodySize,