From fc0193c4b108d9a914b841829b1c0f0306b609b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 3 Jun 2018 14:10:52 +0200 Subject: Move Config ValueToString to StringUtil An identical implementation is used by IniFile, so move those functions to StringUtil. A future commit will modify IniFile to use them. --- Source/Core/Common/StringUtil.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Source/Core/Common/StringUtil.h') diff --git a/Source/Core/Common/StringUtil.h b/Source/Core/Common/StringUtil.h index 2e6089ef14..c548b0e87c 100644 --- a/Source/Core/Common/StringUtil.h +++ b/Source/Core/Common/StringUtil.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #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,21 @@ bool TryParseVector(const std::string& str, std::vector* 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); +std::string ValueToString(const std::string& value); +template ::value>* = nullptr> +std::string ValueToString(T value) +{ + return ValueToString(static_cast>(value)); +} + // Generates an hexdump-like representation of a binary data blob. std::string HexDump(const u8* data, size_t size); -- cgit v1.2.3 From 83324fe77dced89c6369b75ecf91899078508e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 3 Jun 2018 14:55:39 +0200 Subject: StringUtil: Remove ValueToString(std::string) Doesn't make a lot of sense to have a function that gives the string representation for a string. --- Source/Core/Common/StringUtil.h | 1 - 1 file changed, 1 deletion(-) (limited to 'Source/Core/Common/StringUtil.h') diff --git a/Source/Core/Common/StringUtil.h b/Source/Core/Common/StringUtil.h index c548b0e87c..11c873bdae 100644 --- a/Source/Core/Common/StringUtil.h +++ b/Source/Core/Common/StringUtil.h @@ -90,7 +90,6 @@ std::string ValueToString(double value); std::string ValueToString(int value); std::string ValueToString(s64 value); std::string ValueToString(bool value); -std::string ValueToString(const std::string& value); template ::value>* = nullptr> std::string ValueToString(T value) { -- cgit v1.2.3