mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-27 23:37:05 -05:00
build: Restructured entire custom plugin system (#1469)
This commit is contained in:
@@ -6,4 +6,4 @@ add_library(tests_common STATIC
|
||||
source/main.cpp
|
||||
)
|
||||
target_include_directories(tests_common PUBLIC include)
|
||||
target_link_libraries(tests_common PUBLIC libimhex ${FMT_LIBRARIES})
|
||||
target_link_libraries(tests_common PUBLIC libimhex ${FMT_LIBRARIES} libwolv)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include <hex/providers/provider.hpp>
|
||||
#pragma once
|
||||
|
||||
#include <hex/helpers/logger.hpp>
|
||||
#include <stdexcept>
|
||||
#include <hex/providers/provider.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hex::test {
|
||||
using namespace hex::prv;
|
||||
|
||||
class TestProvider : public prv::Provider {
|
||||
public:
|
||||
explicit TestProvider(std::vector<u8> *data) : Provider() {
|
||||
explicit TestProvider(std::vector<u8> *data) {
|
||||
this->setData(data);
|
||||
}
|
||||
~TestProvider() override = default;
|
||||
@@ -47,11 +47,14 @@ namespace hex::test {
|
||||
return m_data->size();
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual std::string getTypeName() const override { return "hex.test.provider.test"; }
|
||||
[[nodiscard]] std::string getTypeName() const override { return "hex.test.provider.test"; }
|
||||
|
||||
bool open() override { return true; }
|
||||
void close() override { }
|
||||
|
||||
nlohmann::json storeSettings(nlohmann::json) const override { return {}; }
|
||||
void loadSettings(const nlohmann::json &) override {};
|
||||
|
||||
private:
|
||||
std::vector<u8> *m_data = nullptr;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user