]>
Commit | Line | Data |
---|---|---|
f3c0d7a5 A |
1 | // © 2016 and later: Unicode, Inc. and others. |
2 | // License & terms of use: http://www.unicode.org/copyright.html | |
4388f060 A |
3 | /* |
4 | ******************************************************************************* | |
5 | * Copyright (C) 2011, International Business Machines | |
6 | * Corporation and others. All Rights Reserved. | |
7 | ******************************************************************************* | |
8 | * file name: unistr_case_locale.cpp | |
f3c0d7a5 | 9 | * encoding: UTF-8 |
4388f060 A |
10 | * tab size: 8 (not used) |
11 | * indentation:4 | |
12 | * | |
13 | * created on: 2011may31 | |
14 | * created by: Markus W. Scherer | |
15 | * | |
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. | |
18 | */ | |
19 | ||
20 | #include "unicode/utypes.h" | |
21 | #include "unicode/locid.h" | |
f3c0d7a5 | 22 | #include "unicode/ucasemap.h" |
4388f060 | 23 | #include "unicode/unistr.h" |
f3c0d7a5 | 24 | #include "ucasemap_imp.h" |
4388f060 A |
25 | |
26 | U_NAMESPACE_BEGIN | |
27 | ||
28 | //======================================== | |
29 | // Write implementation | |
30 | //======================================== | |
31 | ||
4388f060 A |
32 | UnicodeString & |
33 | UnicodeString::toLower() { | |
f3c0d7a5 A |
34 | return caseMap(ustrcase_getCaseLocale(NULL), 0, |
35 | UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToLower); | |
4388f060 A |
36 | } |
37 | ||
38 | UnicodeString & | |
39 | UnicodeString::toLower(const Locale &locale) { | |
f3c0d7a5 A |
40 | return caseMap(ustrcase_getCaseLocale(locale.getBaseName()), 0, |
41 | UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToLower); | |
4388f060 A |
42 | } |
43 | ||
44 | UnicodeString & | |
45 | UnicodeString::toUpper() { | |
f3c0d7a5 A |
46 | return caseMap(ustrcase_getCaseLocale(NULL), 0, |
47 | UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToUpper); | |
4388f060 A |
48 | } |
49 | ||
50 | UnicodeString & | |
51 | UnicodeString::toUpper(const Locale &locale) { | |
f3c0d7a5 A |
52 | return caseMap(ustrcase_getCaseLocale(locale.getBaseName()), 0, |
53 | UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToUpper); | |
4388f060 A |
54 | } |
55 | ||
56 | U_NAMESPACE_END |