2017-01-20 00:20:31 +00:00
|
|
|
// © 2016 and later: Unicode, Inc. and others.
|
2016-06-15 18:58:17 +00:00
|
|
|
// License & terms of use: http://www.unicode.org/copyright.html
|
2011-06-03 05:23:57 +00:00
|
|
|
/*
|
|
|
|
*******************************************************************************
|
2016-05-31 21:45:07 +00:00
|
|
|
* Copyright (C) 2011, International Business Machines
|
|
|
|
* Corporation and others. All Rights Reserved.
|
2011-06-03 05:23:57 +00:00
|
|
|
*******************************************************************************
|
|
|
|
* file name: unistr_case_locale.cpp
|
2017-02-03 18:57:23 +00:00
|
|
|
* encoding: UTF-8
|
2011-06-03 05:23:57 +00:00
|
|
|
* tab size: 8 (not used)
|
|
|
|
* indentation:4
|
|
|
|
*
|
|
|
|
* created on: 2011may31
|
|
|
|
* created by: Markus W. Scherer
|
|
|
|
*
|
|
|
|
* Locale-sensitive case mapping functions (ones that call uloc_getDefault())
|
|
|
|
* were moved here to break dependency cycles among parts of the common library.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
|
|
|
#include "unicode/locid.h"
|
2017-01-12 19:05:01 +00:00
|
|
|
#include "unicode/ucasemap.h"
|
2011-06-03 05:23:57 +00:00
|
|
|
#include "unicode/unistr.h"
|
2017-02-09 21:15:34 +00:00
|
|
|
#include "ucasemap_imp.h"
|
2011-06-03 05:23:57 +00:00
|
|
|
|
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
//========================================
|
|
|
|
// Write implementation
|
|
|
|
//========================================
|
|
|
|
|
|
|
|
UnicodeString &
|
|
|
|
UnicodeString::toLower() {
|
2017-01-20 04:04:58 +00:00
|
|
|
return caseMap(ustrcase_getCaseLocale(NULL), 0,
|
|
|
|
UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToLower);
|
2011-06-03 05:23:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UnicodeString &
|
|
|
|
UnicodeString::toLower(const Locale &locale) {
|
2017-01-20 04:04:58 +00:00
|
|
|
return caseMap(ustrcase_getCaseLocale(locale.getBaseName()), 0,
|
|
|
|
UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToLower);
|
2011-06-03 05:23:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UnicodeString &
|
|
|
|
UnicodeString::toUpper() {
|
2017-01-20 04:04:58 +00:00
|
|
|
return caseMap(ustrcase_getCaseLocale(NULL), 0,
|
|
|
|
UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToUpper);
|
2011-06-03 05:23:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UnicodeString &
|
|
|
|
UnicodeString::toUpper(const Locale &locale) {
|
2017-01-20 04:04:58 +00:00
|
|
|
return caseMap(ustrcase_getCaseLocale(locale.getBaseName()), 0,
|
|
|
|
UCASEMAP_BREAK_ITERATOR_NULL ustrcase_internalToUpper);
|
2011-06-03 05:23:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
U_NAMESPACE_END
|