api: Move copy-as data formatting code to builtin-plugin, add api for it

This commit is contained in:
WerWolv
2022-01-13 00:27:31 +01:00
parent f6e4d56de6
commit 1f8c9b9f71
9 changed files with 238 additions and 237 deletions

View File

@@ -253,6 +253,24 @@ namespace hex {
const std::vector<std::string>& getEntries();
}
namespace DataFormatter {
namespace impl {
using Callback = std::function<std::string(prv::Provider *provider, u64 address, size_t size)>;
struct Entry {
std::string unlocalizedName;
Callback callback;
};
}
void add(const std::string &unlocalizedName, const impl::Callback &callback);
std::vector<impl::Entry>& getEntries();
}
};
}

View File

@@ -91,6 +91,8 @@ namespace hex {
static u32 dataProcessorLinkIdCounter;
static u32 dataProcessorAttrIdCounter;
static std::vector<ContentRegistry::DataFormatter::impl::Entry> dataFormatters;
static std::list<std::string> recentFilePaths;
static int mainArgc;