Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
QByteArray QByteArray::toLower() const
{
QByteArray s(*this);
- uchar *p = reinterpret_cast<uchar *>(s.data());
+ char *p = s.data();
while (*p) {
- *p = QChar::toLower((ushort)*p);
+ *p = qToLower(*p);
p++;
}
return s;
QByteArray QByteArray::toUpper() const
{
QByteArray s(*this);
- uchar *p = reinterpret_cast<uchar *>(s.data());
+ char *p = s.data();
while (*p) {
- *p = QChar::toUpper((ushort)*p);
+ *p = qToUpper(*p);
p++;
}
return s;
return (ch >= '0' && ch <= '9');
}
-static inline char qToLower(char ch)
+template <class T>
+inline T qToLower(const T ch)
{
if (ch >= 'A' && ch <= 'Z')
return (ch + 32);
return ch;
}
-static inline char qToUpper(char ch)
+template <class T>
+inline T qToUpper(const T ch)
{
if (ch >= 'a' && ch <= 'z')
return (ch - 32);