summaryrefslogtreecommitdiff
path: root/include/iprt/uni.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/iprt/uni.h')
-rw-r--r--include/iprt/uni.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/include/iprt/uni.h b/include/iprt/uni.h
index 6f0c23ec..a1161db1 100644
--- a/include/iprt/uni.h
+++ b/include/iprt/uni.h
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -46,8 +46,8 @@
RT_C_DECLS_BEGIN
-
#ifndef RTUNI_USE_WCTYPE
+
/**
* A unicode flags range.
* @internal
@@ -161,6 +161,20 @@ DECLINLINE(bool) RTUniCpIsLower(RTUNICP CodePoint)
/**
+ * Checks if a unicode code point is case foldable.
+ *
+ * @returns true if it is.
+ * @returns false if it isn't.
+ * @param CodePoint The code point.
+ */
+DECLINLINE(bool) RTUniCpIsFoldable(RTUNICP CodePoint)
+{
+ /* Right enough. */
+ return (rtUniCpFlags(CodePoint) & (RTUNI_LOWER | RTUNI_UPPER)) != 0;
+}
+
+
+/**
* Checks if a unicode code point is alphabetic.
*
* @returns true if it is.
@@ -303,6 +317,20 @@ DECLINLINE(bool) RTUniCpIsLower(RTUNICP CodePoint)
/**
+ * Checks if a unicode code point is case foldable.
+ *
+ * @returns true if it is.
+ * @returns false if it isn't.
+ * @param CodePoint The code point.
+ */
+DECLINLINE(bool) RTUniCpIsFoldable(RTUNICP CodePoint)
+{
+ /* Right enough. */
+ return iswupper(CodePoint) || iswlower(CodePoint);
+}
+
+
+/**
* Checks if a unicode code point is alphabetic.
*
* @returns true if it is.