1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 *******************************************************************************
5 * Copyright (C) 2011, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 *******************************************************************************
8 * file name: unistr_case_locale.cpp
10 * tab size: 8 (not used)
13 * created on: 2011may31
14 * created by: Markus W. Scherer
16 * Locale-sensitive case mapping functions (ones that call uloc_getDefault())
17 * were moved here to break dependency cycles among parts of the common library.
20 #include "unicode/utypes.h"
21 #include "unicode/locid.h"
22 #include "unicode/ucasemap.h"
23 #include "unicode/unistr.h"
24 #include "ucasemap_imp.h"
28 //========================================
29 // Write implementation
30 //========================================
33 UnicodeString::toLower() {
34 return caseMap(ustrcase_getCaseLocale(NULL
), 0,
35 UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToLower
);
39 UnicodeString::toLower(const Locale
&locale
) {
40 return caseMap(ustrcase_getCaseLocale(locale
.getBaseName()), 0,
41 UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToLower
);
45 UnicodeString::toUpper() {
46 return caseMap(ustrcase_getCaseLocale(NULL
), 0,
47 UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToUpper
);
51 UnicodeString::toUpper(const Locale
&locale
) {
52 return caseMap(ustrcase_getCaseLocale(locale
.getBaseName()), 0,
53 UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToUpper
);