2013-01-31 21:27:00 +00:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
* Xenia : Xbox 360 Emulator Research Project *
|
|
|
|
******************************************************************************
|
|
|
|
* Copyright 2013 Ben Vanik. All rights reserved. *
|
|
|
|
* Released under the BSD license - see LICENSE in the root for more details. *
|
|
|
|
******************************************************************************
|
|
|
|
*/
|
|
|
|
|
2014-01-05 01:12:46 +00:00
|
|
|
#ifndef XENIA_KERNEL_FS_FILESYSTEM_H_
|
|
|
|
#define XENIA_KERNEL_FS_FILESYSTEM_H_
|
2013-01-31 21:27:00 +00:00
|
|
|
|
2014-08-15 17:19:59 +00:00
|
|
|
#include <string>
|
2014-07-12 01:03:35 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
#include <vector>
|
|
|
|
|
2013-01-31 21:27:00 +00:00
|
|
|
#include <xenia/common.h>
|
|
|
|
#include <xenia/core.h>
|
|
|
|
|
2014-01-05 01:12:46 +00:00
|
|
|
#include <xenia/kernel/fs/entry.h>
|
2013-01-31 21:27:00 +00:00
|
|
|
|
|
|
|
namespace xe {
|
|
|
|
namespace kernel {
|
|
|
|
namespace fs {
|
|
|
|
|
|
|
|
class Device;
|
|
|
|
|
2014-08-15 17:19:59 +00:00
|
|
|
enum class FileSystemType {
|
|
|
|
STFS_TITLE,
|
|
|
|
DISC_IMAGE,
|
|
|
|
XEX_FILE,
|
|
|
|
};
|
2013-01-31 21:27:00 +00:00
|
|
|
|
|
|
|
class FileSystem {
|
2014-08-15 17:19:59 +00:00
|
|
|
public:
|
2013-03-29 12:07:32 +00:00
|
|
|
FileSystem();
|
2013-01-31 21:27:00 +00:00
|
|
|
~FileSystem();
|
|
|
|
|
2014-08-15 17:19:59 +00:00
|
|
|
FileSystemType InferType(const std::wstring& local_path);
|
|
|
|
int InitializeFromPath(FileSystemType type, const std::wstring& local_path);
|
|
|
|
|
|
|
|
int RegisterDevice(const std::string& path, Device* device);
|
|
|
|
int RegisterHostPathDevice(const std::string& path,
|
|
|
|
const std::wstring& local_path);
|
|
|
|
int RegisterDiscImageDevice(const std::string& path,
|
|
|
|
const std::wstring& local_path);
|
|
|
|
int RegisterSTFSContainerDevice(const std::string& path,
|
|
|
|
const std::wstring& local_path);
|
2013-01-31 21:27:00 +00:00
|
|
|
|
2014-08-16 09:30:23 +00:00
|
|
|
int CreateSymbolicLink(const std::string& path, const std::string& target);
|
|
|
|
int DeleteSymbolicLink(const std::string& path);
|
2013-01-31 21:27:00 +00:00
|
|
|
|
2014-08-16 09:30:23 +00:00
|
|
|
Entry* ResolvePath(const std::string& path);
|
2013-01-31 21:27:00 +00:00
|
|
|
|
2014-08-15 17:19:59 +00:00
|
|
|
private:
|
|
|
|
std::vector<Device*> devices_;
|
2014-05-14 05:20:42 +00:00
|
|
|
std::unordered_map<std::string, std::string> symlinks_;
|
2013-01-31 21:27:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace fs
|
|
|
|
} // namespace kernel
|
|
|
|
} // namespace xe
|
|
|
|
|
2014-01-05 01:12:46 +00:00
|
|
|
#endif // XENIA_KERNEL_FS_FILESYSTEM_H_
|