#include "unicode/utypes.h"
#include "unicode/brkiter.h"
#include "unicode/bytestream.h"
#include "unicode/casemap.h"
#include "unicode/edits.h"
#include "unicode/stringoptions.h"
#include "unicode/stringpiece.h"
#include "unicode/ubrk.h"
#include "unicode/uloc.h"
#include "unicode/ustring.h"
#include "unicode/ucasemap.h"
#if !UCONFIG_NO_BREAK_ITERATION
#include "unicode/utext.h"
#endif
#include "unicode/utf.h"
#include "unicode/utf8.h"
#include "unicode/utf16.h"
#include "bytesinkutil.h"
#include "cmemory.h"
#include "cstring.h"
#include "uassert.h"
#include "ucase.h"
#include "ucasemap_imp.h"
U_NAMESPACE_USE
UCaseMap::UCaseMap(const char *localeID, uint32_t opts, UErrorCode *pErrorCode) : … { … }
UCaseMap::~UCaseMap() { … }
U_CAPI UCaseMap * U_EXPORT2
ucasemap_open(const char *locale, uint32_t options, UErrorCode *pErrorCode) { … }
U_CAPI void U_EXPORT2
ucasemap_close(UCaseMap *csm) { … }
U_CAPI const char * U_EXPORT2
ucasemap_getLocale(const UCaseMap *csm) { … }
U_CAPI uint32_t U_EXPORT2
ucasemap_getOptions(const UCaseMap *csm) { … }
U_CAPI void U_EXPORT2
ucasemap_setLocale(UCaseMap *csm, const char *locale, UErrorCode *pErrorCode) { … }
U_CAPI void U_EXPORT2
ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode) { … }
namespace {
inline UBool
appendResult(int32_t cpLength, int32_t result, const char16_t *s,
ByteSink &sink, uint32_t options, icu::Edits *edits, UErrorCode &errorCode) { … }
inline uint8_t getTwoByteLead(UChar32 c) { … }
inline uint8_t getTwoByteTrail(UChar32 c) { … }
UChar32 U_CALLCONV
utf8_caseContextIterator(void *context, int8_t dir) { … }
void toLower(int32_t caseLocale, uint32_t options,
const uint8_t *src, UCaseContext *csc, int32_t srcStart, int32_t srcLimit,
icu::ByteSink &sink, icu::Edits *edits, UErrorCode &errorCode) { … }
void toUpper(int32_t caseLocale, uint32_t options,
const uint8_t *src, UCaseContext *csc, int32_t srcLength,
icu::ByteSink &sink, icu::Edits *edits, UErrorCode &errorCode) { … }
}
#if !UCONFIG_NO_BREAK_ITERATION
namespace {
constexpr uint8_t ACUTE_BYTE0 = …;
constexpr uint8_t ACUTE_BYTE1 = …;
int32_t maybeTitleDutchIJ(const uint8_t *src, UChar32 c, int32_t start, int32_t segmentLimit,
ByteSink &sink, uint32_t options, icu::Edits *edits, UErrorCode &errorCode) { … }
}
U_CFUNC void U_CALLCONV
ucasemap_internalUTF8ToTitle(
int32_t caseLocale, uint32_t options, BreakIterator *iter,
const uint8_t *src, int32_t srcLength,
ByteSink &sink, icu::Edits *edits,
UErrorCode &errorCode) { … }
#endif
U_NAMESPACE_BEGIN
namespace GreekUpper {
UBool isFollowedByCasedLetter(const uint8_t *s, int32_t i, int32_t length) { … }
void toUpper(uint32_t options,
const uint8_t *src, int32_t srcLength,
ByteSink &sink, Edits *edits,
UErrorCode &errorCode) { … }
}
U_NAMESPACE_END
static void U_CALLCONV
ucasemap_internalUTF8ToLower(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_UNUSED
const uint8_t *src, int32_t srcLength,
icu::ByteSink &sink, icu::Edits *edits,
UErrorCode &errorCode) { … }
static void U_CALLCONV
ucasemap_internalUTF8ToUpper(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_UNUSED
const uint8_t *src, int32_t srcLength,
icu::ByteSink &sink, icu::Edits *edits,
UErrorCode &errorCode) { … }
static void U_CALLCONV
ucasemap_internalUTF8Fold(int32_t , uint32_t options, UCASEMAP_BREAK_ITERATOR_UNUSED
const uint8_t *src, int32_t srcLength,
icu::ByteSink &sink, icu::Edits *edits,
UErrorCode &errorCode) { … }
void
ucasemap_mapUTF8(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM
const char *src, int32_t srcLength,
UTF8CaseMapper *stringCaseMapper,
icu::ByteSink &sink, icu::Edits *edits,
UErrorCode &errorCode) { … }
int32_t
ucasemap_mapUTF8(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM
char *dest, int32_t destCapacity,
const char *src, int32_t srcLength,
UTF8CaseMapper *stringCaseMapper,
icu::Edits *edits,
UErrorCode &errorCode) { … }
U_CAPI int32_t U_EXPORT2
ucasemap_utf8ToLower(const UCaseMap *csm,
char *dest, int32_t destCapacity,
const char *src, int32_t srcLength,
UErrorCode *pErrorCode) { … }
U_CAPI int32_t U_EXPORT2
ucasemap_utf8ToUpper(const UCaseMap *csm,
char *dest, int32_t destCapacity,
const char *src, int32_t srcLength,
UErrorCode *pErrorCode) { … }
U_CAPI int32_t U_EXPORT2
ucasemap_utf8FoldCase(const UCaseMap *csm,
char *dest, int32_t destCapacity,
const char *src, int32_t srcLength,
UErrorCode *pErrorCode) { … }
U_NAMESPACE_BEGIN
void CaseMap::utf8ToLower(
const char *locale, uint32_t options,
StringPiece src, ByteSink &sink, Edits *edits,
UErrorCode &errorCode) { … }
void CaseMap::utf8ToUpper(
const char *locale, uint32_t options,
StringPiece src, ByteSink &sink, Edits *edits,
UErrorCode &errorCode) { … }
void CaseMap::utf8Fold(
uint32_t options,
StringPiece src, ByteSink &sink, Edits *edits,
UErrorCode &errorCode) { … }
int32_t CaseMap::utf8ToLower(
const char *locale, uint32_t options,
const char *src, int32_t srcLength,
char *dest, int32_t destCapacity, Edits *edits,
UErrorCode &errorCode) { … }
int32_t CaseMap::utf8ToUpper(
const char *locale, uint32_t options,
const char *src, int32_t srcLength,
char *dest, int32_t destCapacity, Edits *edits,
UErrorCode &errorCode) { … }
int32_t CaseMap::utf8Fold(
uint32_t options,
const char *src, int32_t srcLength,
char *dest, int32_t destCapacity, Edits *edits,
UErrorCode &errorCode) { … }
U_NAMESPACE_END