mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-14 00:56:35 +00:00
303c6eb5f9
* settings: implement KeyValueStore and dependencies * settings: update KeyValueStore for recent refactoring * settings: address feedback
41 lines
1.4 KiB
C++
41 lines
1.4 KiB
C++
/*
|
|
* 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);
|
|
};
|
|
|
|
}
|