aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/CharUtil.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-11 18:42:05 +0200
committerMax Kellermann <max@duempel.org>2014-08-11 18:42:05 +0200
commit2ccfb71d12d0ae1a8b4177c95aca45100982e685 (patch)
treeead159080117d3f30b5a91b06117bd00c3760269 /src/util/CharUtil.hxx
parente8a5a9b1e8cabb3256903af3f25d4062b859f2e6 (diff)
downloadmpd-2ccfb71d12d0ae1a8b4177c95aca45100982e685.tar.gz
mpd-2ccfb71d12d0ae1a8b4177c95aca45100982e685.tar.xz
mpd-2ccfb71d12d0ae1a8b4177c95aca45100982e685.zip
util/CharUtil: add ToLowerASCII()
Diffstat (limited to 'src/util/CharUtil.hxx')
-rw-r--r--src/util/CharUtil.hxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util/CharUtil.hxx b/src/util/CharUtil.hxx
index 9cb852524..84a88a94e 100644
--- a/src/util/CharUtil.hxx
+++ b/src/util/CharUtil.hxx
@@ -126,4 +126,17 @@ ToUpperASCII(char ch)
: ch;
}
+/**
+ * Convert the specified ASCII character (0x00..0x7f) to lower case.
+ * Unlike toupper(), it ignores the system locale.
+ */
+constexpr
+static inline char
+ToLowerASCII(char ch)
+{
+ return ch >= 'A' && ch <= 'Z'
+ ? (ch + ('a' - 'A'))
+ : ch;
+}
+
#endif