Removing utilities (that were just adding needless layers).
Progress on #294.
This commit is contained in:
@@ -17,29 +17,29 @@
|
||||
namespace xe {
|
||||
namespace vfs {
|
||||
|
||||
DiscImageDevice::DiscImageDevice(const std::string& path,
|
||||
DiscImageDevice::DiscImageDevice(const std::string& mount_path,
|
||||
const std::wstring& local_path)
|
||||
: Device(path), local_path_(local_path), gdfx_(nullptr) {}
|
||||
: Device(mount_path), local_path_(local_path), gdfx_(nullptr) {}
|
||||
|
||||
DiscImageDevice::~DiscImageDevice() { delete gdfx_; }
|
||||
|
||||
int DiscImageDevice::Init() {
|
||||
bool DiscImageDevice::Initialize() {
|
||||
mmap_ = MappedMemory::Open(local_path_, MappedMemory::Mode::kRead);
|
||||
if (!mmap_) {
|
||||
XELOGE("Disc image could not be mapped");
|
||||
return 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
gdfx_ = new GDFX(mmap_.get());
|
||||
GDFX::Error error = gdfx_->Load();
|
||||
if (error != GDFX::kSuccess) {
|
||||
XELOGE("GDFX init failed: %d", error);
|
||||
return 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
// gdfx_->Dump();
|
||||
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
std::unique_ptr<Entry> DiscImageDevice::ResolvePath(const char* path) {
|
||||
|
||||
@@ -23,10 +23,11 @@ class GDFX;
|
||||
|
||||
class DiscImageDevice : public Device {
|
||||
public:
|
||||
DiscImageDevice(const std::string& path, const std::wstring& local_path);
|
||||
DiscImageDevice(const std::string& mount_path,
|
||||
const std::wstring& local_path);
|
||||
~DiscImageDevice() override;
|
||||
|
||||
int Init();
|
||||
bool Initialize();
|
||||
|
||||
std::unique_ptr<Entry> ResolvePath(const char* path) override;
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
namespace xe {
|
||||
namespace vfs {
|
||||
|
||||
HostPathDevice::HostPathDevice(const std::string& path,
|
||||
HostPathDevice::HostPathDevice(const std::string& mount_path,
|
||||
const std::wstring& local_path, bool read_only)
|
||||
: Device(path), local_path_(local_path), read_only_(read_only) {}
|
||||
: Device(mount_path), local_path_(local_path), read_only_(read_only) {}
|
||||
|
||||
HostPathDevice::~HostPathDevice() {}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace vfs {
|
||||
|
||||
class HostPathDevice : public Device {
|
||||
public:
|
||||
HostPathDevice(const std::string& path, const std::wstring& local_path,
|
||||
HostPathDevice(const std::string& mount_path, const std::wstring& local_path,
|
||||
bool read_only);
|
||||
~HostPathDevice() override;
|
||||
|
||||
|
||||
@@ -18,29 +18,29 @@
|
||||
namespace xe {
|
||||
namespace vfs {
|
||||
|
||||
STFSContainerDevice::STFSContainerDevice(const std::string& path,
|
||||
STFSContainerDevice::STFSContainerDevice(const std::string& mount_path,
|
||||
const std::wstring& local_path)
|
||||
: Device(path), local_path_(local_path), stfs_(nullptr) {}
|
||||
: Device(mount_path), local_path_(local_path), stfs_(nullptr) {}
|
||||
|
||||
STFSContainerDevice::~STFSContainerDevice() { delete stfs_; }
|
||||
|
||||
int STFSContainerDevice::Init() {
|
||||
bool STFSContainerDevice::Initialize() {
|
||||
mmap_ = MappedMemory::Open(local_path_, MappedMemory::Mode::kRead);
|
||||
if (!mmap_) {
|
||||
XELOGE("STFS container could not be mapped");
|
||||
return 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
stfs_ = new STFS(mmap_.get());
|
||||
STFS::Error error = stfs_->Load();
|
||||
if (error != STFS::kSuccess) {
|
||||
XELOGE("STFS init failed: %d", error);
|
||||
return 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
// stfs_->Dump();
|
||||
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
std::unique_ptr<Entry> STFSContainerDevice::ResolvePath(const char* path) {
|
||||
|
||||
@@ -23,10 +23,11 @@ class STFS;
|
||||
|
||||
class STFSContainerDevice : public Device {
|
||||
public:
|
||||
STFSContainerDevice(const std::string& path, const std::wstring& local_path);
|
||||
STFSContainerDevice(const std::string& mount_path,
|
||||
const std::wstring& local_path);
|
||||
~STFSContainerDevice() override;
|
||||
|
||||
int Init();
|
||||
bool Initialize();
|
||||
|
||||
std::unique_ptr<Entry> ResolvePath(const char* path) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user