Add toupper, tolower and totitle case-conversion APIs.

This commit is contained in:
Reece H. Dunn
2012-12-22 09:57:21 +00:00
parent e3e85d33f2
commit 9c3a87dbeb
5 changed files with 2341 additions and 1 deletions
+50
View File
@@ -31,6 +31,11 @@ namespace ucd
*/
typedef uint32_t codepoint_t;
/** @name Unicode General Category
* @brief These functions query the General Category property of Unicode codepoints.
*/
//@{
/** @brief Unicode General Category Groups
* @see http://www.unicode.org/reports/tr44/
*/
@@ -106,6 +111,7 @@ namespace ucd
category lookup_category(codepoint_t c);
//@}
/** @name ctype-style APIs
* @brief These functions provide wctype compatible functions using the UCD data.
*/
@@ -183,6 +189,50 @@ namespace ucd
int isupper(codepoint_t c);
//@}
/** @name Case Conversion APIs
* @brief These functions convert Unicode codepoints between lower, upper and title case.
*/
//@{
/** @brief Convert the Unicode codepoint to upper-case.
*
* This function only uses the simple case mapping present in the
* UnicodeData file. The data in SpecialCasing requires Unicode
* codepoints to be mapped to multiple codepoints.
*
* @param c The Unicode codepoint to convert.
* @return The upper-case Unicode codepoint for this codepoint, or
* this codepoint if there is no upper-case codepoint.
*/
codepoint_t toupper(codepoint_t c);
/** @brief Convert the Unicode codepoint to lower-case.
*
* This function only uses the simple case mapping present in the
* UnicodeData file. The data in SpecialCasing requires Unicode
* codepoints to be mapped to multiple codepoints.
*
* @param c The Unicode codepoint to convert.
* @return The lower-case Unicode codepoint for this codepoint, or
* this codepoint if there is no upper-case codepoint.
*/
codepoint_t tolower(codepoint_t c);
/** @brief Convert the Unicode codepoint to title-case.
*
* This function only uses the simple case mapping present in the
* UnicodeData file. The data in SpecialCasing requires Unicode
* codepoints to be mapped to multiple codepoints.
*
* @param c The Unicode codepoint to convert.
* @return The title-case Unicode codepoint for this codepoint, or
* this codepoint if there is no upper-case codepoint.
*/
codepoint_t totitle(codepoint_t c);
//@}
}