mirror of
https://github.com/Dark98/threeSD.git
synced 2026-07-03 08:39:04 +00:00
Refactor InnerFAT into Savegame and Extdata
And derive TitleDB from it too.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
#include "common/common_types.h"
|
||||
#include "common/logging/log.h"
|
||||
#ifdef _MSC_VER
|
||||
#include "common/string_util.h"
|
||||
#endif
|
||||
@@ -251,6 +252,25 @@ private:
|
||||
bool m_good = true;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
bool WriteBytesToFile(const std::string& path, T* data, std::size_t length) {
|
||||
if (!CreateFullPath(path)) {
|
||||
LOG_ERROR(Core, "Could not create path {}", path);
|
||||
return false;
|
||||
}
|
||||
|
||||
IOFile file(path, "wb");
|
||||
if (!file.IsOpen()) {
|
||||
LOG_ERROR(Core, "Could not open file {}", path);
|
||||
return false;
|
||||
}
|
||||
if (file.WriteBytes(data, length) != length) {
|
||||
LOG_ERROR(Core, "Write data failed (file: {})", path);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace FileUtil
|
||||
|
||||
// To deal with Windows being dumb at unicode:
|
||||
|
||||
Reference in New Issue
Block a user