aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorAaron Suen <warr1024@gmail.com>2015-04-01 08:26:57 -0400
committerCraig Robbins <kde.psych@gmail.com>2015-04-26 23:39:40 +1000
commit1fb3d1156cfdb2e3b35b20f84099ec5bdde172ae (patch)
treead049090ba456db1d5a8adcd202844c3bf92ba14 /src/util
parent400c6087b6da0d4563573189535ba58f589bd7ae (diff)
downloadminetest-1fb3d1156cfdb2e3b35b20f84099ec5bdde172ae.tar.gz
minetest-1fb3d1156cfdb2e3b35b20f84099ec5bdde172ae.tar.bz2
minetest-1fb3d1156cfdb2e3b35b20f84099ec5bdde172ae.zip
Fix fast leaves with texture_clean_transparent enabled.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/string.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/util/string.h b/src/util/string.h
index d4bbafd9f..f2d9af570 100644
--- a/src/util/string.h
+++ b/src/util/string.h
@@ -151,6 +151,24 @@ inline bool str_starts_with(const std::basic_string<T> &str,
return true;
}
+/**
+ * Check whether \p str begins with the string prefix. If \p case_insensitive
+ * is true then the check is case insensitve (default is false; i.e. case is
+ * significant).
+ *
+ * @param str
+ * @param prefix
+ * @param case_insensitive
+ * @return true if the str begins with prefix
+ */
+template <typename T>
+inline bool str_starts_with(const std::basic_string<T> &str,
+ const T *prefix,
+ bool case_insensitive = false)
+{
+ return str_starts_with(str, std::basic_string<T>(prefix),
+ case_insensitive);
+}
/**
* Splits a string into its component parts separated by the character