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
00141 U_CAPI UChar * U_EXPORT2
00142 u_strstr(const UChar *s, const UChar *substring);
00143
00168 U_CAPI UChar * U_EXPORT2
00169 u_strchr32(const UChar *s, UChar32 c);
00170
00180 U_CAPI UChar * U_EXPORT2
00181 u_strpbrk(const UChar *string, const UChar *matchSet);
00182
00191 U_CAPI int32_t U_EXPORT2
00192 u_strcspn(const UChar *string, const UChar *matchSet);
00193
00202 U_CAPI int32_t U_EXPORT2
00203 u_strspn(const UChar *string, const UChar *matchSet);
00204
00227 U_CAPI UChar * U_EXPORT2
00228 u_strtok_r(UChar *src,
00229 const UChar *delim,
00230 UChar **saveState);
00231
00242 U_CAPI int32_t U_EXPORT2
00243 u_strcmp(const UChar *s1,
00244 const UChar *s2);
00245
00263 U_CAPI int32_t U_EXPORT2
00264 u_strcmpCodePointOrder(const UChar *s1, const UChar *s2);
00265
00278 U_CAPI int32_t U_EXPORT2
00279 u_strncmp(const UChar *ucs1,
00280 const UChar *ucs2,
00281 int32_t n);
00282
00296 U_CAPI int32_t U_EXPORT2
00297 u_strncmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t n);
00298
00309 U_CAPI int32_t U_EXPORT2
00310 u_strcasecmp(const UChar *s1, const UChar *s2, uint32_t options);
00311
00324 U_CAPI int32_t U_EXPORT2
00325 u_strncasecmp(const UChar *s1, const UChar *s2, int32_t n, uint32_t options);
00326
00339 U_CAPI int32_t U_EXPORT2
00340 u_memcasecmp(const UChar *s1, const UChar *s2, int32_t length, uint32_t options);
00341
00350 U_CAPI UChar* U_EXPORT2
00351 u_strcpy(UChar *dst,
00352 const UChar *src);
00353
00365 U_CAPI UChar* U_EXPORT2
00366 u_strncpy(UChar *dst,
00367 const UChar *src,
00368 int32_t n);
00369
00380 U_CAPI UChar* U_EXPORT2 u_uastrcpy(UChar *dst,
00381 const char *src );
00382
00395 U_CAPI UChar* U_EXPORT2 u_uastrncpy(UChar *dst,
00396 const char *src,
00397 int32_t n);
00398
00409 U_CAPI char* U_EXPORT2 u_austrcpy(char *dst,
00410 const UChar *src );
00411
00424 U_CAPI char* U_EXPORT2 u_austrncpy(char *dst,
00425 const UChar *src,
00426 int32_t n );
00427
00432 U_CAPI UChar* U_EXPORT2
00433 u_memcpy(UChar *dest, const UChar *src, int32_t count);
00434
00439 U_CAPI UChar* U_EXPORT2
00440 u_memmove(UChar *dest, const UChar *src, int32_t count);
00441
00451 U_CAPI UChar* U_EXPORT2
00452 u_memset(UChar *dest, UChar c, int32_t count);
00453
00465 U_CAPI int32_t U_EXPORT2
00466 u_memcmp(UChar *buf1, UChar *buf2, int32_t count);
00467
00481 U_CAPI int32_t U_EXPORT2
00482 u_memcmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t count);
00483
00496 U_CAPI UChar* U_EXPORT2
00497 u_memchr(UChar *src, UChar ch, int32_t count);
00498
00511 U_CAPI UChar* U_EXPORT2
00512 u_memchr32(UChar *src, UChar32 ch, int32_t count);
00513
00550 #if U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && U_CHARSET_FAMILY==U_ASCII_FAMILY
00551 # define U_STRING_DECL(var, cs, length) static const wchar_t var[(length)+1]={ L ## cs }
00552 # define U_STRING_INIT(var, cs, length)
00553 #elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
00554 # define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]={ (const UChar *)cs }
00555 # define U_STRING_INIT(var, cs, length)
00556 #else
00557 # define U_STRING_DECL(var, cs, length) static UChar var[(length)+1]
00558 # define U_STRING_INIT(var, cs, length) u_charsToUChars(cs, var, length+1)
00559 #endif
00560
00607 U_CAPI int32_t U_EXPORT2
00608 u_unescape(const char *src,
00609 UChar *dest, int32_t destCapacity);
00610
00619 U_CDECL_BEGIN
00620 typedef UChar (*UNESCAPE_CHAR_AT)(int32_t offset, void *context);
00621 U_CDECL_END
00622
00651 U_CAPI UChar32 U_EXPORT2
00652 u_unescapeAt(UNESCAPE_CHAR_AT charAt,
00653 int32_t *offset,
00654 int32_t length,
00655 void *context);
00656
00677 U_CAPI int32_t U_EXPORT2
00678 u_strToUpper(UChar *dest, int32_t destCapacity,
00679 const UChar *src, int32_t srcLength,
00680 const char *locale,
00681 UErrorCode *pErrorCode);
00682
00703 U_CAPI int32_t U_EXPORT2
00704 u_strToLower(UChar *dest, int32_t destCapacity,
00705 const UChar *src, int32_t srcLength,
00706 const char *locale,
00707 UErrorCode *pErrorCode);
00708
00747 U_CAPI int32_t U_EXPORT2
00748 u_strToTitle(UChar *dest, int32_t destCapacity,
00749 const UChar *src, int32_t srcLength,
00750 UBreakIterator *titleIter,
00751 const char *locale,
00752 UErrorCode *pErrorCode);
00753
00776 U_CAPI int32_t U_EXPORT2
00777 u_strFoldCase(UChar *dest, int32_t destCapacity,
00778 const UChar *src, int32_t srcLength,
00779 uint32_t options,
00780 UErrorCode *pErrorCode);
00781
00801 U_CAPI wchar_t* U_EXPORT2
00802 u_strToWCS(wchar_t *dest,
00803 int32_t destCapacity,
00804 int32_t *pDestLength,
00805 const UChar *src,
00806 int32_t srcLength,
00807 UErrorCode *pErrorCode);
00827 U_CAPI UChar* U_EXPORT2
00828 u_strFromWCS(UChar *dest,
00829 int32_t destCapacity,
00830 int32_t *pDestLength,
00831 const wchar_t *src,
00832 int32_t srcLength,
00833 UErrorCode *pErrorCode);
00853 U_CAPI char* U_EXPORT2
00854 u_strToUTF8(char *dest,
00855 int32_t destCapacity,
00856 int32_t *pDestLength,
00857 const UChar *src,
00858 int32_t srcLength,
00859 UErrorCode *pErrorCode);
00860
00880 U_CAPI UChar* U_EXPORT2
00881 u_strFromUTF8(UChar *dest,
00882 int32_t destCapacity,
00883 int32_t *pDestLength,
00884 const char *src,
00885 int32_t srcLength,
00886 UErrorCode *pErrorCode);
00887
00907 U_CAPI UChar32* U_EXPORT2
00908 u_strToUTF32(UChar32 *dest,
00909 int32_t destCapacity,
00910 int32_t *pDestLength,
00911 const UChar *src,
00912 int32_t srcLength,
00913 UErrorCode *pErrorCode);
00914
00934 U_CAPI UChar* U_EXPORT2
00935 u_strFromUTF32(UChar *dest,
00936 int32_t destCapacity,
00937 int32_t *pDestLength,
00938 const UChar32 *src,
00939 int32_t srcLength,
00940 UErrorCode *pErrorCode);
00941
00942 #endif