diff options
| -rw-r--r-- | src/common/string_util.cpp | 19 | ||||
| -rw-r--r-- | src/common/string_util.h | 2 |
2 files changed, 0 insertions, 21 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. | ||
| 37 | std::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 | |||
| 54 | std::string StringFromBuffer(const std::vector<u8>& data) { | 35 | std::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 | } |
diff --git a/src/common/string_util.h b/src/common/string_util.h index 7e32d6405..08f96533b 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h | |||
| @@ -17,8 +17,6 @@ std::string ToLower(std::string str); | |||
| 17 | /// Make a string uppercase | 17 | /// Make a string uppercase |
| 18 | std::string ToUpper(std::string str); | 18 | std::string ToUpper(std::string str); |
| 19 | 19 | ||
| 20 | std::string ArrayToString(const u8* data, std::size_t size, int line_len = 20, bool spaces = true); | ||
| 21 | |||
| 22 | std::string StringFromBuffer(const std::vector<u8>& data); | 20 | std::string StringFromBuffer(const std::vector<u8>& data); |
| 23 | 21 | ||
| 24 | std::string StripSpaces(const std::string& s); | 22 | std::string StripSpaces(const std::string& s); |