impr: Make providers return a 64 bit size on all platforms
This commit is contained in:
parent
7b3e13c748
commit
3a016da549
@ -137,7 +137,7 @@ namespace hex::prv {
|
||||
* @brief Get the full size of the data in this provider
|
||||
* @return The size of the entire available data of this provider
|
||||
*/
|
||||
[[nodiscard]] virtual size_t getActualSize() const = 0;
|
||||
[[nodiscard]] virtual u64 getActualSize() const = 0;
|
||||
|
||||
/**
|
||||
* @brief Gets the type name of this provider
|
||||
|
@ -36,7 +36,7 @@ namespace hex {
|
||||
this->m_patches[offset] = static_cast<const u8*>(buffer)[i];
|
||||
}
|
||||
|
||||
[[nodiscard]] size_t getActualSize() const override {
|
||||
[[nodiscard]] u64 getActualSize() const override {
|
||||
if (this->m_patches.empty())
|
||||
return 0;
|
||||
else
|
||||
|
@ -22,7 +22,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void readRaw(u64 offset, void *buffer, size_t size) override;
|
||||
void writeRaw(u64 offset, const void *buffer, size_t size) override;
|
||||
[[nodiscard]] size_t getActualSize() const override;
|
||||
[[nodiscard]] u64 getActualSize() const override;
|
||||
|
||||
void setPath(const std::fs::path &path);
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace hex::plugin::builtin {
|
||||
void readRaw(u64 offset, void *buffer, size_t size) override;
|
||||
void writeRaw(u64 offset, const void *buffer, size_t size) override;
|
||||
|
||||
[[nodiscard]] size_t getActualSize() const override;
|
||||
[[nodiscard]] u64 getActualSize() const override;
|
||||
|
||||
void save() override;
|
||||
void saveAs(const std::fs::path &path) override;
|
||||
|
@ -24,7 +24,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void readRaw(u64 offset, void *buffer, size_t size) override;
|
||||
void writeRaw(u64 offset, const void *buffer, size_t size) override;
|
||||
[[nodiscard]] size_t getActualSize() const override;
|
||||
[[nodiscard]] u64 getActualSize() const override;
|
||||
|
||||
void save() override;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void readRaw(u64 offset, void *buffer, size_t size) override;
|
||||
void writeRaw(u64 offset, const void *buffer, size_t size) override;
|
||||
[[nodiscard]] size_t getActualSize() const override;
|
||||
[[nodiscard]] u64 getActualSize() const override;
|
||||
|
||||
bool open() override;
|
||||
void close() override;
|
||||
|
@ -21,7 +21,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void readRaw(u64 offset, void *buffer, size_t size) override;
|
||||
void writeRaw(u64 offset, const void *buffer, size_t size) override;
|
||||
[[nodiscard]] size_t getActualSize() const override { return this->m_data.size(); }
|
||||
[[nodiscard]] u64 getActualSize() const override { return this->m_data.size(); }
|
||||
|
||||
void resizeRaw(size_t newSize) override;
|
||||
void insertRaw(u64 offset, size_t size) override;
|
||||
|
@ -31,7 +31,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void readRaw(u64 offset, void *buffer, size_t size) override { hex::unused(offset, buffer, size); }
|
||||
void writeRaw(u64 offset, const void *buffer, size_t size) override { hex::unused(offset, buffer, size); }
|
||||
[[nodiscard]] size_t getActualSize() const override { return 0x00; }
|
||||
[[nodiscard]] u64 getActualSize() const override { return 0x00; }
|
||||
|
||||
[[nodiscard]] std::string getName() const override { return "None"; }
|
||||
[[nodiscard]] std::vector<Description> getDataDescription() const override { return { }; }
|
||||
|
@ -86,7 +86,7 @@ namespace hex::plugin::builtin {
|
||||
this->m_provider->write(offset + this->m_startAddress, buffer, size);
|
||||
}
|
||||
|
||||
[[nodiscard]] size_t getActualSize() const override { return this->m_size; }
|
||||
[[nodiscard]] u64 getActualSize() const override { return this->m_size; }
|
||||
|
||||
[[nodiscard]] std::string getName() const override {
|
||||
if (this->m_provider == nullptr)
|
||||
|
@ -295,7 +295,7 @@ namespace hex::plugin::builtin {
|
||||
u64 startAddress = args.size() >= 2 ? std::stoull(args[1], nullptr, 0) : 0x00;
|
||||
u64 size = args.size() >= 3 ? std::stoull(args[2], nullptr, 0) : provider.getActualSize();
|
||||
|
||||
size = std::min(size, provider.getActualSize());
|
||||
size = std::min<u64>(size, provider.getActualSize());
|
||||
|
||||
log::print("{}", hex::generateHexView(startAddress, size - startAddress, &provider));
|
||||
|
||||
|
@ -335,7 +335,7 @@ namespace hex::plugin::builtin {
|
||||
#endif
|
||||
}
|
||||
|
||||
size_t DiskProvider::getActualSize() const {
|
||||
u64 DiskProvider::getActualSize() const {
|
||||
return this->m_diskSize;
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ namespace hex::plugin::builtin {
|
||||
this->resizeRaw(newSize);
|
||||
}
|
||||
|
||||
size_t FileProvider::getActualSize() const {
|
||||
u64 FileProvider::getActualSize() const {
|
||||
return this->m_fileSize;
|
||||
}
|
||||
|
||||
|
@ -199,7 +199,7 @@ namespace hex::plugin::builtin {
|
||||
Provider::save();
|
||||
}
|
||||
|
||||
size_t GDBProvider::getActualSize() const {
|
||||
u64 GDBProvider::getActualSize() const {
|
||||
return this->m_size;
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ namespace hex::plugin::builtin {
|
||||
hex::unused(offset, buffer, size);
|
||||
}
|
||||
|
||||
size_t IntelHexProvider::getActualSize() const {
|
||||
u64 IntelHexProvider::getActualSize() const {
|
||||
return this->m_dataSize;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace hex::plugin::windows {
|
||||
|
||||
void readRaw(u64 address, void *buffer, size_t size) override;
|
||||
void writeRaw(u64 address, const void *buffer, size_t size) override;
|
||||
[[nodiscard]] size_t getActualSize() const override { return 0xFFFF'FFFF'FFFF; }
|
||||
[[nodiscard]] u64 getActualSize() const override { return std::numeric_limits<u64>::max(); }
|
||||
|
||||
void save() override {}
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace hex::test {
|
||||
std::memcpy(m_data->data() + offset, buffer, size);
|
||||
}
|
||||
|
||||
[[nodiscard]] size_t getActualSize() const override {
|
||||
[[nodiscard]] u64 getActualSize() const override {
|
||||
return this->m_data->size();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user