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/reporter.cpp | |
| 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/reporter.cpp')
| -rw-r--r-- | src/core/reporter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/reporter.cpp b/src/core/reporter.cpp index 76cfa5a17..0becdf642 100644 --- a/src/core/reporter.cpp +++ b/src/core/reporter.cpp | |||
| @@ -28,8 +28,9 @@ | |||
| 28 | namespace { | 28 | namespace { |
| 29 | 29 | ||
| 30 | std::string GetPath(std::string_view type, u64 title_id, std::string_view timestamp) { | 30 | std::string GetPath(std::string_view type, u64 title_id, std::string_view timestamp) { |
| 31 | return fmt::format("{}{}/{:016X}_{}.json", FileUtil::GetUserPath(FileUtil::UserPath::LogDir), | 31 | return fmt::format("{}{}/{:016X}_{}.json", |
| 32 | type, title_id, timestamp); | 32 | Common::FS::GetUserPath(Common::FS::UserPath::LogDir), type, title_id, |
| 33 | timestamp); | ||
| 33 | } | 34 | } |
| 34 | 35 | ||
| 35 | std::string GetTimestamp() { | 36 | std::string GetTimestamp() { |
| @@ -40,13 +41,13 @@ std::string GetTimestamp() { | |||
| 40 | using namespace nlohmann; | 41 | using namespace nlohmann; |
| 41 | 42 | ||
| 42 | void SaveToFile(json json, const std::string& filename) { | 43 | void SaveToFile(json json, const std::string& filename) { |
| 43 | if (!FileUtil::CreateFullPath(filename)) { | 44 | if (!Common::FS::CreateFullPath(filename)) { |
| 44 | LOG_ERROR(Core, "Failed to create path for '{}' to save report!", filename); | 45 | LOG_ERROR(Core, "Failed to create path for '{}' to save report!", filename); |
| 45 | return; | 46 | return; |
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | std::ofstream file( | 49 | std::ofstream file( |
| 49 | FileUtil::SanitizePath(filename, FileUtil::DirectorySeparator::PlatformDefault)); | 50 | Common::FS::SanitizePath(filename, Common::FS::DirectorySeparator::PlatformDefault)); |
| 50 | file << std::setw(4) << json << std::endl; | 51 | file << std::setw(4) << json << std::endl; |
| 51 | } | 52 | } |
| 52 | 53 | ||