ICU 62.1 62.1
casemap.h
Go to the documentation of this file.
1// © 2017 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3
4// casemap.h
5// created: 2017jan12 Markus W. Scherer
6
7#ifndef __CASEMAP_H__
8#define __CASEMAP_H__
9
10#include "unicode/utypes.h"
11#include "unicode/stringpiece.h"
12#include "unicode/uobject.h"
13
20
21class BreakIterator;
22class ByteSink;
23class Edits;
24
30class U_COMMON_API CaseMap U_FINAL : public UMemory {
31public:
62 static int32_t toLower(
63 const char *locale, uint32_t options,
64 const char16_t *src, int32_t srcLength,
65 char16_t *dest, int32_t destCapacity, Edits *edits,
66 UErrorCode &errorCode);
67
98 static int32_t toUpper(
99 const char *locale, uint32_t options,
100 const char16_t *src, int32_t srcLength,
101 char16_t *dest, int32_t destCapacity, Edits *edits,
102 UErrorCode &errorCode);
103
104#if !UCONFIG_NO_BREAK_ITERATION
105
149 static int32_t toTitle(
150 const char *locale, uint32_t options, BreakIterator *iter,
151 const char16_t *src, int32_t srcLength,
152 char16_t *dest, int32_t destCapacity, Edits *edits,
153 UErrorCode &errorCode);
154
155#endif // UCONFIG_NO_BREAK_ITERATION
156
191 static int32_t fold(
192 uint32_t options,
193 const char16_t *src, int32_t srcLength,
194 char16_t *dest, int32_t destCapacity, Edits *edits,
195 UErrorCode &errorCode);
196
197#ifndef U_HIDE_DRAFT_API
219 static void utf8ToLower(
220 const char *locale, uint32_t options,
221 StringPiece src, ByteSink &sink, Edits *edits,
222 UErrorCode &errorCode);
223
245 static void utf8ToUpper(
246 const char *locale, uint32_t options,
247 StringPiece src, ByteSink &sink, Edits *edits,
248 UErrorCode &errorCode);
249
250#if !UCONFIG_NO_BREAK_ITERATION
251
285 static void utf8ToTitle(
286 const char *locale, uint32_t options, BreakIterator *iter,
287 StringPiece src, ByteSink &sink, Edits *edits,
288 UErrorCode &errorCode);
289
290#endif // UCONFIG_NO_BREAK_ITERATION
291
316 static void utf8Fold(
317 uint32_t options,
318 StringPiece src, ByteSink &sink, Edits *edits,
319 UErrorCode &errorCode);
320#endif // U_HIDE_DRAFT_API
321
352 static int32_t utf8ToLower(
353 const char *locale, uint32_t options,
354 const char *src, int32_t srcLength,
355 char *dest, int32_t destCapacity, Edits *edits,
356 UErrorCode &errorCode);
357
388 static int32_t utf8ToUpper(
389 const char *locale, uint32_t options,
390 const char *src, int32_t srcLength,
391 char *dest, int32_t destCapacity, Edits *edits,
392 UErrorCode &errorCode);
393
394#if !UCONFIG_NO_BREAK_ITERATION
395
438 static int32_t utf8ToTitle(
439 const char *locale, uint32_t options, BreakIterator *iter,
440 const char *src, int32_t srcLength,
441 char *dest, int32_t destCapacity, Edits *edits,
442 UErrorCode &errorCode);
443
444#endif // UCONFIG_NO_BREAK_ITERATION
445
480 static int32_t utf8Fold(
481 uint32_t options,
482 const char *src, int32_t srcLength,
483 char *dest, int32_t destCapacity, Edits *edits,
484 UErrorCode &errorCode);
485
486private:
487 CaseMap() = delete;
488 CaseMap(const CaseMap &other) = delete;
489 CaseMap &operator=(const CaseMap &other) = delete;
490};
491
493
494#endif // __CASEMAP_H__
The BreakIterator class implements methods for finding the location of boundaries in text.
Definition brkiter.h:102
A ByteSink can be filled with bytes.
Definition bytestream.h:50
Low-level C++ case mapping functions.
Definition casemap.h:30
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
static void utf8Fold(uint32_t options, StringPiece src, ByteSink &sink, Edits *edits, UErrorCode &errorCode)
Case-folds a UTF-8 string and optionally records edits.
Records lengths of string edits but not replacement text.
Definition edits.h:77
A string-like object that points to a sized piece of memory.
Definition stringpiece.h:54
UMemory is the common ICU base class.
Definition uobject.h:112
C++ API: StringPiece: Read-only byte string wrapper class.
C++ API: Common ICU base class UObject.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition utypes.h:396
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.
Definition utypes.h:359
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition uversion.h:138
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition uversion.h:137