mirror of
https://github.com/Dark98/threeSD.git
synced 2026-07-03 00:38:58 +00:00
Add IOFile::GetData
This commit is contained in:
@@ -217,10 +217,9 @@ void UtilitiesDialog::SaveDataExtractionTool() {
|
||||
} else {
|
||||
// TODO: Add Progress reporting
|
||||
ShowProgressDialog([source = source, destination = destination] {
|
||||
const auto size = FileUtil::GetSize(source.toStdString());
|
||||
std::vector<u8> data(size);
|
||||
FileUtil::IOFile file(source.toStdString(), "rb");
|
||||
if (file.ReadBytes(data.data(), size) != size) {
|
||||
std::vector<u8> data = file.GetData();
|
||||
if (data.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -277,10 +276,9 @@ void UtilitiesDialog::RomFSExtractionTool() {
|
||||
}
|
||||
|
||||
ShowProgressDialog([source = source, destination = destination] {
|
||||
const auto size = FileUtil::GetSize(source.toStdString());
|
||||
std::vector<u8> data(size);
|
||||
FileUtil::IOFile src_file(source.toStdString(), "rb");
|
||||
if (src_file.ReadBytes(data.data(), size) != size) {
|
||||
std::vector<u8> data = src_file.GetData();
|
||||
if (data.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user