changeset 3392:ad434967a68c

renames
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 06 Jun 2019 10:35:16 +0200
parents df0f1821b3de
children 2cd0369a156f
files Core/HttpClient.cpp Core/HttpClient.h Plugins/Engine/OrthancPlugins.cpp Plugins/Engine/OrthancPlugins.h Plugins/Include/orthanc/OrthancCPlugin.h Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Plugins/Samples/Common/OrthancPluginCppWrapper.h
diffstat 7 files changed, 61 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/Core/HttpClient.cpp	Thu Jun 06 10:19:28 2019 +0200
+++ b/Core/HttpClient.cpp	Thu Jun 06 10:35:16 2019 +0200
@@ -201,11 +201,11 @@
   };
 
 
-  class HttpClient::CurlChunkedBody : public boost::noncopyable
+  class HttpClient::CurlRequestChunkedBody : public boost::noncopyable
   {
   private:
-    HttpClient::IChunkedBody*  body_;
-    std::string                buffer_;
+    HttpClient::IRequestChunkedBody*  body_;
+    std::string                       buffer_;
 
     size_t CallbackInternal(char* curlBuffer,
                             size_t curlBufferSize)
@@ -243,12 +243,12 @@
     }
     
   public:
-    CurlChunkedBody() :
+    CurlRequestChunkedBody() :
       body_(NULL)
     {
     }
 
-    void SetBody(HttpClient::IChunkedBody& body)
+    void SetBody(HttpClient::IRequestChunkedBody& body)
     {
       body_ = &body;
       buffer_.clear();
@@ -272,7 +272,7 @@
     {
       try
       {
-        HttpClient::CurlChunkedBody* body = reinterpret_cast<HttpClient::CurlChunkedBody*>(userdata);
+        HttpClient::CurlRequestChunkedBody* body = reinterpret_cast<HttpClient::CurlRequestChunkedBody*>(userdata);
 
         if (body == NULL)
         {
@@ -404,7 +404,7 @@
     CurlHeaders defaultPostHeaders_;
     CurlHeaders defaultChunkedHeaders_;
     CurlHeaders userHeaders_;
-    CurlChunkedBody chunkedBody_;
+    CurlRequestChunkedBody chunkedBody_;
   };
 
 
@@ -608,7 +608,7 @@
   }
 
 
-  void HttpClient::SetBody(IChunkedBody& body)
+  void HttpClient::SetBody(IRequestChunkedBody& body)
   {
     body_.clear();
     pimpl_->chunkedBody_.SetBody(body);
@@ -829,7 +829,7 @@
 
       if (pimpl_->chunkedBody_.IsValid())
       {
-        CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_READFUNCTION, CurlChunkedBody::Callback));
+        CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_READFUNCTION, CurlRequestChunkedBody::Callback));
         CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_READDATA, &pimpl_->chunkedBody_));
         CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_POST, 1L));
         CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_POSTFIELDSIZE, -1L));
--- a/Core/HttpClient.h	Thu Jun 06 10:19:28 2019 +0200
+++ b/Core/HttpClient.h	Thu Jun 06 10:35:16 2019 +0200
@@ -57,10 +57,10 @@
   public:
     typedef std::map<std::string, std::string>  HttpHeaders;
 
-    class IChunkedBody : public boost::noncopyable
+    class IRequestChunkedBody : public boost::noncopyable
     {
     public:
-      virtual ~IChunkedBody()
+      virtual ~IRequestChunkedBody()
       {
       }
       
@@ -69,7 +69,7 @@
 
   private:
     class CurlHeaders;
-    class CurlChunkedBody;
+    class CurlRequestChunkedBody;
     class GlobalParameters;
 
     struct PImpl;
@@ -158,7 +158,7 @@
       return body_;
     }
 
-    void SetBody(IChunkedBody& body);
+    void SetBody(IRequestChunkedBody& body);
 
     void ClearBody();
 
--- a/Plugins/Engine/OrthancPlugins.cpp	Thu Jun 06 10:19:28 2019 +0200
+++ b/Plugins/Engine/OrthancPlugins.cpp	Thu Jun 06 10:35:16 2019 +0200
@@ -976,15 +976,15 @@
 
 
 
