|
|
|
@ -129,12 +129,12 @@ public: |
|
|
|
class File : public Object { |
|
|
|
public: |
|
|
|
std::string GetTypeName() const override { return "File"; } |
|
|
|
std::string GetName() const override { return path; } |
|
|
|
std::string GetName() const override { return path.DebugStr(); } |
|
|
|
|
|
|
|
static Kernel::HandleType GetStaticHandleType() { return HandleType::File; } |
|
|
|
Kernel::HandleType GetHandleType() const override { return HandleType::File; } |
|
|
|
|
|
|
|
std::string path; ///< Path of the file
|
|
|
|
FileSys::Path path; ///< Path of the file
|
|
|
|
std::unique_ptr<FileSys::File> backend; ///< File backend interface
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -221,12 +221,12 @@ public: |
|
|
|
class Directory : public Object { |
|
|
|
public: |
|
|
|
std::string GetTypeName() const override { return "Directory"; } |
|
|
|
std::string GetName() const override { return path; } |
|
|
|
std::string GetName() const override { return path.DebugStr(); } |
|
|
|
|
|
|
|
static Kernel::HandleType GetStaticHandleType() { return HandleType::Directory; } |
|
|
|
Kernel::HandleType GetHandleType() const override { return HandleType::Directory; } |
|
|
|
|
|
|
|
std::string path; ///< Path of the directory
|
|
|
|
FileSys::Path path; ///< Path of the directory
|
|
|
|
std::unique_ptr<FileSys::Directory> backend; ///< File backend interface
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -366,7 +366,7 @@ Handle CreateArchive(FileSys::Archive* backend, const std::string& name) { |
|
|
|
* @param mode Mode under which to open the File |
|
|
|
* @return Opened File object |
|
|
|
*/ |
|
|
|
Handle OpenFileFromArchive(Handle archive_handle, const std::string& path, const FileSys::Mode mode) { |
|
|
|
Handle OpenFileFromArchive(Handle archive_handle, const FileSys::Path& path, const FileSys::Mode mode) { |
|
|
|
File* file = new File; |
|
|
|
Handle handle = Kernel::g_object_pool.Create(file); |
|
|
|
|
|
|
|
@ -386,7 +386,7 @@ Handle OpenFileFromArchive(Handle archive_handle, const std::string& path, const |
|
|
|
* @param path Path to the Directory inside of the Archive |
|
|
|
* @return Opened Directory object |
|
|
|
*/ |
|
|
|
Result CreateDirectoryFromArchive(Handle archive_handle, const std::string& path) { |
|
|
|
Result CreateDirectoryFromArchive(Handle archive_handle, const FileSys::Path& path) { |
|
|
|
Archive* archive = Kernel::g_object_pool.GetFast<Archive>(archive_handle); |
|
|
|
if (archive == nullptr) |
|
|
|
return -1; |
|
|
|
@ -401,7 +401,7 @@ Result CreateDirectoryFromArchive(Handle archive_handle, const std::string& path |
|
|
|
* @param path Path to the Directory inside of the Archive |
|
|
|
* @return Opened Directory object |
|
|
|
*/ |
|
|
|
Handle OpenDirectoryFromArchive(Handle archive_handle, const std::string& path) { |
|
|
|
Handle OpenDirectoryFromArchive(Handle archive_handle, const FileSys::Path& path) { |
|
|
|
Directory* directory = new Directory; |
|
|
|
Handle handle = Kernel::g_object_pool.Create(directory); |
|
|
|
|
|
|
|
|