summaryrefslogtreecommitdiffstats
path: root/src/core/loader
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-08-16 00:25:57 +0200
committerGitHub <noreply@github.com>2018-08-16 00:25:57 +0200
commit69236e5affdb8603b5e61fae2c0acb5853129956 (patch)
tree334d2ea7d8997163640af2d0d2e25c841597241a /src/core/loader
parentMerge pull request #1051 from B3n30/UnscheduleEventThreadsafe (diff)
parentloader: Make ResultStatus directly compatible with fmt (diff)
downloadyuzu-69236e5affdb8603b5e61fae2c0acb5853129956.tar
yuzu-69236e5affdb8603b5e61fae2c0acb5853129956.tar.gz
yuzu-69236e5affdb8603b5e61fae2c0acb5853129956.tar.bz2
yuzu-69236e5affdb8603b5e61fae2c0acb5853129956.tar.lz
yuzu-69236e5affdb8603b5e61fae2c0acb5853129956.tar.xz
yuzu-69236e5affdb8603b5e61fae2c0acb5853129956.tar.zst
yuzu-69236e5affdb8603b5e61fae2c0acb5853129956.zip
Diffstat (limited to 'src/core/loader')
-rw-r--r--src/core/loader/loader.cpp12
-rw-r--r--src/core/loader/loader.h4
2 files changed, 6 insertions, 10 deletions
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index b143f043c..5e07a3f10 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <memory>
+#include <ostream>
#include <string>
#include "common/logging/log.h"
#include "common/string_util.h"
@@ -119,14 +120,9 @@ constexpr std::array<const char*, 36> RESULT_MESSAGES{
"There is no control data available.",
};
-std::string GetMessageForResultStatus(ResultStatus status) {
- return GetMessageForResultStatus(static_cast<u16>(status));
-}
-
-std::string GetMessageForResultStatus(u16 status) {
- if (status >= 36)
- return "";
- return RESULT_MESSAGES[status];
+std::ostream& operator<<(std::ostream& os, ResultStatus status) {
+ os << RESULT_MESSAGES.at(static_cast<size_t>(status));
+ return os;
}
/**
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index 6dffe451a..b74cfbf8a 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -5,6 +5,7 @@
#pragma once
#include <algorithm>
+#include <iosfwd>
#include <memory>
#include <string>
#include <utility>
@@ -94,8 +95,7 @@ enum class ResultStatus : u16 {
ErrorNoControl,
};
-std::string GetMessageForResultStatus(ResultStatus status);
-std::string GetMessageForResultStatus(u16 status);
+std::ostream& operator<<(std::ostream& os, ResultStatus status);
/// Interface for loading an application
class AppLoader : NonCopyable {