mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2026-08-20 10:02:17 -05:00
Remove the elfio reader from the PluginData class, use it when it's needed
This commit is contained in:
@@ -33,45 +33,28 @@ enum eMemoryTypes {
|
||||
|
||||
class PluginData {
|
||||
public:
|
||||
const std::optional<elfio *> &getReader() const {
|
||||
return reader;
|
||||
}
|
||||
|
||||
~PluginData() {
|
||||
if (nReader != NULL) {
|
||||
delete nReader;
|
||||
nReader = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void freeMemory();
|
||||
|
||||
void *getBuffer() const {
|
||||
return this->buffer;
|
||||
}
|
||||
|
||||
PluginData(const PluginData &obj);
|
||||
|
||||
PluginData() {
|
||||
}
|
||||
|
||||
void *buffer;
|
||||
void *buffer = NULL;
|
||||
MEMHeapHandle heapHandle;
|
||||
eMemoryTypes memoryType;
|
||||
size_t length;
|
||||
size_t length = 0;
|
||||
|
||||
private:
|
||||
PluginData(std::vector<uint8_t> buffer);
|
||||
|
||||
PluginData(std::vector<uint8_t> input, MEMHeapHandle heapHandle, eMemoryTypes memoryType);
|
||||
|
||||
void loadReader();
|
||||
|
||||
static std::optional<PluginData> createFromExistingData(const void *buffer, MEMHeapHandle heapHandle, eMemoryTypes memoryType, const size_t length);
|
||||
|
||||
std::optional<elfio *> reader;
|
||||
|
||||
elfio *nReader = NULL;
|
||||
|
||||
friend class PluginDataFactory;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user