mirror of https://github.com/WerWolv/ImHex.git
Allow loading of huge files
This commit is contained in:
parent
e61dfa0927
commit
02c3821ea7
|
@ -47,7 +47,7 @@ namespace hex::prv {
|
||||||
if ((offset + size) > this->getSize() || buffer == nullptr || size == 0)
|
if ((offset + size) > this->getSize() || buffer == nullptr || size == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fseek(this->m_file, offset, SEEK_SET);
|
_fseeki64(this->m_file, offset, SEEK_SET);
|
||||||
fread(buffer, 1, size, this->m_file);
|
fread(buffer, 1, size, this->m_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,13 +55,13 @@ namespace hex::prv {
|
||||||
if (buffer == nullptr || size == 0)
|
if (buffer == nullptr || size == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fseek(this->m_file, offset, SEEK_SET);
|
_fseeki64(this->m_file, offset, SEEK_SET);
|
||||||
fwrite(buffer, 1, size, this->m_file);
|
fwrite(buffer, 1, size, this->m_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t FileProvider::getSize() {
|
size_t FileProvider::getSize() {
|
||||||
fseek(this->m_file, 0, SEEK_END);
|
_fseeki64(this->m_file, 0, SEEK_END);
|
||||||
return ftell(this->m_file);
|
return _ftelli64(this->m_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::pair<std::string, std::string>> FileProvider::getDataInformation() {
|
std::vector<std::pair<std::string, std::string>> FileProvider::getDataInformation() {
|
||||||
|
|
Loading…
Reference in New Issue