xenia-canary/src/xenia/kernel/fs/filesystem.h

65 lines
1.8 KiB
C
Raw Normal View History

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. *
******************************************************************************
*/
#ifndef XENIA_KERNEL_FS_FILESYSTEM_H_
#define XENIA_KERNEL_FS_FILESYSTEM_H_
2013-01-31 21:27:00 +00:00
#include <string>
#include <unordered_map>
#include <vector>
2013-01-31 21:27:00 +00:00
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/fs/entry.h>
2013-01-31 21:27:00 +00:00
namespace xe {
namespace kernel {
namespace fs {
class Device;
enum class FileSystemType {
STFS_TITLE,
DISC_IMAGE,
XEX_FILE,
};
2013-01-31 21:27:00 +00:00
class FileSystem {
public:
FileSystem();
2013-01-31 21:27:00 +00:00
~FileSystem();
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
int CreateSymbolicLink(const char* path, const char* target);
int DeleteSymbolicLink(const char* path);
Entry* ResolvePath(const char* path);
private:
std::vector<Device*> devices_;
std::unordered_map<std::string, std::string> symlinks_;
2013-01-31 21:27:00 +00:00
};
} // namespace fs
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_FS_FILESYSTEM_H_