summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorCallum Linden <113564339+callumlinden@users.noreply.github.com>2023-04-20 07:19:26 -0700
committerGitHub <noreply@github.com>2023-04-20 07:19:26 -0700
commita7eef57c1f3f8cd0850bd33b99f150d0e20d3e88 (patch)
tree09aeef796ca232ad1856d918c14eba34b3b4165c /indra/llcommon
parentdc5ef88e314d201f8f15be33d3517f45c4af2878 (diff)
parent97b0ba2a6d2596da867043077e32065653d44f6e (diff)
Merge pull request #183 from secondlife/SL-19575a
SL-19575 LLFloaterEmojiPicker - Add filter by category
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llstring.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index 9afbea9afe..bdb90335e1 100644
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -357,6 +357,7 @@ public:
static void replaceNonstandardASCII( string_type& string, T replacement );
static void replaceChar( string_type& string, T target, T replacement );
static void replaceString( string_type& string, string_type target, string_type replacement );
+ static void capitalize(string_type& str);
static BOOL containsNonprintable(const string_type& string);
static void stripNonprintable(string_type& string);
@@ -1596,6 +1597,20 @@ void LLStringUtilBase<T>::replaceTabsWithSpaces( string_type& str, size_type spa
}
//static
+template<class T>
+void LLStringUtilBase<T>::capitalize(string_type& str)
+{
+ if (str.size())
+ {
+ auto last = str[0] = toupper(str[0]);
+ for (U32 i = 1; i < str.size(); ++i)
+ {
+ last = (last == ' ' || last == '-' || last == '_') ? str[i] = toupper(str[i]) : str[i];
+ }
+ }
+}
+
+//static
template<class T>
BOOL LLStringUtilBase<T>::containsNonprintable(const string_type& string)
{