mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-24 19:54:22 -04:00
settings: implement KeyValueStore (#1659)
* settings: implement KeyValueStore and dependencies * settings: update KeyValueStore for recent refactoring * settings: address feedback
This commit is contained in:
parent
14c8801259
commit
303c6eb5f9
23 changed files with 2767 additions and 81 deletions
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
namespace ams::settings::impl {
|
||||
|
||||
class SystemData {
|
||||
NON_COPYABLE(SystemData);
|
||||
NON_MOVEABLE(SystemData);
|
||||
private:
|
||||
static constexpr size_t FileNameLengthMax = 31;
|
||||
private:
|
||||
ncm::SystemDataId m_system_data_id;
|
||||
char m_mount_name[fs::MountNameLengthMax + 1];
|
||||
char m_file_path[fs::MountNameLengthMax + 1 + 1 + FileNameLengthMax + 1];
|
||||
public:
|
||||
SystemData() : m_system_data_id(), m_mount_name(), m_file_path() { /* ... */ }
|
||||
|
||||
void SetSystemDataId(ncm::SystemDataId id);
|
||||
void SetMountName(const char *name);
|
||||
Result Mount();
|
||||
Result OpenToRead();
|
||||
void Close();
|
||||
Result Read(s64 offset, void *dst, size_t size);
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue