summaryrefslogtreecommitdiff
path: root/Source/Core/Common/StringUtil.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/StringUtil.h')
-rw-r--r--Source/Core/Common/StringUtil.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/Core/Common/StringUtil.h b/Source/Core/Common/StringUtil.h
index 2e6089ef14..11c873bdae 100644
--- a/Source/Core/Common/StringUtil.h
+++ b/Source/Core/Common/StringUtil.h
@@ -9,6 +9,7 @@
#include <iomanip>
#include <sstream>
#include <string>
+#include <type_traits>
#include <vector>
#include "Common/CommonTypes.h"
@@ -41,8 +42,6 @@ std::string ArrayToString(const u8* data, u32 size, int line_len = 20, bool spac
std::string StripSpaces(const std::string& s);
std::string StripQuotes(const std::string& s);
-std::string StringFromBool(bool value);
-
bool TryParse(const std::string& str, bool* output);
bool TryParse(const std::string& str, u16* output);
bool TryParse(const std::string& str, u32* output);
@@ -83,6 +82,20 @@ bool TryParseVector(const std::string& str, std::vector<N>* output, const char d
return true;
}
+std::string ValueToString(u16 value);
+std::string ValueToString(u32 value);
+std::string ValueToString(u64 value);
+std::string ValueToString(float value);
+std::string ValueToString(double value);
+std::string ValueToString(int value);
+std::string ValueToString(s64 value);
+std::string ValueToString(bool value);
+template <typename T, std::enable_if_t<std::is_enum<T>::value>* = nullptr>
+std::string ValueToString(T value)
+{
+ return ValueToString(static_cast<std::underlying_type_t<T>>(value));
+}
+
// Generates an hexdump-like representation of a binary data blob.
std::string HexDump(const u8* data, size_t size);