summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bx/include/bx/inline/string.inl
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bx/include/bx/inline/string.inl')
-rw-r--r--3rdparty/bx/include/bx/inline/string.inl16
1 files changed, 16 insertions, 0 deletions
diff --git a/3rdparty/bx/include/bx/inline/string.inl b/3rdparty/bx/include/bx/inline/string.inl
index 1aa830f2f74..e049b0c343b 100644
--- a/3rdparty/bx/include/bx/inline/string.inl
+++ b/3rdparty/bx/include/bx/inline/string.inl
@@ -292,4 +292,20 @@ namespace bx
return m_line;
}
+ inline bool hasPrefix(const StringView& _str, const StringView& _prefix)
+ {
+ const int32_t len = _prefix.getLength();
+ return _str.getLength() >= len
+ && 0 == strCmp(_str, _prefix, len)
+ ;
+ }
+
+ inline bool hasSuffix(const StringView& _str, const StringView& _suffix)
+ {
+ const int32_t len = _suffix.getLength();
+ return _str.getLength() >= len
+ && 0 == strCmp(StringView(_str.getTerm() - len, _str.getTerm() ), _suffix, len)
+ ;
+ }
+
} // namespace bx