casemap.h
Go to the documentation of this file.
// © 2017 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
// casemap.h
// created: 2017jan12 Markus W. Scherer
#ifndef __CASEMAP_H__
#define __CASEMAP_H__
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
#include "unicode/stringpiece.h"
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
class BreakIterator;
class ByteSink;
class Edits;
class U_COMMON_API CaseMap final : public UMemory {
public:
static int32_t toLower(
const char *locale, uint32_t options,
const char16_t *src, int32_t srcLength,
char16_t *dest, int32_t destCapacity, Edits *edits,
UErrorCode &errorCode);
static int32_t toUpper(
const char *locale, uint32_t options,
const char16_t *src, int32_t srcLength,
char16_t *dest, int32_t destCapacity, Edits *edits,
UErrorCode &errorCode);
#if !UCONFIG_NO_BREAK_ITERATION
static int32_t toTitle(
const char *locale, uint32_t options, BreakIterator *iter,
const char16_t *src, int32_t srcLength,
char16_t *dest, int32_t destCapacity, Edits *edits,
UErrorCode &errorCode);
#endif // UCONFIG_NO_BREAK_ITERATION
static int32_t fold(
uint32_t options,
const char16_t *src, int32_t srcLength,
char16_t *dest, int32_t destCapacity, Edits *edits,
UErrorCode &errorCode);
static void utf8ToLower(
const char *locale, uint32_t options,
StringPiece src, ByteSink &sink, Edits *edits,
UErrorCode &errorCode);
static void utf8ToUpper(
const char *locale, uint32_t options,
StringPiece src, ByteSink &sink, Edits *edits,
UErrorCode &errorCode);
#if !UCONFIG_NO_BREAK_ITERATION
static void utf8ToTitle(
const char *locale, uint32_t options, BreakIterator *iter,
StringPiece src, ByteSink &sink, Edits *edits,
UErrorCode &errorCode);
#endif // UCONFIG_NO_BREAK_ITERATION
static void utf8Fold(
uint32_t options,
StringPiece src, ByteSink &sink, Edits *edits,
UErrorCode &errorCode);
static int32_t utf8ToLower(
const char *locale, uint32_t options,
const char *src, int32_t srcLength,
char *dest, int32_t destCapacity, Edits *edits,
UErrorCode &errorCode);
static int32_t utf8ToUpper(
const char *locale, uint32_t options,
const char *src, int32_t srcLength,
char *dest, int32_t destCapacity, Edits *edits,
UErrorCode &errorCode);
#if !UCONFIG_NO_BREAK_ITERATION
static int32_t utf8ToTitle(
const char *locale, uint32_t options, BreakIterator *iter,
const char *src, int32_t srcLength,
char *dest, int32_t destCapacity, Edits *edits,
UErrorCode &errorCode);
#endif // UCONFIG_NO_BREAK_ITERATION
static int32_t utf8Fold(
uint32_t options,
const char *src, int32_t srcLength,
char *dest, int32_t destCapacity, Edits *edits,
UErrorCode &errorCode);
private:
CaseMap() = delete;
CaseMap(const CaseMap &other) = delete;
CaseMap &operator=(const CaseMap &other) = delete;
};
U_NAMESPACE_END
#endif /* U_SHOW_CPLUSPLUS_API */
#endif // __CASEMAP_H__
icu::BreakIterator
The BreakIterator class implements methods for finding the location of boundaries in text.
Definition: brkiter.h:106
icu::ByteSink
A ByteSink can be filled with bytes.
Definition: bytestream.h:53
icu::CaseMap
Low-level C++ case mapping functions.
Definition: casemap.h:33
icu::CaseMap::utf8Fold
static int32_t utf8Fold(uint32_t options, const char *src, int32_t srcLength, char *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
Case-folds a UTF-8 string and optionally records edits.
icu::CaseMap::toTitle
static int32_t toTitle(const char *locale, uint32_t options, BreakIterator *iter, const char16_t *src, int32_t srcLength, char16_t *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
Titlecases a UTF-16 string and optionally records edits.
icu::CaseMap::toLower
static int32_t toLower(const char *locale, uint32_t options, const char16_t *src, int32_t srcLength, char16_t *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
Lowercases a UTF-16 string and optionally records edits.
icu::CaseMap::utf8ToUpper
static void utf8ToUpper(const char *locale, uint32_t options, StringPiece src, ByteSink &sink, Edits *edits, UErrorCode &errorCode)
Uppercases a UTF-8 string and optionally records edits.
icu::CaseMap::utf8ToTitle
static int32_t utf8ToTitle(const char *locale, uint32_t options, BreakIterator *iter, const char *src, int32_t srcLength, char *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
Titlecases a UTF-8 string and optionally records edits.
icu::CaseMap::utf8ToTitle
static void utf8ToTitle(const char *locale, uint32_t options, BreakIterator *iter, StringPiece src, ByteSink &sink, Edits *edits, UErrorCode &errorCode)
Titlecases a UTF-8 string and optionally records edits.
icu::CaseMap::fold
static int32_t fold(uint32_t options, const char16_t *src, int32_t srcLength, char16_t *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
Case-folds a UTF-16 string and optionally records edits.
icu::CaseMap::utf8ToLower
static int32_t utf8ToLower(const char *locale, uint32_t options, const char *src, int32_t srcLength, char *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
Lowercases a UTF-8 string and optionally records edits.
icu::CaseMap::utf8ToUpper
static int32_t utf8ToUpper(const char *locale, uint32_t options, const char *src, int32_t srcLength, char *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
Uppercases a UTF-8 string and optionally records edits.
icu::CaseMap::utf8ToLower
static void utf8ToLower(const char *locale, uint32_t options, StringPiece src, ByteSink &sink, Edits *edits, UErrorCode &errorCode)
Lowercases a UTF-8 string and optionally records edits.
icu::CaseMap::toUpper
static int32_t toUpper(const char *locale, uint32_t options, const char16_t *src, int32_t srcLength, char16_t *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
Uppercases a UTF-16 string and optionally records edits.
icu::CaseMap::utf8Fold
static void utf8Fold(uint32_t options, StringPiece src, ByteSink &sink, Edits *edits, UErrorCode &errorCode)
Case-folds a UTF-8 string and optionally records edits.
icu::Edits
Records lengths of string edits but not replacement text.
Definition: edits.h:80
icu::StringPiece
A string-like object that points to a sized piece of memory.
Definition: stringpiece.h:61
icu::UMemory
UMemory is the common ICU base class.
Definition: uobject.h:115
stringpiece.h
C++ API: StringPiece: Read-only byte string wrapper class.
uobject.h
C++ API: Common ICU base class UObject.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:430
U_COMMON_API
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.
Definition: utypes.h:315