summaryrefslogtreecommitdiff
path: root/src/common/string_util.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2018-11-13 14:11:34 -0500
committerGravatar Lioncash2018-11-13 18:14:11 -0500
commitc7387e6504db0548fc5dafec5a27ce6923e58db7 (patch)
tree21a21be4abc6e4b736f13da5b703efcbbe744ba0 /src/common/string_util.cpp
parentstring_util: Remove TryParse() (diff)
downloadyuzu-c7387e6504db0548fc5dafec5a27ce6923e58db7.tar.gz
yuzu-c7387e6504db0548fc5dafec5a27ce6923e58db7.tar.xz
yuzu-c7387e6504db0548fc5dafec5a27ce6923e58db7.zip
string_util: Remove ArrayToString()
An old function from Dolphin. This is also unused, and pretty inflexible when it comes to printing out different data types (for example, one might not want to print out an array of u8s but a different type instead. Given we use fmt, there's no need to keep this implementation of the function around.
Diffstat (limited to 'src/common/string_util.cpp')
-rw-r--r--src/common/string_util.cpp19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index 5b004ef48..14f7037d8 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -6,7 +6,6 @@
6#include <cctype> 6#include <cctype>
7#include <codecvt> 7#include <codecvt>
8#include <cstdlib> 8#include <cstdlib>
9#include <iomanip>
10#include <locale> 9#include <locale>
11#include <sstream> 10#include <sstream>
12#include "common/common_paths.h" 11#include "common/common_paths.h"
@@ -33,24 +32,6 @@ std::string ToUpper(std::string str) {
33 return str; 32 return str;
34} 33}
35 34
36// For Debugging. Read out an u8 array.
37std::string ArrayToString(const u8* data, std::size_t size, int line_len, bool spaces) {
38 std::ostringstream oss;
39 oss << std::setfill('0') << std::hex;
40
41 for (int line = 0; size; ++data, --size) {
42 oss << std::setw(2) << (int)*data;
43
44 if (line_len == ++line) {
45 oss << '\n';
46 line = 0;
47 } else if (spaces)
48 oss << ' ';
49 }
50
51 return oss.str();
52}
53
54std::string StringFromBuffer(const std::vector<u8>& data) { 35std::string StringFromBuffer(const std::vector<u8>& data) {
55 return std::string(data.begin(), std::find(data.begin(), data.end(), '\0')); 36 return std::string(data.begin(), std::find(data.begin(), data.end(), '\0'));
56} 37}