mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 21:47:40 -05:00
feat: Added CSV, TSV and JSON as export options for Find results (#1673)
### Problem description The default result export functionality of the Find tool is limited to only exporting data in a nonstandard text format. This PR adds support for exporting the results in CSV, TSV or JSON format. The PR also removes the old format. ### Implementation description I added the classes `ExportFormatter`, `ExportFormatterCsv`, `ExportFormatterTsv` and `ExportFormatterJson`, with similar implementations to the pattern data exporters. ~~I also moved the `ViewFind::Occurrence` class into `hex/helpers/types.hh`, so the exporters can access it.~~ ### Screenshots  ### Additional things Another small change I made is moving the "{} entries found" line on the same line as the Search and Reset buttons. I think it looks cleaner this way, but if anyone disagrees, I can revert it. --------- Co-authored-by: WerWolv <werwolv98@gmail.com>
This commit is contained in:
@@ -210,7 +210,7 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
void drawExportLanguageMenu() {
|
||||
for (const auto &formatter : ContentRegistry::DataFormatter::impl::getEntries()) {
|
||||
for (const auto &formatter : ContentRegistry::DataFormatter::impl::getExportMenuEntries()) {
|
||||
if (ImGui::MenuItem(Lang(formatter.unlocalizedName), nullptr, false, ImHexApi::Provider::get()->getActualSize() > 0)) {
|
||||
fs::openFileBrowser(fs::DialogMode::Save, {}, [&formatter](const auto &path) {
|
||||
TaskManager::createTask("Exporting data", TaskManager::NoProgress, [&formatter, path](auto&){
|
||||
|
||||
Reference in New Issue
Block a user