]>
git.saurik.com Git - apple/icu.git/blob - icuSources/tools/genrb/ustr.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 *******************************************************************************
6 * Copyright (C) 1998-2012, International Business Machines
7 * Corporation and others. All Rights Reserved.
9 *******************************************************************************
13 * Modification History:
15 * Date Name Description
16 * 05/28/99 stephen Creation.
17 *******************************************************************************
23 #include "unicode/utypes.h"
25 #define U_APPEND_CHAR32(c,target,len) { \
28 *(target)++ = (UChar) c; \
33 target[0] = U16_LEAD(c); \
34 target[1] = U16_TRAIL(c); \
40 #define U_APPEND_CHAR32_ONLY(c,target) { \
43 *(target)++ = (UChar) c; \
47 target[0] = U16_LEAD(c); \
48 target[1] = U16_TRAIL(c); \
53 /* A C representation of a string "object" (to avoid realloc all the time) */
60 U_CFUNC
void ustr_init(struct UString
*s
);
63 ustr_initChars(struct UString
*s
, const char* source
, int32_t length
, UErrorCode
*status
);
65 U_CFUNC
void ustr_deinit(struct UString
*s
);
67 U_CFUNC
void ustr_setlen(struct UString
*s
, int32_t len
, UErrorCode
*status
);
69 U_CFUNC
void ustr_cpy(struct UString
*dst
, const struct UString
*src
,
72 U_CFUNC
void ustr_cat(struct UString
*dst
, const struct UString
*src
,
75 U_CFUNC
void ustr_ncat(struct UString
*dst
, const struct UString
*src
,
76 int32_t n
, UErrorCode
*status
);
78 U_CFUNC
void ustr_ucat(struct UString
*dst
, UChar c
, UErrorCode
*status
);
79 U_CFUNC
void ustr_u32cat(struct UString
*dst
, UChar32 c
, UErrorCode
*status
);
80 U_CFUNC
void ustr_uscat(struct UString
*dst
, const UChar
* src
,int len
,UErrorCode
*status
);