Mercurial > hg > orthanc
comparison Plugins/Engine/OrthancPlugins.cpp @ 1962:22ddb22fce83
sample plugin
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 07 Apr 2016 17:42:20 +0200 |
parents | ef1e9856c26f |
children | 9f09a20e41e2 |
comparison
equal
deleted
inserted
replaced
1961:ef1e9856c26f | 1962:22ddb22fce83 |
---|---|
2429 const char* uri, | 2429 const char* uri, |
2430 const char* ip, | 2430 const char* ip, |
2431 const char* username, | 2431 const char* username, |
2432 const IHttpHandler::Arguments& httpHeaders) const | 2432 const IHttpHandler::Arguments& httpHeaders) const |
2433 { | 2433 { |
2434 std::vector<const char*> httpKeys; | 2434 std::vector<const char*> httpKeys(httpHeaders.size()); |
2435 std::vector<const char*> httpValues; | 2435 std::vector<const char*> httpValues(httpHeaders.size()); |
2436 | |
2437 httpKeys.reserve(httpHeaders.size()); | |
2438 httpValues.reserve(httpHeaders.size()); | |
2439 | 2436 |
2440 size_t pos = 0; | 2437 size_t pos = 0; |
2441 for (IHttpHandler::Arguments::const_iterator | 2438 for (IHttpHandler::Arguments::const_iterator |
2442 it = httpHeaders.begin(); it != httpHeaders.end(); ++it, pos++) | 2439 it = httpHeaders.begin(); it != httpHeaders.end(); ++it, pos++) |
2443 { | 2440 { |
2444 httpKeys[pos] = it->first.c_str(); | 2441 httpKeys[pos] = it->first.c_str(); |
2445 httpValues[pos] = it->first.c_str(); | 2442 httpValues[pos] = it->second.c_str(); |
2446 } | 2443 } |
2447 | 2444 |
2448 OrthancPluginHttpMethod cMethod = Plugins::Convert(method); | 2445 OrthancPluginHttpMethod cMethod = Plugins::Convert(method); |
2449 const char** cHttpKeys = (httpKeys.size() == 0 ? NULL : &httpKeys[0]); | 2446 const char** cHttpKeys = (httpKeys.size() == 0 ? NULL : &httpKeys[0]); |
2450 const char** cHttpValues = (httpValues.size() == 0 ? NULL : &httpValues[0]); | 2447 const char** cHttpValues = (httpValues.size() == 0 ? NULL : &httpValues[0]); |