SettingsHandler: Migrate to new filesystem interface

Change SettingsHandler to take a buffer instead of assuming that the
setting file to read is always on the host filesystem for more
flexibility and make it possible to use the new filesystem interface.
This commit is contained in:
Léo Lam
2018-05-09 20:40:56 +02:00
parent 6e9d0ff6de
commit 09d2afa91f
4 changed files with 52 additions and 46 deletions

View File

@ -21,14 +21,14 @@ public:
INITIAL_SEED = 0x73B5DBFA
};
using Buffer = std::array<u8, SETTINGS_SIZE>;
SettingsHandler();
bool Open(const std::string& settings_file_path);
bool Save(const std::string& destination_file_path) const;
explicit SettingsHandler(Buffer&& buffer);
void AddSetting(const std::string& key, const std::string& value);
const u8* GetData() const;
const Buffer& GetBytes() const;
void SetBytes(Buffer&& buffer);
const std::string GetValue(const std::string& key);
void Decrypt();