Removing utilities (that were just adding needless layers).

Progress on #294.
This commit is contained in:
Ben Vanik
2015-06-27 16:27:24 -07:00
parent 246c47f923
commit abf47b7973
17 changed files with 125 additions and 217 deletions

View File

@@ -14,6 +14,7 @@
#include "xenia/base/filesystem.h"
#include "xenia/kernel/kernel_state.h"
#include "xenia/kernel/xobject.h"
#include "xenia/vfs/devices/host_path_device.h"
namespace xe {
namespace kernel {
@@ -28,14 +29,16 @@ ContentPackage::ContentPackage(KernelState* kernel_state, std::string root_name,
: kernel_state_(kernel_state), root_name_(std::move(root_name)) {
device_path_ = std::string("\\Device\\Content\\") +
std::to_string(++content_device_id_) + "\\";
kernel_state_->file_system()->RegisterHostPathDevice(device_path_,
package_path, false);
kernel_state_->file_system()->CreateSymbolicLink(root_name_ + ":",
device_path_);
auto fs = kernel_state_->file_system();
auto device =
std::make_unique<vfs::HostPathDevice>(device_path_, package_path, false);
fs->RegisterDevice(std::move(device));
fs->RegisterSymbolicLink(root_name_ + ":", device_path_);
}
ContentPackage::~ContentPackage() {
kernel_state_->file_system()->DeleteSymbolicLink(root_name_ + ":");
kernel_state_->file_system()->UnregisterSymbolicLink(root_name_ + ":");
// TODO(benvanik): unregister device.
}