diff options
| author | 2021-09-13 23:02:53 -0400 | |
|---|---|---|
| committer | 2021-09-14 08:48:01 -0400 | |
| commit | 8d63ebcb645476d8a1efca7957d8308e32b0353c (patch) | |
| tree | 2767b5659f232f82a80191b970b014364798d7c2 /src/core/hle | |
| parent | Merge pull request #7009 from ameerj/main_process_cleanup (diff) | |
| download | yuzu-8d63ebcb645476d8a1efca7957d8308e32b0353c.tar.gz yuzu-8d63ebcb645476d8a1efca7957d8308e32b0353c.tar.xz yuzu-8d63ebcb645476d8a1efca7957d8308e32b0353c.zip | |
vfs: Partially implement GetFileTimeStampRaw
Gets rid of homebrew warnings using this func
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 12 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 6 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 20 |
3 files changed, 37 insertions, 1 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index c8d65f328..f8f9e32f7 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -261,6 +261,18 @@ ResultVal<FileSys::EntryType> VfsDirectoryServiceWrapper::GetEntryType( | |||
| 261 | return FileSys::ERROR_PATH_NOT_FOUND; | 261 | return FileSys::ERROR_PATH_NOT_FOUND; |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | ResultVal<FileSys::FileTimeStampRaw> VfsDirectoryServiceWrapper::GetFileTimeStampRaw( | ||
| 265 | const std::string& path) const { | ||
| 266 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); | ||
| 267 | if (dir == nullptr) { | ||
| 268 | return FileSys::ERROR_PATH_NOT_FOUND; | ||
| 269 | } | ||
| 270 | if (GetEntryType(path).Failed()) { | ||
| 271 | return FileSys::ERROR_PATH_NOT_FOUND; | ||
| 272 | } | ||
| 273 | return MakeResult(dir->GetFileTimeStamp(Common::FS::GetFilename(path))); | ||
| 274 | } | ||
| 275 | |||
| 264 | FileSystemController::FileSystemController(Core::System& system_) : system{system_} {} | 276 | FileSystemController::FileSystemController(Core::System& system_) : system{system_} {} |
| 265 | 277 | ||
| 266 | FileSystemController::~FileSystemController() = default; | 278 | FileSystemController::~FileSystemController() = default; |
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index d387af3cb..b155e0811 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h | |||
| @@ -240,6 +240,12 @@ public: | |||
| 240 | */ | 240 | */ |
| 241 | ResultVal<FileSys::EntryType> GetEntryType(const std::string& path) const; | 241 | ResultVal<FileSys::EntryType> GetEntryType(const std::string& path) const; |
| 242 | 242 | ||
| 243 | /** | ||
| 244 | * Get the timestamp of the specified path | ||
| 245 | * @return The timestamp of the specified path or error code | ||
| 246 | */ | ||
| 247 | ResultVal<FileSys::FileTimeStampRaw> GetFileTimeStampRaw(const std::string& path) const; | ||
| 248 | |||
| 243 | private: | 249 | private: |
| 244 | FileSys::VirtualDir backing; | 250 | FileSys::VirtualDir backing; |
| 245 | }; | 251 | }; |
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index db4d44c12..50c788dd6 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp | |||
| @@ -326,7 +326,7 @@ public: | |||
| 326 | {11, &IFileSystem::GetFreeSpaceSize, "GetFreeSpaceSize"}, | 326 | {11, &IFileSystem::GetFreeSpaceSize, "GetFreeSpaceSize"}, |
| 327 | {12, &IFileSystem::GetTotalSpaceSize, "GetTotalSpaceSize"}, | 327 | {12, &IFileSystem::GetTotalSpaceSize, "GetTotalSpaceSize"}, |
| 328 | {13, &IFileSystem::CleanDirectoryRecursively, "CleanDirectoryRecursively"}, | 328 | {13, &IFileSystem::CleanDirectoryRecursively, "CleanDirectoryRecursively"}, |
| 329 | {14, nullptr, "GetFileTimeStampRaw"}, | 329 | {14, &IFileSystem::GetFileTimeStampRaw, "GetFileTimeStampRaw"}, |
| 330 | {15, nullptr, "QueryEntry"}, | 330 | {15, nullptr, "QueryEntry"}, |
| 331 | }; | 331 | }; |
| 332 | RegisterHandlers(functions); | 332 | RegisterHandlers(functions); |
| @@ -501,6 +501,24 @@ public: | |||
| 501 | rb.Push(size.get_total_size()); | 501 | rb.Push(size.get_total_size()); |
| 502 | } | 502 | } |
| 503 | 503 | ||
| 504 | void GetFileTimeStampRaw(Kernel::HLERequestContext& ctx) { | ||
| 505 | const auto file_buffer = ctx.ReadBuffer(); | ||
| 506 | const std::string name = Common::StringFromBuffer(file_buffer); | ||
| 507 | |||
| 508 | LOG_WARNING(Service_FS, "(Partial Implementation) called. file={}", name); | ||
| 509 | |||
| 510 | auto result = backend.GetFileTimeStampRaw(name); | ||
| 511 | if (result.Failed()) { | ||
| 512 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 513 | rb.Push(result.Code()); | ||
| 514 | return; | ||
| 515 | } | ||
| 516 | |||
| 517 | IPC::ResponseBuilder rb{ctx, 10}; | ||
| 518 | rb.Push(ResultSuccess); | ||
| 519 | rb.PushRaw(*result); | ||
| 520 | } | ||
| 521 | |||
| 504 | private: | 522 | private: |
| 505 | VfsDirectoryServiceWrapper backend; | 523 | VfsDirectoryServiceWrapper backend; |
| 506 | SizeGetter size; | 524 | SizeGetter size; |