mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
feat: Allow memory files to be renamed
This commit is contained in:
@@ -14,7 +14,7 @@ namespace hex::plugin::builtin {
|
||||
[[nodiscard]] bool isReadable() const override { return true; }
|
||||
[[nodiscard]] bool isWritable() const override { return !this->m_readOnly; }
|
||||
[[nodiscard]] bool isResizable() const override { return !this->m_readOnly; }
|
||||
[[nodiscard]] bool isSavable() const override { return !this->m_readOnly; }
|
||||
[[nodiscard]] bool isSavable() const override { return this->m_name.empty(); }
|
||||
|
||||
[[nodiscard]] bool open() override;
|
||||
void close() override { }
|
||||
@@ -29,9 +29,11 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void save() override;
|
||||
|
||||
[[nodiscard]] std::string getName() const override { return LangEntry("hex.builtin.provider.mem_file.unsaved"); }
|
||||
[[nodiscard]] std::string getName() const override;
|
||||
[[nodiscard]] std::vector<Description> getDataDescription() const override { return { }; }
|
||||
|
||||
std::vector<MenuEntry> getMenuEntries() override;
|
||||
|
||||
[[nodiscard]] std::string getTypeName() const override {
|
||||
return "hex.builtin.provider.mem_file";
|
||||
}
|
||||
@@ -43,8 +45,12 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void setReadOnly(bool readOnly) { this->m_readOnly = readOnly; }
|
||||
|
||||
private:
|
||||
void renameFile();
|
||||
|
||||
private:
|
||||
std::vector<u8> m_data;
|
||||
std::string m_name;
|
||||
bool m_readOnly = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user