diff options
| author | 2020-08-15 08:33:16 -0400 | |
|---|---|---|
| committer | 2020-08-16 06:52:40 -0400 | |
| commit | c4ed791164df7e3e74042a37a62077b4dc4ade91 (patch) | |
| tree | 12bbcc09d0db32a0b6b5dc1bc49245964486da63 /src/core/hle/service/bcat | |
| parent | Merge pull request #4528 from lioncash/discard (diff) | |
| download | yuzu-c4ed791164df7e3e74042a37a62077b4dc4ade91.tar.gz yuzu-c4ed791164df7e3e74042a37a62077b4dc4ade91.tar.xz yuzu-c4ed791164df7e3e74042a37a62077b4dc4ade91.zip | |
common/fileutil: Convert namespace to Common::FS
Migrates a remaining common file over to the Common namespace, making it
consistent with the rest of common files.
This also allows for high-traffic FS related code to alias the
filesystem function namespace as
namespace FS = Common::FS;
for more concise typing.
Diffstat (limited to 'src/core/hle/service/bcat')
| -rw-r--r-- | src/core/hle/service/bcat/backend/boxcat.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp index 51c2ba964..ca021a99f 100644 --- a/src/core/hle/service/bcat/backend/boxcat.cpp +++ b/src/core/hle/service/bcat/backend/boxcat.cpp | |||
| @@ -89,12 +89,12 @@ constexpr u32 TIMEOUT_SECONDS = 30; | |||
| 89 | 89 | ||
| 90 | std::string GetBINFilePath(u64 title_id) { | 90 | std::string GetBINFilePath(u64 title_id) { |
| 91 | return fmt::format("{}bcat/{:016X}/launchparam.bin", | 91 | return fmt::format("{}bcat/{:016X}/launchparam.bin", |
| 92 | FileUtil::GetUserPath(FileUtil::UserPath::CacheDir), title_id); | 92 | Common::FS::GetUserPath(Common::FS::UserPath::CacheDir), title_id); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | std::string GetZIPFilePath(u64 title_id) { | 95 | std::string GetZIPFilePath(u64 title_id) { |
| 96 | return fmt::format("{}bcat/{:016X}/data.zip", | 96 | return fmt::format("{}bcat/{:016X}/data.zip", |
| 97 | FileUtil::GetUserPath(FileUtil::UserPath::CacheDir), title_id); | 97 | Common::FS::GetUserPath(Common::FS::UserPath::CacheDir), title_id); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | // If the error is something the user should know about (build ID mismatch, bad client version), | 100 | // If the error is something the user should know about (build ID mismatch, bad client version), |
| @@ -205,8 +205,8 @@ private: | |||
| 205 | {std::string("Game-Build-Id"), fmt::format("{:016X}", build_id)}, | 205 | {std::string("Game-Build-Id"), fmt::format("{:016X}", build_id)}, |
| 206 | }; | 206 | }; |
| 207 | 207 | ||
| 208 | if (FileUtil::Exists(path)) { | 208 | if (Common::FS::Exists(path)) { |
| 209 | FileUtil::IOFile file{path, "rb"}; | 209 | Common::FS::IOFile file{path, "rb"}; |
| 210 | if (file.IsOpen()) { | 210 | if (file.IsOpen()) { |
| 211 | std::vector<u8> bytes(file.GetSize()); | 211 | std::vector<u8> bytes(file.GetSize()); |
| 212 | file.ReadBytes(bytes.data(), bytes.size()); | 212 | file.ReadBytes(bytes.data(), bytes.size()); |
| @@ -236,8 +236,8 @@ private: | |||
| 236 | return DownloadResult::InvalidContentType; | 236 | return DownloadResult::InvalidContentType; |
| 237 | } | 237 | } |
| 238 | 238 | ||
| 239 | FileUtil::CreateFullPath(path); | 239 | Common::FS::CreateFullPath(path); |
| 240 | FileUtil::IOFile file{path, "wb"}; | 240 | Common::FS::IOFile file{path, "wb"}; |
| 241 | if (!file.IsOpen()) | 241 | if (!file.IsOpen()) |
| 242 | return DownloadResult::GeneralFSError; | 242 | return DownloadResult::GeneralFSError; |
| 243 | if (!file.Resize(response->body.size())) | 243 | if (!file.Resize(response->body.size())) |
| @@ -290,7 +290,7 @@ void SynchronizeInternal(AM::Applets::AppletManager& applet_manager, DirectoryGe | |||
| 290 | LOG_ERROR(Service_BCAT, "Boxcat synchronization failed with error '{}'!", res); | 290 | LOG_ERROR(Service_BCAT, "Boxcat synchronization failed with error '{}'!", res); |
| 291 | 291 | ||
| 292 | if (res == DownloadResult::NoMatchBuildId || res == DownloadResult::NoMatchTitleId) { | 292 | if (res == DownloadResult::NoMatchBuildId || res == DownloadResult::NoMatchTitleId) { |
| 293 | FileUtil::Delete(zip_path); | 293 | Common::FS::Delete(zip_path); |
| 294 | } | 294 | } |
| 295 | 295 | ||
| 296 | HandleDownloadDisplayResult(applet_manager, res); | 296 | HandleDownloadDisplayResult(applet_manager, res); |
| @@ -300,7 +300,7 @@ void SynchronizeInternal(AM::Applets::AppletManager& applet_manager, DirectoryGe | |||
| 300 | 300 | ||
| 301 | progress.StartProcessingDataList(); | 301 | progress.StartProcessingDataList(); |
| 302 | 302 | ||
| 303 | FileUtil::IOFile zip{zip_path, "rb"}; | 303 | Common::FS::IOFile zip{zip_path, "rb"}; |
| 304 | const auto size = zip.GetSize(); | 304 | const auto size = zip.GetSize(); |
| 305 | std::vector<u8> bytes(size); | 305 | std::vector<u8> bytes(size); |
| 306 | if (!zip.IsOpen() || size == 0 || zip.ReadBytes(bytes.data(), bytes.size()) != bytes.size()) { | 306 | if (!zip.IsOpen() || size == 0 || zip.ReadBytes(bytes.data(), bytes.size()) != bytes.size()) { |
| @@ -420,7 +420,7 @@ std::optional<std::vector<u8>> Boxcat::GetLaunchParameter(TitleIDVersion title) | |||
| 420 | LOG_ERROR(Service_BCAT, "Boxcat synchronization failed with error '{}'!", res); | 420 | LOG_ERROR(Service_BCAT, "Boxcat synchronization failed with error '{}'!", res); |
| 421 | 421 | ||
| 422 | if (res == DownloadResult::NoMatchBuildId || res == DownloadResult::NoMatchTitleId) { | 422 | if (res == DownloadResult::NoMatchBuildId || res == DownloadResult::NoMatchTitleId) { |
| 423 | FileUtil::Delete(path); | 423 | Common::FS::Delete(path); |
| 424 | } | 424 | } |
| 425 | 425 | ||
| 426 | HandleDownloadDisplayResult(applet_manager, res); | 426 | HandleDownloadDisplayResult(applet_manager, res); |
| @@ -428,7 +428,7 @@ std::optional<std::vector<u8>> Boxcat::GetLaunchParameter(TitleIDVersion title) | |||
| 428 | } | 428 | } |
| 429 | } | 429 | } |
| 430 | 430 | ||
| 431 | FileUtil::IOFile bin{path, "rb"}; | 431 | Common::FS::IOFile bin{path, "rb"}; |
| 432 | const auto size = bin.GetSize(); | 432 | const auto size = bin.GetSize(); |
| 433 | std::vector<u8> bytes(size); | 433 | std::vector<u8> bytes(size); |
| 434 | if (!bin.IsOpen() || size == 0 || bin.ReadBytes(bytes.data(), bytes.size()) != bytes.size()) { | 434 | if (!bin.IsOpen() || size == 0 || bin.ReadBytes(bytes.data(), bytes.size()) != bytes.size()) { |