00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef USTRING_H
00017 #define USTRING_H
00018 #include "unicode/utypes.h"
00019
00021 #ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
00022 # define UBRK_TYPEDEF_UBREAK_ITERATOR
00023 typedef void *UBreakIterator;
00024 #endif
00025
00070 U_CAPI int32_t U_EXPORT2
00071 u_strlen(const UChar *s);
00072
00086 U_CAPI int32_t U_EXPORT2
00087 u_countChar32(const UChar *s, int32_t length);
00088
00099 U_CAPI UChar* U_EXPORT2
00100 u_strcat(UChar *dst,
00101 const UChar *src);
00102
00114 U_CAPI UChar* U_EXPORT2
00115 u_strncat(UChar *dst,
00116 const UChar *src,
00117 int32_t n);
00118
00128 U_CAPI UChar* U_EXPORT2
00129 u_strchr(const UChar *s,
00130 UChar c);
00131
00142 U_CAPI UChar * U_EXPORT2
00143 u_strstr(const UChar *s, const UChar *substring);
00144
00169 U_CAPI UChar * U_EXPORT2
00170 u_strchr32(const UChar *s, UChar32 c);
00171
00181 U_CAPI UChar * U_EXPORT2
00182 u_strpbrk(const UChar *string, const UChar *matchSet);
00183
00192 U_CAPI int32_t U_EXPORT2
00193 u_strcspn(const UChar *string, const UChar *matchSet);
00194
00203 U_CAPI int32_t U_EXPORT2
00204 u_strspn(const UChar *string, const UChar *matchSet);
00205
00231 U_CAPI UChar * U_EXPORT2
00232 u_strtok_r(UChar *src,
00233 const UChar *delim,
00234 UChar **saveState);
00235
00246 U_CAPI int32_t U_EXPORT2
00247 u_strcmp(const UChar *s1,
00248 const UChar *s2);
00249
00261 U_CAPI int32_t U_EXPORT2
00262 u_strcmpCodePointOrder(const UChar *s1, const UChar *s2);
00263
00291 U_CAPI int32_t U_EXPORT2
00292 u_strCompare(const UChar *s1, int32_t length1,
00293 const UChar *s2, int32_t length2,
00294 UBool codePointOrder);
00295
00296 #ifndef U_COMPARE_CODE_POINT_ORDER
00297
00303 #define U_COMPARE_CODE_POINT_ORDER 0x8000
00304 #endif
00305
00343 U_CAPI int32_t U_EXPORT2
00344 u_strCaseCompare(const UChar *s1, int32_t length1,
00345 const UChar *s2, int32_t length2,
00346 uint32_t options,
00347 UErrorCode *pErrorCode);
00348
00361 U_CAPI int32_t U_EXPORT2
00362 u_strncmp(const UChar *ucs1,
00363 const UChar *ucs2,
00364 int32_t n);
00365
00379 U_CAPI int32_t U_EXPORT2
00380 u_strncmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t n);
00381
00401 U_CAPI int32_t U_EXPORT2
00402 u_strcasecmp(const UChar *s1, const UChar *s2, uint32_t options);
00403
00425 U_CAPI int32_t U_EXPORT2
00426 u_strncasecmp(const UChar *s1, const UChar *s2, int32_t n, uint32_t options);
00427
00449 U_CAPI int32_t U_EXPORT2
00450 u_memcasecmp(const UChar *s1, const UChar *s2, int32_t length, uint32_t options);
00451
00460 U_CAPI UChar* U_EXPORT2
00461 u_strcpy(UChar *dst,
00462 const UChar *src);
00463
00475 U_CAPI UChar* U_EXPORT2
00476 u_strncpy(UChar *dst,
00477 const UChar *src,
00478 int32_t n);
00479
00490 U_CAPI UChar* U_EXPORT2 u_uastrcpy(UChar *dst,
00491 const char *src );
00492
00505 U_CAPI UChar* U_EXPORT2 u_uastrncpy(UChar *dst,
00506 const char *src,
00507 int32_t n);
00508
00519 U_CAPI char* U_EXPORT2 u_austrcpy(char *dst,
00520 const UChar *src );
00521
00534 U_CAPI char* U_EXPORT2 u_austrncpy(char *dst,
00535 const UChar *src,
00536 int32_t n );
00537
00546 U_CAPI UChar* U_EXPORT2
00547 u_memcpy(UChar *dest, const UChar *src, int32_t count);
00548
00557 U_CAPI UChar* U_EXPORT2
00558 u_memmove(UChar *dest, const UChar *src, int32_t count);
00559
00569 U_CAPI UChar* U_EXPORT2
00570 u_memset(UChar *dest, UChar c, int32_t count);
00571
00583 U_CAPI int32_t U_EXPORT2
00584 u_memcmp(const UChar *buf1, const UChar *buf2, int32_t count);
00585
00599 U_CAPI int32_t U_EXPORT2
00600 u_memcmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t count);
00601
00614 U_CAPI UChar* U_EXPORT2
00615 u_memchr(const UChar *src, UChar ch, int32_t count);
00616
00641 U_CAPI UChar* U_EXPORT2
00642 u_memchr32(const UChar *src, UChar32 ch, int32_t count);
00643
00680 #if U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && U_CHARSET_FAMILY==U_ASCII_FAMILY
00681 # define U_STRING_DECL(var, cs, length) static const wchar_t var[(length)+1]={ L ## cs }
00682 # define U_STRING_INIT(var, cs, length)
00683 #elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
00684 # define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]={ (const UChar *)cs }
00685 # define U_STRING_INIT(var, cs, length)
00686 #else
00687 # define U_STRING_DECL(var, cs, length) static UChar var[(length)+1]
00688 # define U_STRING_INIT(var, cs, length) u_charsToUChars(cs, var, length+1)
00689 #endif
00690
00737 U_CAPI int32_t U_EXPORT2
00738 u_unescape(const char *src,
00739 UChar *dest, int32_t destCapacity);
00740
00753 U_CDECL_BEGIN
00754 typedef UChar (U_CALLCONV *UNESCAPE_CHAR_AT)(int32_t offset, void *context);
00755 U_CDECL_END
00756
00785 U_CAPI UChar32 U_EXPORT2
00786 u_unescapeAt(UNESCAPE_CHAR_AT charAt,
00787 int32_t *offset,
00788 int32_t length,
00789 void *context);
00790
00811 U_CAPI int32_t U_EXPORT2
00812 u_strToUpper(UChar *dest, int32_t destCapacity,
00813 const UChar *src, int32_t srcLength,
00814 const char *locale,
00815 UErrorCode *pErrorCode);
00816
00837 U_CAPI int32_t U_EXPORT2
00838 u_strToLower(UChar *dest, int32_t destCapacity,
00839 const UChar *src, int32_t srcLength,
00840 const char *locale,
00841 UErrorCode *pErrorCode);
00842
00881 U_CAPI int32_t U_EXPORT2
00882 u_strToTitle(UChar *dest, int32_t destCapacity,
00883 const UChar *src, int32_t srcLength,
00884 UBreakIterator *titleIter,
00885 const char *locale,
00886 UErrorCode *pErrorCode);
00887
00910 U_CAPI int32_t U_EXPORT2
00911 u_strFoldCase(UChar *dest, int32_t destCapacity,
00912 const UChar *src, int32_t srcLength,
00913 uint32_t options,
00914 UErrorCode *pErrorCode);
00915
00935 U_CAPI wchar_t* U_EXPORT2
00936 u_strToWCS(wchar_t *dest,
00937 int32_t destCapacity,
00938 int32_t *pDestLength,
00939 const UChar *src,
00940 int32_t srcLength,
00941 UErrorCode *pErrorCode);
00961 U_CAPI UChar* U_EXPORT2
00962 u_strFromWCS(UChar *dest,
00963 int32_t destCapacity,
00964 int32_t *pDestLength,
00965 const wchar_t *src,
00966 int32_t srcLength,
00967 UErrorCode *pErrorCode);
00987 U_CAPI char* U_EXPORT2
00988 u_strToUTF8(char *dest,
00989 int32_t destCapacity,
00990 int32_t *pDestLength,
00991 const UChar *src,
00992 int32_t srcLength,
00993 UErrorCode *pErrorCode);
00994
01014 U_CAPI UChar* U_EXPORT2
01015 u_strFromUTF8(UChar *dest,
01016 int32_t destCapacity,
01017 int32_t *pDestLength,
01018 const char *src,
01019 int32_t srcLength,
01020 UErrorCode *pErrorCode);
01021
01041 U_CAPI UChar32* U_EXPORT2
01042 u_strToUTF32(UChar32 *dest,
01043 int32_t destCapacity,
01044 int32_t *pDestLength,
01045 const UChar *src,
01046 int32_t srcLength,
01047 UErrorCode *pErrorCode);
01048
01068 U_CAPI UChar* U_EXPORT2
01069 u_strFromUTF32(UChar *dest,
01070 int32_t destCapacity,
01071 int32_t *pDestLength,
01072 const UChar32 *src,
01073 int32_t srcLength,
01074 UErrorCode *pErrorCode);
01075
01076 #endif