aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorZousar Shaker <[email protected]>2026-04-27 04:49:19 -0600
committerGitHub Enterprise <[email protected]>2026-04-27 12:49:19 +0200
commit705c8b8d80965584c88f63d4449cbfdfa36138ea (patch)
tree819000130104f1d01a0e3605e5f84c4316f52b41 /src/zencore/include
parenthydration with pack (#1016) (diff)
downloadarchived-zen-705c8b8d80965584c88f63d4449cbfdfa36138ea.tar.xz
archived-zen-705c8b8d80965584c88f63d4449cbfdfa36138ea.zip
Zs/user path case comparison (#1015)
- Improvement: `zen builds` `--exclude-folders` and `--exclude-extensions` values now match paths case-insensitively and tolerate surrounding whitespace between separators
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/string.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/zencore/include/zencore/string.h b/src/zencore/include/zencore/string.h
index 7ca2afc69..fded960f3 100644
--- a/src/zencore/include/zencore/string.h
+++ b/src/zencore/include/zencore/string.h
@@ -1039,6 +1039,24 @@ StrCaseCompare(std::string_view Lhs, std::string_view Rhs)
return Result;
}
+inline bool
+StrCaseEquals(std::string_view Lhs, std::string_view Rhs)
+{
+ return StrCaseCompare(Lhs, Rhs) == 0;
+}
+
+inline bool
+StrCaseStartsWith(std::string_view Str, std::string_view Prefix)
+{
+ return Str.size() >= Prefix.size() && StrCaseCompare(Str.data(), Prefix.data(), Prefix.size()) == 0;
+}
+
+inline bool
+StrCaseEndsWith(std::string_view Str, std::string_view Suffix)
+{
+ return Str.size() >= Suffix.size() && StrCaseCompare(Str.data() + (Str.size() - Suffix.size()), Suffix.data(), Suffix.size()) == 0;
+}
+
/**
* @brief
* Helper function to implement case sensitive spaceship operator for strings.