Service::CFG/FS: add and refactor out utilities for front-end
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
@@ -271,11 +272,70 @@ ResultCode UpdateConfigNANDSavegame();
|
||||
*/
|
||||
ResultCode FormatConfig();
|
||||
|
||||
/**
|
||||
* Open the config savegame file and load it to the memory buffer
|
||||
* @returns ResultCode indicating the result of the operation, 0 on success
|
||||
*/
|
||||
ResultCode LoadConfigNANDSaveFile();
|
||||
|
||||
/// Initialize the config service
|
||||
void Init();
|
||||
|
||||
/// Shutdown the config service
|
||||
void Shutdown();
|
||||
|
||||
// Utilities for frontend to set config data.
|
||||
// Note: before calling these functions, LoadConfigNANDSaveFile should be called,
|
||||
// and UpdateConfigNANDSavegame should be called after making changes to config data.
|
||||
|
||||
/**
|
||||
* Sets the username in config savegame.
|
||||
* @param name the username to set. The maximum size is 10 in char16_t.
|
||||
*/
|
||||
void SetUsername(const std::u16string& name);
|
||||
|
||||
/**
|
||||
* Gets the username from config savegame.
|
||||
* @returns the username
|
||||
*/
|
||||
std::u16string GetUsername();
|
||||
|
||||
/**
|
||||
* Sets the profile birthday in config savegame.
|
||||
* @param month the month of birthday.
|
||||
* @param day the day of the birthday.
|
||||
*/
|
||||
void SetBirthday(u8 month, u8 day);
|
||||
|
||||
/**
|
||||
* Gets the profile birthday from the config savegame.
|
||||
* @returns a tuple of (month, day) of birthday
|
||||
*/
|
||||
std::tuple<u8, u8> GetBirthday();
|
||||
|
||||
/**
|
||||
* Sets the system language in config savegame.
|
||||
* @param language the system language to set.
|
||||
*/
|
||||
void SetSystemLanguage(SystemLanguage language);
|
||||
|
||||
/**
|
||||
* Gets the system language from config savegame.
|
||||
* @returns the system language
|
||||
*/
|
||||
SystemLanguage GetSystemLanguage();
|
||||
|
||||
/**
|
||||
* Sets the sound output mode in config savegame.
|
||||
* @param mode the sound output mode to set
|
||||
*/
|
||||
void SetSoundOutputMode(SoundOutputMode mode);
|
||||
|
||||
/**
|
||||
* Gets the sound output mode from config savegame.
|
||||
* @returns the sound output mode
|
||||
*/
|
||||
SoundOutputMode GetSoundOutputMode();
|
||||
|
||||
} // namespace CFG
|
||||
} // namespace Service
|
||||
|
||||
Reference in New Issue
Block a user