stratosphere-except-ldr: use fs bindings (this temporarily breaks loader)

This commit is contained in:
Michael Scire 2020-03-08 16:33:49 -07:00
parent 4eb3109c93
commit 6eee3f5fe7
17 changed files with 283 additions and 187 deletions

View file

@ -15,6 +15,7 @@
*/
#pragma once
#include <stratosphere/os.hpp>
#include <stratosphere/fs/fs_directory.hpp>
#include <stratosphere/kvdb/kvdb_bounded_string.hpp>
namespace ams::kvdb {
@ -23,12 +24,11 @@ namespace ams::kvdb {
NON_COPYABLE(FileKeyValueStore);
NON_MOVEABLE(FileKeyValueStore);
public:
static constexpr size_t MaxPathLength = 0x300; /* TODO: FS_MAX_PATH - 1? */
static constexpr size_t MaxFileLength = 0xFF;
static constexpr char FileExtension[5] = ".val";
static constexpr size_t FileExtensionLength = sizeof(FileExtension) - 1;
static constexpr size_t MaxKeySize = (MaxFileLength - FileExtensionLength) / 2;
using Path = kvdb::BoundedString<MaxPathLength>;
using Path = kvdb::BoundedString<fs::EntryNameLengthMax>;
using FileName = kvdb::BoundedString<MaxFileLength>;
private:
/* Subtypes. */

View file

@ -15,8 +15,9 @@
*/
#pragma once
#include <stratosphere/fs/fs_filesystem.hpp>
#include <stratosphere/fs/fs_file.hpp>
#include <stratosphere/fs/fs_directory.hpp>
#include <stratosphere/fs/fs_filesystem.hpp>
#include <stratosphere/kvdb/kvdb_auto_buffer.hpp>
#include <stratosphere/kvdb/kvdb_archive.hpp>
#include <stratosphere/kvdb/kvdb_bounded_string.hpp>
@ -252,8 +253,7 @@ namespace ams::kvdb {
}
};
private:
static constexpr size_t MaxPathLen = 0x300; /* TODO: FS_MAX_PATH - 1? */
using Path = kvdb::BoundedString<MaxPathLen>;
using Path = kvdb::BoundedString<fs::EntryNameLengthMax>;
private:
Index index;
Path path;