ICU 65.1  65.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 
12 #if U_SHOW_CPLUSPLUS_API
13 
14 #include "unicode/stringpiece.h"
15 #include "unicode/uobject.h"
16 
22 U_NAMESPACE_BEGIN
23 
24 class BreakIterator;
25 class ByteSink;
26 class Edits;
27 
34 public:
65  static int32_t toLower(
66  const char *locale, uint32_t options,
67  const char16_t *src, int32_t srcLength,
68  char16_t *dest, int32_t destCapacity, Edits *edits,
69  UErrorCode &errorCode);
70 
101  static int32_t toUpper(
102  const char *locale, uint32_t options,
103  const char16_t *src, int32_t srcLength,
104  char16_t *dest, int32_t destCapacity, Edits *edits,
105  UErrorCode &errorCode);
106 
107 #if !UCONFIG_NO_BREAK_ITERATION
108 
152  static int32_t toTitle(
153  const char *locale, uint32_t options, BreakIterator *iter,
154  const char16_t *src, int32_t srcLength,
155  char16_t *dest, int32_t destCapacity, Edits *edits,
156  UErrorCode &errorCode);
157 
158 #endif // UCONFIG_NO_BREAK_ITERATION
159 
194  static int32_t fold(
195  uint32_t options,
196  const char16_t *src, int32_t srcLength,
197  char16_t *dest, int32_t destCapacity, Edits *edits,
198  UErrorCode &errorCode);
199 
221  static void utf8ToLower(
222  const char *locale, uint32_t options,
223  StringPiece src, ByteSink &sink, Edits *edits,
224  UErrorCode &errorCode);
225 
247  static void utf8ToUpper(
248  const char *locale, uint32_t options,
249  StringPiece src, ByteSink &sink, Edits *edits,
250  UErrorCode &errorCode);
251 
252 #if !UCONFIG_NO_BREAK_ITERATION
253 
287  static void utf8ToTitle(
288  const char *locale, uint32_t options, BreakIterator *iter,
289  StringPiece src, ByteSink &sink, Edits *edits,
290  UErrorCode &errorCode);
291 
292 #endif // UCONFIG_NO_BREAK_ITERATION
293 
318  static void utf8Fold(
319  uint32_t options,
320  StringPiece src, ByteSink &sink, Edits *edits,
321  UErrorCode &errorCode);
322 
353  static int32_t utf8ToLower(
354  const char *locale, uint32_t options,
355  const char *src, int32_t srcLength,
356  char *dest, int32_t destCapacity, Edits *edits,
357  UErrorCode &errorCode);
358 
389  static int32_t utf8ToUpper(
390  const char *locale, uint32_t options,
391  const char *src, int32_t srcLength,
392  char *dest, int32_t destCapacity, Edits *edits,
393  UErrorCode &errorCode);
394 
395 #if !UCONFIG_NO_BREAK_ITERATION
396 
439  static int32_t utf8ToTitle(
440  const char *locale, uint32_t options, BreakIterator *iter,
441  const char *src, int32_t srcLength,
442  char *dest, int32_t destCapacity, Edits *edits,
443  UErrorCode &errorCode);
444 
445 #endif // UCONFIG_NO_BREAK_ITERATION
446 
481  static int32_t utf8Fold(
482  uint32_t options,
483  const char *src, int32_t srcLength,
484  char *dest, int32_t destCapacity, Edits *edits,
485  UErrorCode &errorCode);
486 
487 private:
488  CaseMap() = delete;
489  CaseMap(const CaseMap &other) = delete;
490  CaseMap &operator=(const CaseMap &other) = delete;
491 };
492 
493 U_NAMESPACE_END
494 
495 #endif /* U_SHOW_CPLUSPLUS_API */
496 
497 #endif // __CASEMAP_H__
A ByteSink can be filled with bytes.
Definition: bytestream.h:53
Records lengths of string edits but not replacement text.
Definition: edits.h:80
C++ API: StringPiece: Read-only byte string wrapper class.
The BreakIterator class implements methods for finding the location of boundaries in text...
Definition: brkiter.h:106
C++ API: Common ICU base class UObject.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
#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:33
A string-like object that points to a sized piece of memory.
Definition: stringpiece.h:60
UMemory is the common ICU base class.
Definition: uobject.h:115