aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon/llstring.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llcommon/llstring.h')
-rw-r--r--linden/indra/llcommon/llstring.h37
1 files changed, 18 insertions, 19 deletions
diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h
index 7b08fd3..5e75188 100644
--- a/linden/indra/llcommon/llstring.h
+++ b/linden/indra/llcommon/llstring.h
@@ -133,26 +133,32 @@ struct char_traits<U16>
133class LLStringOps 133class LLStringOps
134{ 134{
135public: 135public:
136 static char toUpper(char elem) { return toupper(elem); } 136 static char toUpper(char elem) { return toupper((unsigned char)elem); }
137 static llwchar toUpper(llwchar elem) { return towupper(elem); } 137 static llwchar toUpper(llwchar elem) { return towupper(elem); }
138 138
139 static char toLower(char elem) { return tolower(elem); } 139 static char toLower(char elem) { return tolower((unsigned char)elem); }
140 static llwchar toLower(llwchar elem) { return towlower(elem); } 140 static llwchar toLower(llwchar elem) { return towlower(elem); }
141 141
142 static BOOL isSpace(char elem) { return isspace(elem) != 0; } 142 static bool isSpace(char elem) { return isspace((unsigned char)elem) != 0; }
143 static BOOL isSpace(llwchar elem) { return iswspace(elem) != 0; } 143 static bool isSpace(llwchar elem) { return iswspace(elem) != 0; }
144 144
145 static BOOL isUpper(char elem) { return isupper(elem) != 0; } 145 static bool isUpper(char elem) { return isupper((unsigned char)elem) != 0; }
146 static BOOL isUpper(llwchar elem) { return iswupper(elem) != 0; } 146 static bool isUpper(llwchar elem) { return iswupper(elem) != 0; }
147 147
148 static BOOL isLower(char elem) { return islower(elem) != 0; } 148 static bool isLower(char elem) { return islower((unsigned char)elem) != 0; }
149 static BOOL isLower(llwchar elem) { return iswlower(elem) != 0; } 149 static bool isLower(llwchar elem) { return iswlower(elem) != 0; }
150
151 static bool isDigit(char a) { return isdigit((unsigned char)a) != 0; }
152 static bool isDigit(llwchar a) { return iswdigit(a) != 0; }
153
154 static bool isPunct(char a) { return ispunct((unsigned char)a) != 0; }
155 static bool isPunct(llwchar a) { return iswpunct(a) != 0; }
156
157 static bool isAlnum(char a) { return isalnum((unsigned char)a) != 0; }
158 static bool isAlnum(llwchar a) { return iswalnum(a) != 0; }
150 159
151 static S32 collate(const char* a, const char* b) { return strcoll(a, b); } 160 static S32 collate(const char* a, const char* b) { return strcoll(a, b); }
152 static S32 collate(const llwchar* a, const llwchar* b); 161 static S32 collate(const llwchar* a, const llwchar* b);
153
154 static BOOL isDigit(char a) { return isdigit(a) != 0; }
155 static BOOL isDigit(llwchar a) { return iswdigit(a) != 0; }
156}; 162};
157 163
158/** 164/**
@@ -194,7 +200,7 @@ public:
194 typedef std::map<LLFormatMapString, LLFormatMapString> format_map_t; 200 typedef std::map<LLFormatMapString, LLFormatMapString> format_map_t;
195 static S32 format(std::basic_string<T>& s, const format_map_t& fmt_map); 201 static S32 format(std::basic_string<T>& s, const format_map_t& fmt_map);
196 202
197 static BOOL isValidIndex(const std::basic_string<T>& string, size_type i) 203 static bool isValidIndex(const std::basic_string<T>& string, size_type i)
198 { 204 {
199 return !string.empty() && (0 <= i) && (i <= string.size()); 205 return !string.empty() && (0 <= i) && (i <= string.size());
200 } 206 }
@@ -1155,13 +1161,6 @@ BOOL LLStringUtilBase<T>::convertToU32(const std::basic_string<T>& string, U32&
1155 std::basic_istringstream<T> i_stream((std::basic_string<T>)temp); 1161 std::basic_istringstream<T> i_stream((std::basic_string<T>)temp);
1156 if(i_stream >> v) 1162 if(i_stream >> v)
1157 { 1163 {
1158 //TODO: figure out overflow reporting here
1159 //if( ULONG_MAX == v )
1160 //{
1161 // // Underflow or overflow
1162 // return FALSE;
1163 //}
1164
1165 value = v; 1164 value = v;
1166 return TRUE; 1165 return TRUE;
1167 } 1166 }