Rewrite the plugin backend, use smart pointers is possible, don't persist in structs and simplify code

This commit is contained in:
Maschell
2022-05-14 14:00:20 +02:00
parent fb6373ec63
commit cda9c3e055
41 changed files with 790 additions and 1888 deletions

View File

@@ -19,6 +19,7 @@
#include "PluginData.h"
#include <coreinit/memexpheap.h>
#include <forward_list>
#include <memory>
#include <optional>
#include <string>
@@ -26,9 +27,9 @@
class PluginDataFactory {
public:
static std::vector<std::shared_ptr<PluginData>> loadDir(const std::string &path, MEMHeapHandle heapHandle);
static std::forward_list<std::shared_ptr<PluginData>> loadDir(const std::string &path);
static std::optional<std::shared_ptr<PluginData>> load(const std::string &path, MEMHeapHandle heapHandle);
static std::optional<std::unique_ptr<PluginData>> load(const std::string &path);
static std::optional<std::shared_ptr<PluginData>> load(std::vector<uint8_t> &buffer, MEMHeapHandle heapHandle);
static std::optional<std::unique_ptr<PluginData>> load(const std::vector<uint8_t> &buffer);
};