summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qtools_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qtools_p.h')
-rw-r--r--src/corelib/tools/qtools_p.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/tools/qtools_p.h b/src/corelib/tools/qtools_p.h
index d48318b474..ca52b15870 100644
--- a/src/corelib/tools/qtools_p.h
+++ b/src/corelib/tools/qtools_p.h
@@ -84,6 +84,17 @@ Q_DECL_CONSTEXPR inline int fromOct(uint c) noexcept
{
return ((c >= '0') && (c <= '7')) ? int(c - '0') : -1;
}
+
+constexpr inline char toAsciiLower(char ch) noexcept
+{
+ return (ch >= 'A' && ch <= 'Z') ? ch - 'A' + 'a' : ch;
+}
+
+constexpr inline char toAsciiUpper(char ch) noexcept
+{
+ return (ch >= 'a' && ch <= 'z') ? ch - 'a' + 'A' : ch;
+}
+
}
// We typically need an extra bit for qNextPowerOfTwo when determining the next allocation size.