ICU 60.2  60.2
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 #ifndef U_HIDE_DRAFT_API
22 
23 class BreakIterator;
24 class ByteSink;
25 class Edits;
26 
32 class U_COMMON_API CaseMap U_FINAL : public UMemory {
33 public:
64  static int32_t toLower(
65  const char *locale, uint32_t options,
66  const char16_t *src, int32_t srcLength,
67  char16_t *dest, int32_t destCapacity, Edits *edits,
68  UErrorCode &errorCode);
69 
100  static int32_t toUpper(
101  const char *locale, uint32_t options,
102  const char16_t *src, int32_t srcLength,
103  char16_t *dest, int32_t destCapacity, Edits *edits,
104  UErrorCode &errorCode);
105 
106 #if !UCONFIG_NO_BREAK_ITERATION
107 
151  static int32_t toTitle(
152  const char *locale, uint32_t options, BreakIterator *iter,
153  const char16_t *src, int32_t srcLength,
154  char16_t *dest, int32_t destCapacity, Edits *edits,
155  UErrorCode &errorCode);
156 
157 #endif // UCONFIG_NO_BREAK_ITERATION
158 
193  static int32_t fold(
194  uint32_t options,
195  const char16_t *src, int32_t srcLength,
196  char16_t *dest, int32_t destCapacity, Edits *edits,
197  UErrorCode &errorCode);
198 
220  static void utf8ToLower(
221  const char *locale, uint32_t options,
222  StringPiece src, ByteSink &sink, Edits *edits,
223  UErrorCode &errorCode);
224 
246  static void utf8ToUpper(
247  const char *locale, uint32_t options,
248  StringPiece src, ByteSink &sink, Edits *edits,
249  UErrorCode &errorCode);
250 
251 #if !UCONFIG_NO_BREAK_ITERATION
252 
286  static void utf8ToTitle(
287  const char *locale, uint32_t options, BreakIterator *iter,
288  StringPiece src, ByteSink &sink, Edits *edits,
289  UErrorCode &errorCode);
290 
291 #endif // UCONFIG_NO_BREAK_ITERATION
292 
317  static void utf8Fold(
318  uint32_t options,
319  StringPiece src, ByteSink &sink, Edits *edits,
320  UErrorCode &errorCode);
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 
486 private:
487  CaseMap() = delete;
488  CaseMap(const CaseMap &other) = delete;
489  CaseMap &operator=(const CaseMap &other) = delete;
490 };
491 
492 #endif // U_HIDE_DRAFT_API
493 
495 
496 #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:32
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:131
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:132
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:396
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:359
Low-level C++ case mapping functions.
Definition: casemap.h:32
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