From 1fb3d1156cfdb2e3b35b20f84099ec5bdde172ae Mon Sep 17 00:00:00 2001 From: Aaron Suen Date: Wed, 1 Apr 2015 08:26:57 -0400 Subject: Fix fast leaves with texture_clean_transparent enabled. --- src/util/string.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/util/string.h') 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 &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 +inline bool str_starts_with(const std::basic_string &str, + const T *prefix, + bool case_insensitive = false) +{ + return str_starts_with(str, std::basic_string(prefix), + case_insensitive); +} /** * Splits a string into its component parts separated by the character -- cgit v1.2.3