1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-26 22:02:15 +00:00
Atmosphere/libraries/libstratosphere/source/settings/impl/settings_system_data.hpp
Adubbz 303c6eb5f9
settings: implement KeyValueStore (#1659)
* settings: implement KeyValueStore and dependencies

* settings: update KeyValueStore for recent refactoring

* settings: address feedback
2021-10-09 09:16:40 -07:00

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);
};
}