mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 21:47:40 -05:00
api: Moved file extension handling to plugin and added API
This commit is contained in:
@@ -273,6 +273,24 @@ namespace hex {
|
||||
std::vector<impl::Entry>& getEntries();
|
||||
|
||||
}
|
||||
|
||||
namespace FileHandler {
|
||||
|
||||
namespace impl {
|
||||
|
||||
using Callback = std::function<bool(fs::path)>;
|
||||
struct Entry {
|
||||
std::vector<std::string> extensions;
|
||||
Callback callback;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
void add(const std::vector<std::string> &extensions, const impl::Callback &callback);
|
||||
|
||||
std::vector<impl::Entry>& getEntries();
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@@ -92,6 +92,7 @@ namespace hex {
|
||||
static u32 dataProcessorAttrIdCounter;
|
||||
|
||||
static std::vector<ContentRegistry::DataFormatter::impl::Entry> dataFormatters;
|
||||
static std::vector<ContentRegistry::FileHandler::impl::Entry> fileHandlers;
|
||||
|
||||
static std::list<std::string> recentFilePaths;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user