2018-01-17 03:20:12 +00:00
|
|
|
// Copyright 2018 yuzu emulator team
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include "common/common_types.h"
|
|
|
|
#include "core/hle/result.h"
|
2018-01-21 02:32:36 +00:00
|
|
|
|
|
|
|
namespace FileSys {
|
|
|
|
class FileSystemBackend;
|
|
|
|
class FileSystemFactory;
|
|
|
|
class Path;
|
|
|
|
} // namespace FileSys
|
2018-01-17 03:20:12 +00:00
|
|
|
|
|
|
|
namespace Service {
|
2018-01-21 02:32:36 +00:00
|
|
|
|
|
|
|
namespace SM {
|
|
|
|
class ServiceManager;
|
|
|
|
} // namespace SM
|
|
|
|
|
2018-01-17 03:20:12 +00:00
|
|
|
namespace FileSystem {
|
|
|
|
|
|
|
|
/// Supported FileSystem types
|
|
|
|
enum class Type {
|
|
|
|
RomFS = 1,
|
2018-02-19 05:32:00 +00:00
|
|
|
SaveData = 2,
|
2018-03-20 02:17:15 +00:00
|
|
|
SDMC = 3,
|
2018-01-17 03:20:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Registers a FileSystem, instances of which can later be opened using its IdCode.
|
|
|
|
* @param factory FileSystem backend interface to use
|
|
|
|
* @param type Type used to access this type of FileSystem
|
|
|
|
*/
|
2018-07-08 03:24:51 +00:00
|
|
|
ResultCode RegisterFileSystem(std::unique_ptr<FileSys::FileSystemFactory>&& factory, Type type);
|
2018-01-17 03:20:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Opens a file system
|
|
|
|
* @param type Type of the file system to open
|
|
|
|
* @param path Path to the file system, used with Binary paths
|
|
|
|
* @return FileSys::FileSystemBackend interface to the file system
|
|
|
|
*/
|
2018-07-08 03:24:51 +00:00
|
|
|
ResultVal<std::unique_ptr<FileSys::FileSystemBackend>> OpenFileSystem(Type type,
|
|
|
|
FileSys::Path& path);
|
2018-01-17 03:20:12 +00:00
|
|
|
|
2018-03-04 18:03:58 +00:00
|
|
|
/**
|
|
|
|
* Formats a file system
|
|
|
|
* @param type Type of the file system to format
|
|
|
|
* @return ResultCode of the operation
|
|
|
|
*/
|
|
|
|
ResultCode FormatFileSystem(Type type);
|
|
|
|
|
2018-01-17 03:20:12 +00:00
|
|
|
/// Registers all Filesystem services with the specified service manager.
|
|
|
|
void InstallInterfaces(SM::ServiceManager& service_manager);
|
|
|
|
|
2018-01-21 02:32:36 +00:00
|
|
|
} // namespace FileSystem
|
2018-01-17 03:20:12 +00:00
|
|
|
} // namespace Service
|