Mercurial > hg > orthanc-databases
diff Framework/Plugins/StorageAreaBuffer.h @ 195:53bd9022c58b
Support of "OrthancPluginRegisterStorageArea2()" from Orthanc SDK 1.9.0
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 08 Jan 2021 18:54:20 +0100 |
parents | a51ce147dbe0 |
children |
line wrap: on
line diff
--- a/Framework/Plugins/StorageAreaBuffer.h Fri Jan 08 14:40:03 2021 +0100 +++ b/Framework/Plugins/StorageAreaBuffer.h Fri Jan 08 18:54:20 2021 +0100 @@ -21,22 +21,28 @@ #pragma once -#include <orthanc/OrthancCPlugin.h> +#include "../../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" #include <boost/noncopyable.hpp> #include <string> + namespace OrthancDatabases { class StorageAreaBuffer : public boost::noncopyable { private: +#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 9, 0) + OrthancPluginContext* context_; + OrthancPluginMemoryBuffer64 buffer_; +#else void* data_; int64_t size_; +#endif public: - StorageAreaBuffer(); + StorageAreaBuffer(OrthancPluginContext* context); ~StorageAreaBuffer() { @@ -47,17 +53,15 @@ void Assign(const std::string& content); - int64_t GetSize() const - { - return size_; - } + int64_t GetSize() const; + + const void* GetData() const; - const void* GetData() const - { - return data_; - } - +#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 9, 0) + void Move(OrthancPluginMemoryBuffer64* target); +#else void* ReleaseData(); +#endif void ToString(std::string& target); };