api: Added api function to create pattern

This commit is contained in:
WerWolv
2022-08-06 22:29:59 +02:00
parent 88f8bb9848
commit 69d000488e
5 changed files with 12 additions and 4 deletions

View File

@@ -15,8 +15,7 @@
namespace hex::plugin::builtin {
static void openFile(const std::fs::path &path) {
hex::prv::Provider *provider = nullptr;
EventManager::post<RequestCreateProvider>("hex.builtin.provider.file", &provider);
auto provider = ImHexApi::Provider::createProvider("hex.builtin.provider.file");
if (auto fileProvider = dynamic_cast<prv::FileProvider *>(provider)) {
fileProvider->setPath(path);