aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/string.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/string.cc b/src/util/string.cc
index c486a4f..9fad804 100644
--- a/src/util/string.cc
+++ b/src/util/string.cc
@@ -1,5 +1,7 @@
#include "util/string.h"
+#include <print>
+
using namespace std;
namespace ov4
@@ -40,4 +42,12 @@ std::string safe_str(const char *s, const char *fallback)
return (s != nullptr) ? s : fallback;
}
+void print_str_hex(const std::string &s)
+{
+ for (unsigned char c : s)
+ {
+ print("{:02X} ", c);
+ }
+}
+
}