Closed SparkyTD closed 3 months ago
The CSV/TSV exporters have been tested by finding 5 character longs strings in /dev/urandom, and all the escaping logic seems to work as it's supposed to.
As for JSON, the nlohmann library already takes care of escaping strings.
There is an issue that causes the format selector popup to stay visible behind the main window in some cases when the user clicks the parent window. The bug also exists in the original pattern export popup. I haven't been able to fix it yet.
Thanks a lot for the work! I'd suggest adding these exporter registration things to the Content Registry instead, that way other plugins can re-use the same infrastructure you already wrote to add their own formatters. The Occurrences struct as well because now it's being imported by basically every single file in ImHex which is probably not needed :D
The actual implementations of the formatters can stay in the builtin plugin like it is
Attention: Patch coverage is 0%
with 98 lines
in your changes are missing coverage. Please review.
Please upload report for BASE (
master@dedd99f
). Learn more about missing BASE report.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@WerWolv Do you think this is ready to be merged ?
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
andExportFormatterJson
, with similar implementations to the pattern data exporters.I also moved theViewFind::Occurrence
class intohex/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.