Code cleanup: moving poly/ into xenia/base/
This commit is contained in:
@@ -9,12 +9,12 @@
|
||||
|
||||
#include "xenia/kernel/fs/filesystem.h"
|
||||
|
||||
#include "poly/fs.h"
|
||||
#include "poly/string.h"
|
||||
#include "xenia/base/fs.h"
|
||||
#include "xenia/base/logging.h"
|
||||
#include "xenia/base/string.h"
|
||||
#include "xenia/kernel/fs/devices/disc_image_device.h"
|
||||
#include "xenia/kernel/fs/devices/host_path_device.h"
|
||||
#include "xenia/kernel/fs/devices/stfs_container_device.h"
|
||||
#include "xenia/logging.h"
|
||||
|
||||
namespace xe {
|
||||
namespace kernel {
|
||||
@@ -34,7 +34,7 @@ FileSystem::~FileSystem() {
|
||||
}
|
||||
|
||||
fs::FileSystemType FileSystem::InferType(const std::wstring& local_path) {
|
||||
auto last_slash = local_path.find_last_of(poly::path_separator);
|
||||
auto last_slash = local_path.find_last_of(xe::path_separator);
|
||||
auto last_dot = local_path.find_last_of('.');
|
||||
if (last_dot < last_slash) {
|
||||
last_dot = std::wstring::npos;
|
||||
@@ -71,7 +71,7 @@ int FileSystem::InitializeFromPath(fs::FileSystemType type,
|
||||
}
|
||||
case FileSystemType::XEX_FILE: {
|
||||
// Get the parent path of the file.
|
||||
auto last_slash = local_path.find_last_of(poly::path_separator);
|
||||
auto last_slash = local_path.find_last_of(xe::path_separator);
|
||||
std::wstring parent_path = local_path.substr(0, last_slash);
|
||||
|
||||
// Register the local directory in the virtual filesystem.
|
||||
@@ -151,7 +151,7 @@ int FileSystem::DeleteSymbolicLink(const std::string& path) {
|
||||
|
||||
std::unique_ptr<Entry> FileSystem::ResolvePath(const std::string& path) {
|
||||
// Resolve relative paths
|
||||
std::string normalized_path(poly::fs::CanonicalizePath(path));
|
||||
std::string normalized_path(xe::fs::CanonicalizePath(path));
|
||||
|
||||
// If no path (starts with a slash) do it module-relative.
|
||||
// Which for now, we just make game:.
|
||||
@@ -164,7 +164,7 @@ std::unique_ptr<Entry> FileSystem::ResolvePath(const std::string& path) {
|
||||
// drive path -> device mappings with nothing nested.
|
||||
std::string full_path = normalized_path;
|
||||
for (const auto& it : symlinks_) {
|
||||
if (poly::find_first_of_case(normalized_path, it.first) == 0) {
|
||||
if (xe::find_first_of_case(normalized_path, it.first) == 0) {
|
||||
// Found symlink, fixup by replacing the prefix.
|
||||
full_path = it.second + full_path.substr(it.first.size());
|
||||
break;
|
||||
@@ -173,7 +173,7 @@ std::unique_ptr<Entry> FileSystem::ResolvePath(const std::string& path) {
|
||||
|
||||
// Scan all devices.
|
||||
for (auto& device : devices_) {
|
||||
if (poly::find_first_of_case(full_path, device->path()) == 0) {
|
||||
if (xe::find_first_of_case(full_path, device->path()) == 0) {
|
||||
// Found! Trim the device prefix off and pass down.
|
||||
auto device_path = full_path.substr(device->path().size());
|
||||
return device->ResolvePath(device_path.c_str());
|
||||
|
||||
Reference in New Issue
Block a user