1
0
mirror of synced 2025-01-18 00:56:49 +01:00

impr: Make providers return a 64 bit size on all platforms

This commit is contained in:
WerWolv 2023-12-07 12:06:26 +01:00
parent 7b3e13c748
commit 3a016da549
16 changed files with 16 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 { }; }

View File

@ -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)

View File

@ -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));

View File

@ -335,7 +335,7 @@ namespace hex::plugin::builtin {
#endif
}
size_t DiskProvider::getActualSize() const {
u64 DiskProvider::getActualSize() const {
return this->m_diskSize;
}

View File

@ -138,7 +138,7 @@ namespace hex::plugin::builtin {
this->resizeRaw(newSize);
}
size_t FileProvider::getActualSize() const {
u64 FileProvider::getActualSize() const {
return this->m_fileSize;
}

View File

@ -199,7 +199,7 @@ namespace hex::plugin::builtin {
Provider::save();
}
size_t GDBProvider::getActualSize() const {
u64 GDBProvider::getActualSize() const {
return this->m_size;
}

View File

@ -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;
}

View File

@ -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 {}

View File

@ -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();
}