ICU 63.1  63.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 
21 class BreakIterator;
22 class ByteSink;
23 class Edits;
24 
31 public:
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 
218  static void utf8ToLower(
219  const char *locale, uint32_t options,
220  StringPiece src, ByteSink &sink, Edits *edits,
221  UErrorCode &errorCode);
222 
244  static void utf8ToUpper(
245  const char *locale, uint32_t options,
246  StringPiece src, ByteSink &sink, Edits *edits,
247  UErrorCode &errorCode);
248 
249 #if !UCONFIG_NO_BREAK_ITERATION
250 
284  static void utf8ToTitle(
285  const char *locale, uint32_t options, BreakIterator *iter,
286  StringPiece src, ByteSink &sink, Edits *edits,
287  UErrorCode &errorCode);
288 
289 #endif // UCONFIG_NO_BREAK_ITERATION
290 
315  static void utf8Fold(
316  uint32_t options,
317  StringPiece src, ByteSink &sink, Edits *edits,
318  UErrorCode &errorCode);
319 
350  static int32_t utf8ToLower(
351  const char *locale, uint32_t options,
352  const char *src, int32_t srcLength,
353  char *dest, int32_t destCapacity, Edits *edits,
354  UErrorCode &errorCode);
355 
386  static int32_t utf8ToUpper(
387  const char *locale, uint32_t options,
388  const char *src, int32_t srcLength,
389  char *dest, int32_t destCapacity, Edits *edits,
390  UErrorCode &errorCode);
391 
392 #if !UCONFIG_NO_BREAK_ITERATION
393 
436  static int32_t utf8ToTitle(
437  const char *locale, uint32_t options, BreakIterator *iter,
438  const char *src, int32_t srcLength,
439  char *dest, int32_t destCapacity, Edits *edits,
440  UErrorCode &errorCode);
441 
442 #endif // UCONFIG_NO_BREAK_ITERATION
443 
478  static int32_t utf8Fold(
479  uint32_t options,
480  const char *src, int32_t srcLength,
481  char *dest, int32_t destCapacity, Edits *edits,
482  UErrorCode &errorCode);
483 
484 private:
485  CaseMap() = delete;
486  CaseMap(const CaseMap &other) = delete;
487  CaseMap &operator=(const CaseMap &other) = delete;
488 };
489 
491 
492 #endif // __CASEMAP_H__
A ByteSink can be filled with bytes.
Definition: bytestream.h:50
Records lengths of string edits but not replacement text.
Definition: edits.h:77
C++ API: StringPiece: Read-only byte string wrapper class.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:137
The BreakIterator class implements methods for finding the location of boundaries in text...
Definition: brkiter.h:102
C++ API: Common ICU base class UObject.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:138
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:401
#define U_FINAL
Defined to the C++11 "final" keyword if available.
Definition: umachine.h:140
Basic definitions for ICU, for both C and C++ APIs.
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside...
Definition: utypes.h:300
Low-level C++ case mapping functions.
Definition: casemap.h:30
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:109