-  class OrthancPlugins::ChunkedBody : public HttpClient::IChunkedBody
+  class OrthancPlugins::HttpRequestBody : public HttpClient::IRequestChunkedBody
   {
   private:
     const _OrthancPluginHttpClientChunkedBody&  params_;
     PluginsErrorDictionary&                     errorDictionary_;
 
   public:
-    ChunkedBody(const _OrthancPluginHttpClientChunkedBody& params,
-               PluginsErrorDictionary&  errorDictionary) :
+    HttpRequestBody(const _OrthancPluginHttpClientChunkedBody& params,
+                       PluginsErrorDictionary&  errorDictionary) :
       params_(params),
       errorDictionary_(errorDictionary)
     {
@@ -992,23 +992,23 @@
 
     virtual bool ReadNextChunk(std::string& chunk)
     {
-      if (params_.bodyDone(params_.body))
+      if (params_.requestBodyIsDone(params_.requestBody))
       {
         return false;
       }
       else
       {
-        size_t size = params_.bodyChunkSize(params_.body);
+        size_t size = params_.requestBodyChunkSize(params_.requestBody);
 
         chunk.resize(size);
         
         if (size != 0)
         {
-          const void* data = params_.bodyChunkData(params_.body);
+          const void* data = params_.requestBodyChunkData(params_.requestBody);
           memcpy(&chunk[0], data, size);
         }
 
-        OrthancPluginErrorCode error = params_.bodyNext(params_.body);
+        OrthancPluginErrorCode error = params_.requestBodyNext(params_.requestBody);
         
         if (error != OrthancPluginErrorCode_Success)
         {
@@ -2251,7 +2251,7 @@
                              "This plugin service is only allowed for PUT and POST HTTP requests");
     }
 
-    ChunkedBody body(p, pimpl_->dictionary_);
+    HttpRequestBody body(p, pimpl_->dictionary_);
 
     HttpClient client;
     client.SetBody(body);
--- a/Plugins/Engine/OrthancPlugins.h	Thu Jun 06 10:19:28 2019 +0200
+++ b/Plugins/Engine/OrthancPlugins.h	Thu Jun 06 10:35:16 2019 +0200
@@ -89,7 +89,7 @@
     class WorklistHandler;
     class FindHandler;
     class MoveHandler;
-    class ChunkedBody;
+    class HttpRequestBody;
     
     void RegisterRestCallback(const void* parameters,
                               bool lock);
--- a/Plugins/Include/orthanc/OrthancCPlugin.h	Thu Jun 06 10:19:28 2019 +0200
+++ b/Plugins/Include/orthanc/OrthancCPlugin.h	Thu Jun 06 10:35:16 2019 +0200
@@ -6810,13 +6810,13 @@
 
 
 
-  typedef uint8_t (*OrthancPluginChunkedBodyIsDone) (void* body);
-
-  typedef OrthancPluginErrorCode (*OrthancPluginChunkedBodyNext) (void* body);
-
-  typedef const void* (*OrthancPluginChunkedBodyGetChunkData) (void* body);
-
-  typedef uint32_t (*OrthancPluginChunkedBodyGetChunkSize) (void* body);
+  typedef uint8_t (*OrthancPluginHttpRequestBodyIsDone) (void* body);
+
+  typedef OrthancPluginErrorCode (*OrthancPluginHttpRequestBodyNext) (void* body);
+
+  typedef const void* (*OrthancPluginHttpRequestBodyGetChunkData) (void* body);
+
+  typedef uint32_t (*OrthancPluginHttpRequestBodyGetChunkSize) (void* body);
 
   
 
@@ -6837,11 +6837,11 @@
     const char*                           certificateKeyFile;
     const char*                           certificateKeyPassword;
     uint8_t                               pkcs11;
-    void*                                 body;
-    OrthancPluginChunkedBodyIsDone        bodyDone;
-    OrthancPluginChunkedBodyGetChunkData  bodyChunkData;
-    OrthancPluginChunkedBodyGetChunkSize  bodyChunkSize;
-    OrthancPluginChunkedBodyNext          bodyNext;
+    void*                                 requestBody;
+    OrthancPluginHttpRequestBodyIsDone        requestBodyIsDone;
+    OrthancPluginHttpRequestBodyGetChunkData  requestBodyChunkData;
+    OrthancPluginHttpRequestBodyGetChunkSize  requestBodyChunkSize;
+    OrthancPluginHttpRequestBodyNext          requestBodyNext;
   } _OrthancPluginHttpClientChunkedBody;
 
   ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginHttpClientChunkedBody(
@@ -6861,11 +6861,11 @@
     const char*                           certificateKeyFile,
     const char*                           certificateKeyPassword,
     uint8_t                               pkcs11,
-    void*                                 body,
-    OrthancPluginChunkedBodyIsDone        bodyDone,
-    OrthancPluginChunkedBodyGetChunkData  bodyChunkData,
-    OrthancPluginChunkedBodyGetChunkSize  bodyChunkSize,
-    OrthancPluginChunkedBodyNext          bodyNext)
+    void*                                 requestBody,
+    OrthancPluginHttpRequestBodyIsDone        requestBodyIsDone,
+    OrthancPluginHttpRequestBodyGetChunkData  requestBodyChunkData,
+    OrthancPluginHttpRequestBodyGetChunkSize  requestBodyChunkSize,
+    OrthancPluginHttpRequestBodyNext          requestBodyNext)
   {
     _OrthancPluginHttpClientChunkedBody params;
     memset(&params, 0, sizeof(params));
@@ -6888,11 +6888,11 @@
     params.pkcs11 = pkcs11;
 
     /* For body stream */
-    params.body = body;
-    params.bodyDone = bodyDone;
-    params.bodyChunkData = bodyChunkData;
-    params.bodyChunkSize = bodyChunkSize;
-    params.bodyNext = bodyNext;
+    params.requestBody = requestBody;
+    params.requestBodyIsDone = requestBodyIsDone;
+    params.requestBodyChunkData = requestBodyChunkData;
+    params.requestBodyChunkSize = requestBodyChunkSize;
+    params.requestBodyNext = requestBodyNext;
 
     return context->InvokeService(context, _OrthancPluginService_HttpClientChunkedBody, &params);
   }
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Thu Jun 06 10:19:28 2019 +0200
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Thu Jun 06 10:35:16 2019 +0200
@@ -2060,21 +2060,21 @@
 
 #if HAS_ORTHANC_PLUGIN_HTTP_CLIENT == 1
 #if HAS_ORTHANC_PLUGIN_HTTP_CHUNKED_BODY == 1
-  class HttpClient::ChunkedBody : public boost::noncopyable
+  class HttpClient::RequestChunkedBody : public boost::noncopyable
   {
   private:
-    static ChunkedBody& GetObject(void* body)
+    static RequestChunkedBody& GetObject(void* body)
     {
       assert(body != NULL);
-      return *reinterpret_cast<ChunkedBody*>(body);
+      return *reinterpret_cast<RequestChunkedBody*>(body);
     }
 
-    IChunkedBody&  body_;
+    IRequestChunkedBody&  body_;
     bool           done_;
     std::string    chunk_;
 
   public:
-    ChunkedBody(IChunkedBody& body) :
+    RequestChunkedBody(IRequestChunkedBody& body) :
       body_(body),
       done_(false)
     {
@@ -2097,7 +2097,7 @@
 
     static OrthancPluginErrorCode Next(void* body)
     {
-      ChunkedBody& that = GetObject(body);
+      RequestChunkedBody& that = GetObject(body);
         
       if (that.done_)
       {
@@ -2188,7 +2188,7 @@
 
   
 #if HAS_ORTHANC_PLUGIN_HTTP_CHUNKED_BODY == 1
-  void HttpClient::SetBody(IChunkedBody& body)
+  void HttpClient::SetBody(IRequestChunkedBody& body)
   {
     body_.clear();
     chunkedBody_ = &body;
@@ -2240,7 +2240,7 @@
 #if HAS_ORTHANC_PLUGIN_HTTP_CHUNKED_BODY != 1
       error = OrthancPluginErrorCode_InternalError;
 #else
-      ChunkedBody wrapper(*chunkedBody_);
+      RequestChunkedBody wrapper(*chunkedBody_);
         
       error = OrthancPluginHttpClientChunkedBody(
         GetGlobalContext(),
@@ -2260,10 +2260,10 @@
         certificateFile_.empty() ? NULL : certificateKeyPassword_.c_str(),
         pkcs11_ ? 1 : 0,
         &wrapper,
-        ChunkedBody::IsDone,
-        ChunkedBody::GetChunkData,
-        ChunkedBody::GetChunkSize,
-        ChunkedBody::Next);
+        RequestChunkedBody::IsDone,
+        RequestChunkedBody::GetChunkData,
+        RequestChunkedBody::GetChunkSize,
+        RequestChunkedBody::Next);
 #endif
     }
 
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Thu Jun 06 10:19:28 2019 +0200
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Thu Jun 06 10:35:16 2019 +0200
@@ -790,10 +790,10 @@
   {
   public:
 #if HAS_ORTHANC_PLUGIN_HTTP_CHUNKED_BODY == 1
-    class IChunkedBody : public boost::noncopyable
+    class IRequestChunkedBody : public boost::noncopyable
     {
     public:
-      virtual ~IChunkedBody()
+      virtual ~IRequestChunkedBody()
       {
       }
 
@@ -821,8 +821,8 @@
     std::string              body_;
 
 #if HAS_ORTHANC_PLUGIN_HTTP_CHUNKED_BODY == 1
-    class ChunkedBody;
-    IChunkedBody*            chunkedBody_;
+    class RequestChunkedBody;
+    IRequestChunkedBody*     chunkedBody_;
 #else
     // Dummy variable for backward compatibility
     void*                    chunkedBody_;
@@ -895,7 +895,7 @@
     void SetBody(const std::string& body);
 
 #if HAS_ORTHANC_PLUGIN_HTTP_CHUNKED_BODY == 1
-    void SetBody(IChunkedBody& body);
+    void SetBody(IRequestChunkedBody& body);
 #endif
 
     void Execute();