SettingsHandler: Add Open and Save member functions

This commit is contained in:
Lioncash
2017-01-27 10:01:25 -05:00
parent f37c5f1f1c
commit 98291cd843
4 changed files with 53 additions and 40 deletions

View File

@ -6,6 +6,7 @@
#pragma once
#include <array>
#include <string>
#include "Common/CommonTypes.h"
@ -13,8 +14,6 @@
class SettingsHandler
{
public:
SettingsHandler();
enum
{
SETTINGS_SIZE = 0x100,
@ -22,6 +21,11 @@ public:
INITIAL_SEED = 0x73B5DBFA
};
SettingsHandler();
bool Open(const std::string& settings_file_path);
bool Save(const std::string& destination_file_path) const;
void AddSetting(const std::string& key, const std::string& value);
const u8* GetData() const;
@ -34,7 +38,7 @@ public:
private:
void WriteByte(u8 b);
u8 m_buffer[SETTINGS_SIZE];
std::array<u8, SETTINGS_SIZE> m_buffer;
u32 m_position, m_key;
std::string decoded;
};