summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorGravatar bunnei2014-11-11 19:27:35 -0500
committerGravatar bunnei2014-11-17 21:49:24 -0500
commita3107a6b571dedb8828b20ddcb709ec17db9715a (patch)
tree367848a8e6e445e062f10378d45aa6a4abfcb63b /src/core/hle/kernel
parentFileSys: Added DebugStr method to Path class. (diff)
downloadyuzu-a3107a6b571dedb8828b20ddcb709ec17db9715a.tar.gz
yuzu-a3107a6b571dedb8828b20ddcb709ec17db9715a.tar.xz
yuzu-a3107a6b571dedb8828b20ddcb709ec17db9715a.zip
FileSys: Updated backend code to use FileSys::Path instead of string for paths.
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/archive.cpp14
-rw-r--r--src/core/hle/kernel/archive.h6
2 files changed, 10 insertions, 10 deletions
diff --git a/src/core/hle/kernel/archive.cpp b/src/core/hle/kernel/archive.cpp
index 764082d71..5d734d042 100644
--- a/src/core/hle/kernel/archive.cpp
+++ b/src/core/hle/kernel/archive.cpp
@@ -129,12 +129,12 @@ public:
129class File : public Object { 129class File : public Object {
130public: 130public:
131 std::string GetTypeName() const override { return "File"; } 131 std::string GetTypeName() const override { return "File"; }
132 std::string GetName() const override { return path; } 132 std::string GetName() const override { return path.DebugStr(); }
133 133
134 static Kernel::HandleType GetStaticHandleType() { return HandleType::File; } 134 static Kernel::HandleType GetStaticHandleType() { return HandleType::File; }
135 Kernel::HandleType GetHandleType() const override { return HandleType::File; } 135 Kernel::HandleType GetHandleType() const override { return HandleType::File; }
136 136
137 std::string path; ///< Path of the file 137 FileSys::Path path; ///< Path of the file
138 std::unique_ptr<FileSys::File> backend; ///< File backend interface 138 std::unique_ptr<FileSys::File> backend; ///< File backend interface
139 139
140 /** 140 /**
@@ -221,12 +221,12 @@ public:
221class Directory : public Object { 221class Directory : public Object {
222public: 222public:
223 std::string GetTypeName() const override { return "Directory"; } 223 std::string GetTypeName() const override { return "Directory"; }
224 std::string GetName() const override { return path; } 224 std::string GetName() const override { return path.DebugStr(); }
225 225
226 static Kernel::HandleType GetStaticHandleType() { return HandleType::Directory; } 226 static Kernel::HandleType GetStaticHandleType() { return HandleType::Directory; }
227 Kernel::HandleType GetHandleType() const override { return HandleType::Directory; } 227 Kernel::HandleType GetHandleType() const override { return HandleType::Directory; }
228 228
229 std::string path; ///< Path of the directory 229 FileSys::Path path; ///< Path of the directory
230 std::unique_ptr<FileSys::Directory> backend; ///< File backend interface 230 std::unique_ptr<FileSys::Directory> backend; ///< File backend interface
231 231
232 /** 232 /**
@@ -366,7 +366,7 @@ Handle CreateArchive(FileSys::Archive* backend, const std::string& name) {
366 * @param mode Mode under which to open the File 366 * @param mode Mode under which to open the File
367 * @return Opened File object 367 * @return Opened File object
368 */ 368 */
369Handle OpenFileFromArchive(Handle archive_handle, const std::string& path, const FileSys::Mode mode) { 369Handle OpenFileFromArchive(Handle archive_handle, const FileSys::Path& path, const FileSys::Mode mode) {
370 File* file = new File; 370 File* file = new File;
371 Handle handle = Kernel::g_object_pool.Create(file); 371 Handle handle = Kernel::g_object_pool.Create(file);
372 372
@@ -386,7 +386,7 @@ Handle OpenFileFromArchive(Handle archive_handle, const std::string& path, const
386 * @param path Path to the Directory inside of the Archive 386 * @param path Path to the Directory inside of the Archive
387 * @return Opened Directory object 387 * @return Opened Directory object
388 */ 388 */
389Result CreateDirectoryFromArchive(Handle archive_handle, const std::string& path) { 389Result CreateDirectoryFromArchive(Handle archive_handle, const FileSys::Path& path) {
390 Archive* archive = Kernel::g_object_pool.GetFast<Archive>(archive_handle); 390 Archive* archive = Kernel::g_object_pool.GetFast<Archive>(archive_handle);
391 if (archive == nullptr) 391 if (archive == nullptr)
392 return -1; 392 return -1;
@@ -401,7 +401,7 @@ Result CreateDirectoryFromArchive(Handle archive_handle, const std::string& path
401 * @param path Path to the Directory inside of the Archive 401 * @param path Path to the Directory inside of the Archive
402 * @return Opened Directory object 402 * @return Opened Directory object
403 */ 403 */
404Handle OpenDirectoryFromArchive(Handle archive_handle, const std::string& path) { 404Handle OpenDirectoryFromArchive(Handle archive_handle, const FileSys::Path& path) {
405 Directory* directory = new Directory; 405 Directory* directory = new Directory;
406 Handle handle = Kernel::g_object_pool.Create(directory); 406 Handle handle = Kernel::g_object_pool.Create(directory);
407 407
diff --git a/src/core/hle/kernel/archive.h b/src/core/hle/kernel/archive.h
index 0230996b6..9c6015506 100644
--- a/src/core/hle/kernel/archive.h
+++ b/src/core/hle/kernel/archive.h
@@ -43,7 +43,7 @@ Handle CreateArchive(FileSys::Archive* backend, const std::string& name);
43 * @param mode Mode under which to open the File 43 * @param mode Mode under which to open the File
44 * @return Opened File object 44 * @return Opened File object
45 */ 45 */
46Handle OpenFileFromArchive(Handle archive_handle, const std::string& name, const FileSys::Mode mode); 46Handle OpenFileFromArchive(Handle archive_handle, const FileSys::Path& path, const FileSys::Mode mode);
47 47
48/** 48/**
49 * Create a Directory from an Archive 49 * Create a Directory from an Archive
@@ -51,7 +51,7 @@ Handle OpenFileFromArchive(Handle archive_handle, const std::string& name, const
51 * @param path Path to the Directory inside of the Archive 51 * @param path Path to the Directory inside of the Archive
52 * @return Whether creation of directory succeeded 52 * @return Whether creation of directory succeeded
53 */ 53 */
54Result CreateDirectoryFromArchive(Handle archive_handle, const std::string& name); 54Result CreateDirectoryFromArchive(Handle archive_handle, const FileSys::Path& path);
55 55
56/** 56/**
57 * Open a Directory from an Archive 57 * Open a Directory from an Archive
@@ -59,7 +59,7 @@ Result CreateDirectoryFromArchive(Handle archive_handle, const std::string& name
59 * @param path Path to the Directory inside of the Archive 59 * @param path Path to the Directory inside of the Archive
60 * @return Opened Directory object 60 * @return Opened Directory object
61 */ 61 */
62Handle OpenDirectoryFromArchive(Handle archive_handle, const std::string& name); 62Handle OpenDirectoryFromArchive(Handle archive_handle, const FileSys::Path& path);
63 63
64/// Initialize archives 64/// Initialize archives
65void ArchiveInit(); 65void ArchiveInit();