SaveDataLib: use param.sfo to store max_blocks instead of txt (#1287)

This commit is contained in:
Vinicius Rangel 2024-10-08 03:16:06 -03:00 committed by GitHub
parent 01fb320f4e
commit 96344873d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 25 additions and 23 deletions

View file

@ -227,6 +227,12 @@ void PSF::AddBinary(std::string key, std::vector<u8> value, bool update) {
map_binaries.emplace(entry_list.size() - 1, std::move(value));
}
void PSF::AddBinary(std::string key, uint64_t value, bool update) {
std::vector<u8> data(8);
std::memcpy(data.data(), &value, 8);
return AddBinary(std::move(key), std::move(data), update);
}
void PSF::AddString(std::string key, std::string value, bool update) {
auto [it, index] = FindEntry(key);
bool exist = it != entry_list.end();

View file

@ -67,6 +67,7 @@ public:
std::optional<s32> GetInteger(std::string_view key) const;
void AddBinary(std::string key, std::vector<u8> value, bool update = false);
void AddBinary(std::string key, uint64_t value, bool update = false); // rsv4 format
void AddString(std::string key, std::string value, bool update = false);
void AddInteger(std::string key, s32 value, bool update = false);