mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
impr: Separate the behaviour of being savable and being dumpable for provider (#1183)
### Problem description Currently, the providers use the method `isSavable()` to determine both if they can use "Save" or "Save as". This behaviour is problematic because some providers may need to be saveable but not saveable as: for example the view provider. The original provider may not allow to be saved. ### Implementation description I separate these two behaviour by creating another function: `isDumpable()`, that return true by default but can be overridden by the provider to return false, if the provider should not be dumped in any way. ### Additional things While I was at it, I also marked "export" operations as needing the "dumpable" flag. That way, we can't accidentally export the whole address space of a process as base64. I also added documentation for these some functions in Provider
This commit is contained in:
@@ -27,6 +27,7 @@ namespace hex::plugin::windows {
|
||||
[[nodiscard]] bool isWritable() const override { return true; }
|
||||
[[nodiscard]] bool isResizable() const override { return false; }
|
||||
[[nodiscard]] bool isSavable() const override { return false; }
|
||||
[[nodiscard]] bool isDumpable() const override { return false; }
|
||||
|
||||
void read(u64 address, void *buffer, size_t size, bool) override { this->readRaw(address, buffer, size); }
|
||||
void write(u64 address, const void *buffer, size_t size) override { this->writeRaw(address, buffer, size); }
|
||||
|
||||
Reference in New Issue
Block a user