From 3b9f4a9a51b55a9b9d84904d6bdb47709a85c8c7 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 17 May 2020 20:43:04 +0200 Subject: [PATCH] Add missing copy constructors --- source/plugin/PluginContainer.h | 6 ++++++ source/plugin/PluginData.cpp | 9 +++++++++ source/plugin/PluginData.h | 2 ++ source/plugin/PluginInformation.cpp | 17 +++++++++++++++++ source/plugin/PluginInformation.h | 2 ++ source/plugin/PluginMetaInformation.cpp | 11 +++++++++++ source/plugin/PluginMetaInformation.h | 2 ++ 7 files changed, 49 insertions(+) create mode 100644 source/plugin/PluginInformation.cpp create mode 100644 source/plugin/PluginMetaInformation.cpp diff --git a/source/plugin/PluginContainer.h b/source/plugin/PluginContainer.h index 09fb531..677b0a5 100644 --- a/source/plugin/PluginContainer.h +++ b/source/plugin/PluginContainer.h @@ -23,6 +23,12 @@ class PluginContainer { public: + PluginContainer(const PluginContainer& other) { + this->pluginData = other.pluginData; + this->pluginInformation = other.pluginInformation; + this->metaInformation = other.metaInformation; + } + PluginContainer() { } diff --git a/source/plugin/PluginData.cpp b/source/plugin/PluginData.cpp index 59d39e1..e290904 100644 --- a/source/plugin/PluginData.cpp +++ b/source/plugin/PluginData.cpp @@ -1,5 +1,14 @@ #include "PluginData.h" + +PluginData::PluginData(const PluginData &obj) { + this->buffer = obj.buffer; + this->heapHandle = obj.heapHandle; + this->memoryType = obj.memoryType; + this->length = obj.length; + loadReader(); +} + void PluginData::freeMemory() { if (buffer == NULL) { return; diff --git a/source/plugin/PluginData.h b/source/plugin/PluginData.h index 3e9f7ce..ac4addd 100644 --- a/source/plugin/PluginData.h +++ b/source/plugin/PluginData.h @@ -48,6 +48,8 @@ public: void freeMemory(); private: + PluginData(const PluginData &obj); + PluginData() { } diff --git a/source/plugin/PluginInformation.cpp b/source/plugin/PluginInformation.cpp new file mode 100644 index 0000000..e978739 --- /dev/null +++ b/source/plugin/PluginInformation.cpp @@ -0,0 +1,17 @@ +#include "PluginInformation.h" + +PluginInformation::PluginInformation(const PluginInformation& other) { + for (size_t i=0; iname = other.name; + this->author = other.author; + this->version = other.version; + this->license = other.license; + this->buildtimestamp = other.buildtimestamp; + this->description = other.description; + this->size = other.size; +} \ No newline at end of file diff --git a/source/plugin/PluginMetaInformation.h b/source/plugin/PluginMetaInformation.h index 040e90b..7bc328a 100644 --- a/source/plugin/PluginMetaInformation.h +++ b/source/plugin/PluginMetaInformation.h @@ -22,6 +22,8 @@ class PluginMetaInformation { public: + PluginMetaInformation(const PluginMetaInformation& other); + const std::string getName() const { return name; }