xenia-canary/src/xenia/vfs/virtual_file_system.h

58 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_VFS_VIRTUAL_FILE_SYSTEM_H_
#define XENIA_VFS_VIRTUAL_FILE_SYSTEM_H_
2013-01-31 21:27:00 +00:00
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "xenia/base/mutex.h"
#include "xenia/kernel/xobject.h"
#include "xenia/vfs/device.h"
#include "xenia/vfs/entry.h"
2013-01-31 21:27:00 +00:00
namespace xe {
namespace vfs {
2013-01-31 21:27:00 +00:00
class VirtualFileSystem {
public:
VirtualFileSystem();
~VirtualFileSystem();
2013-01-31 21:27:00 +00:00
bool RegisterDevice(std::unique_ptr<Device> device);
2013-01-31 21:27:00 +00:00
bool RegisterSymbolicLink(std::string path, std::string target);
bool UnregisterSymbolicLink(std::string path);
2013-01-31 21:27:00 +00:00
Entry* ResolvePath(std::string path);
Entry* ResolveBasePath(std::string path);
Entry* CreatePath(std::string path, uint32_t attributes);
bool DeletePath(std::string path);
2015-08-07 14:56:57 +00:00
X_STATUS OpenFile(kernel::KernelState* kernel_state, std::string path,
FileDisposition creation_disposition,
2015-08-07 14:56:57 +00:00
uint32_t desired_access,
kernel::object_ref<kernel::XFile>* out_file,
FileAction* out_action);
2013-01-31 21:27:00 +00:00
private:
xe::global_critical_region global_critical_region_;
std::vector<std::unique_ptr<Device>> devices_;
std::unordered_map<std::string, std::string> symlinks_;
2013-01-31 21:27:00 +00:00
};
} // namespace vfs
2013-01-31 21:27:00 +00:00
} // namespace xe
#endif // XENIA_VFS_VIRTUAL_FILE_SYSTEM_H_