aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-09-17 08:54:32 +0000
committer_ov4 <ov4@ov4.org>2026-09-17 08:54:32 +0000
commit64717eba9de6e3dc60e47c322b5f1c1632ed3b21 (patch)
tree6d6f17f9610104cc4a548c8b0de0a7cf32048730 /src/util
parentcf117c70277fab4d3de170b55fe8248d9cc36927 (diff)
add quotation mark support
allow arguments of a command to be quoted
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);
+ }
+}
+
}