aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.cpp')
-rw-r--r--src/Utils.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp
index df6db2f..bc7b1f2 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -22,6 +22,11 @@ namespace gsr {
}
}
+ bool starts_with(std::string_view str, const char *substr) {
+ size_t len = strlen(substr);
+ return str.size() >= len && memcmp(str.data(), substr, len) == 0;
+ }
+
std::string get_home_dir() {
const char *home_dir = getenv("HOME");
if(!home_dir) {