1
0
mirror of synced 2024-12-24 05:24:52 +01:00
ImHex/plugins/builtin/include/content/providers/view_provider.hpp

58 lines
1.9 KiB
C++
Raw Normal View History

2022-11-14 10:02:46 +01:00
#pragma once
#include <hex/providers/provider.hpp>
2022-11-14 10:02:46 +01:00
namespace hex::plugin::builtin {
class ViewProvider : public hex::prv::Provider {
public:
ViewProvider() = default;
~ViewProvider() override = default;
2022-11-14 10:02:46 +01:00
[[nodiscard]] bool isAvailable() const override;
[[nodiscard]] bool isReadable() const override;
[[nodiscard]] bool isWritable() const override;
[[nodiscard]] bool isResizable() const override;
[[nodiscard]] bool isSavable() const override;
[[nodiscard]] bool isSavableAsRecent() const override;
void save() override;
[[nodiscard]] bool open() override;
void close() override;
void resizeRaw(u64 newSize) override;
void insertRaw(u64 offset, u64 size) override;
void removeRaw(u64 offset, u64 size) override;
void readRaw(u64 offset, void *buffer, size_t size) override;
void writeRaw(u64 offset, const void *buffer, size_t size) override;
[[nodiscard]] u64 getActualSize() const override;
[[nodiscard]] std::string getName() const override;
[[nodiscard]] std::vector<Description> getDataDescription() const override;
[[nodiscard]] std::string getTypeName() const override;
void loadSettings(const nlohmann::json &settings) override;
[[nodiscard]] nlohmann::json storeSettings(nlohmann::json settings) const override;
void setProvider(u64 startAddress, size_t size, hex::prv::Provider *provider);
void setName(const std::string &name);
[[nodiscard]] std::pair<Region, bool> getRegionValidity(u64 address) const override;
std::vector<MenuEntry> getMenuEntries() override;
2022-11-14 10:02:46 +01:00
private:
void renameFile();
private:
std::string m_name;
2022-11-14 10:02:46 +01:00
u64 m_startAddress = 0x00;
size_t m_size = 0x00;
prv::Provider *m_provider = nullptr;
};
}