2020-12-26 14:17:50 +01:00
|
|
|
#include "../common/plugin_defines.h"
|
2020-05-17 20:45:10 +02:00
|
|
|
#include "PluginDataPersistence.h"
|
|
|
|
#include "PluginData.h"
|
|
|
|
|
|
|
|
bool PluginDataPersistence::save(plugin_data_t *pluginDataStruct, PluginData &plugin) {
|
2020-12-26 14:17:50 +01:00
|
|
|
if (pluginDataStruct == nullptr) {
|
2020-05-17 20:45:10 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
pluginDataStruct->buffer = (char *) plugin.buffer;
|
|
|
|
pluginDataStruct->bufferLength = plugin.length;
|
|
|
|
pluginDataStruct->memoryType = plugin.memoryType;
|
|
|
|
pluginDataStruct->heapHandle = (int) plugin.heapHandle;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
PluginData PluginDataPersistence::load(plugin_data_t *pluginDataStruct) {
|
|
|
|
PluginData pluginData;
|
|
|
|
|
|
|
|
pluginData.buffer = pluginDataStruct->buffer;
|
|
|
|
pluginData.length = pluginDataStruct->bufferLength;
|
|
|
|
pluginData.memoryType = (eMemoryTypes) pluginDataStruct->memoryType;
|
|
|
|
pluginData.heapHandle = (MEMHeapHandle) pluginDataStruct->heapHandle;
|
|
|
|
return pluginData;
|
|
|
|
}
|