- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- Search for |

- File List
- Globals

# ustring.h

Go to the documentation of this file.

    00001 /*
    00002 **********************************************************************
    00003 *   Copyright (C) 1998-2007, International Business Machines
    00004 *   Corporation and others.  All Rights Reserved.
    00005 **********************************************************************
    00006 *
    00007 * File ustring.h
    00008 *
    00009 * Modification History:
    00010 *
    00011 *   Date        Name        Description
    00012 *   12/07/98    bertrand    Creation.
    00013 ******************************************************************************
    00014 */
    00015
    00016 #ifndef USTRING_H
    00017 #define USTRING_H
    00018
    00019 #include "unicode/utypes.h"
    00020 #include "unicode/putil.h"
    00021 #include "unicode/uiter.h"
    00022
    00024 #ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
    00025 #   define UBRK_TYPEDEF_UBREAK_ITERATOR
    00026     typedef void UBreakIterator;
    00027 #endif
    00028
    00084 U_STABLE int32_t U_EXPORT2
    00085 u_strlen(const UChar *s);
    00101 U_STABLE int32_t U_EXPORT2
    00102 u_countChar32(const UChar *s, int32_t length);
    00103
    00122 U_STABLE UBool U_EXPORT2
    00123 u_strHasMoreChar32Than(const UChar *s, int32_t length, int32_t number);
    00124
    00135 U_STABLE UChar* U_EXPORT2
    00136 u_strcat(UChar     *dst,
    00137     const UChar     *src);
    00138
    00153 U_STABLE UChar* U_EXPORT2
    00154 u_strncat(UChar     *dst,
    00155      const UChar     *src,
    00156      int32_t     n);
    00157
    00178 U_STABLE UChar * U_EXPORT2
    00179 u_strstr(const UChar *s, const UChar *substring);
    00180
    00202 U_STABLE UChar * U_EXPORT2
    00203 u_strFindFirst(const UChar *s, int32_t length, const UChar *substring, int32_t subLength);
    00204
    00222 U_STABLE UChar * U_EXPORT2
    00223 u_strchr(const UChar *s, UChar c);
    00224
    00242 U_STABLE UChar * U_EXPORT2
    00243 u_strchr32(const UChar *s, UChar32 c);
    00244
    00265 U_STABLE UChar * U_EXPORT2
    00266 u_strrstr(const UChar *s, const UChar *substring);
    00267
    00289 U_STABLE UChar * U_EXPORT2
    00290 u_strFindLast(const UChar *s, int32_t length, const UChar *substring, int32_t subLength);
    00291
    00309 U_STABLE UChar * U_EXPORT2
    00310 u_strrchr(const UChar *s, UChar c);
    00311
    00329 U_STABLE UChar * U_EXPORT2
    00330 u_strrchr32(const UChar *s, UChar32 c);
    00331
    00344 U_STABLE UChar * U_EXPORT2
    00345 u_strpbrk(const UChar *string, const UChar *matchSet);
    00346
    00360 U_STABLE int32_t U_EXPORT2
    00361 u_strcspn(const UChar *string, const UChar *matchSet);
    00362
    00376 U_STABLE int32_t U_EXPORT2
    00377 u_strspn(const UChar *string, const UChar *matchSet);
    00378
    00404 U_STABLE UChar * U_EXPORT2
    00405 u_strtok_r(UChar    *src,
    00406      const UChar    *delim,
    00407            UChar   **saveState);
    00408
    00419 U_STABLE int32_t  U_EXPORT2
    00420 u_strcmp(const UChar     *s1,
    00421          const UChar     *s2);
    00422
    00434 U_STABLE int32_t U_EXPORT2
    00435 u_strcmpCodePointOrder(const UChar *s1, const UChar *s2);
    00436
    00464 U_STABLE int32_t U_EXPORT2
    00465 u_strCompare(const UChar *s1, int32_t length1,
    00466              const UChar *s2, int32_t length2,
    00467              UBool codePointOrder);
    00468
    00489 U_STABLE int32_t U_EXPORT2
    00490 u_strCompareIter(UCharIterator *iter1, UCharIterator *iter2, UBool codePointOrder);
    00491
    00492 #ifndef U_COMPARE_CODE_POINT_ORDER
    00493 /* see also unistr.h and unorm.h */
    00499 #define U_COMPARE_CODE_POINT_ORDER  0x8000
    00500 #endif
    00501
    00542 U_STABLE int32_t U_EXPORT2
    00543 u_strCaseCompare(const UChar *s1, int32_t length1,
    00544                  const UChar *s2, int32_t length2,
    00545                  uint32_t options,
    00546                  UErrorCode *pErrorCode);
    00547
    00560 U_STABLE int32_t U_EXPORT2
    00561 u_strncmp(const UChar     *ucs1,
    00562      const UChar     *ucs2,
    00563      int32_t     n);
    00564
    00578 U_STABLE int32_t U_EXPORT2
    00579 u_strncmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t n);
    00580
    00600 U_STABLE int32_t U_EXPORT2
    00601 u_strcasecmp(const UChar *s1, const UChar *s2, uint32_t options);
    00602
    00624 U_STABLE int32_t U_EXPORT2
    00625 u_strncasecmp(const UChar *s1, const UChar *s2, int32_t n, uint32_t options);
    00626
    00648 U_STABLE int32_t U_EXPORT2
    00649 u_memcasecmp(const UChar *s1, const UChar *s2, int32_t length, uint32_t options);
    00650
    00659 U_STABLE UChar* U_EXPORT2
    00660 u_strcpy(UChar     *dst,
    00661     const UChar     *src);
    00662
    00674 U_STABLE UChar* U_EXPORT2
    00675 u_strncpy(UChar     *dst,
    00676      const UChar     *src,
    00677      int32_t     n);
    00678
    00679 #if !UCONFIG_NO_CONVERSION
    00680
    00691 U_STABLE UChar* U_EXPORT2 u_uastrcpy(UChar *dst,
    00692                const char *src );
    00693
    00706 U_STABLE UChar* U_EXPORT2 u_uastrncpy(UChar *dst,
    00707             const char *src,
    00708             int32_t n);
    00709
    00720 U_STABLE char* U_EXPORT2 u_austrcpy(char *dst,
    00721             const UChar *src );
    00722
    00735 U_STABLE char* U_EXPORT2 u_austrncpy(char *dst,
    00736             const UChar *src,
    00737             int32_t n );
    00738
    00739 #endif
    00740
    00749 U_STABLE UChar* U_EXPORT2
    00750 u_memcpy(UChar *dest, const UChar *src, int32_t count);
    00751
    00760 U_STABLE UChar* U_EXPORT2
    00761 u_memmove(UChar *dest, const UChar *src, int32_t count);
    00762
    00772 U_STABLE UChar* U_EXPORT2
    00773 u_memset(UChar *dest, UChar c, int32_t count);
    00774
    00786 U_STABLE int32_t U_EXPORT2
    00787 u_memcmp(const UChar *buf1, const UChar *buf2, int32_t count);
    00788
    00802 U_STABLE int32_t U_EXPORT2
    00803 u_memcmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t count);
    00804
    00822 U_STABLE UChar* U_EXPORT2
    00823 u_memchr(const UChar *s, UChar c, int32_t count);
    00824
    00842 U_STABLE UChar* U_EXPORT2
    00843 u_memchr32(const UChar *s, UChar32 c, int32_t count);
    00844
    00862 U_STABLE UChar* U_EXPORT2
    00863 u_memrchr(const UChar *s, UChar c, int32_t count);
    00864
    00882 U_STABLE UChar* U_EXPORT2
    00883 u_memrchr32(const UChar *s, UChar32 c, int32_t count);
    00884
    00921 #if defined(U_DECLARE_UTF16)
    00922 #   define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]=U_DECLARE_UTF16(cs)
    00923
    00924 #   define U_STRING_INIT(var, cs, length)
    00925 #elif U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && (U_CHARSET_FAMILY==U_ASCII_FAMILY || (U_SIZEOF_UCHAR == 2 && defined(U_WCHAR_IS_UTF16)))
    00926 #   define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]=L ## cs
    00927
    00928 #   define U_STRING_INIT(var, cs, length)
    00929 #elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
    00930 #   define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]=cs
    00931
    00932 #   define U_STRING_INIT(var, cs, length)
    00933 #else
    00934 #   define U_STRING_DECL(var, cs, length) static UChar var[(length)+1]
    00935
    00936 #   define U_STRING_INIT(var, cs, length) u_charsToUChars(cs, var, length+1)
    00937 #endif
    00938
    00986 U_STABLE int32_t U_EXPORT2
    00987 u_unescape(const char *src,
    00988            UChar *dest, int32_t destCapacity);
    00989
    00990 U_CDECL_BEGIN
    01003 typedef UChar (U_CALLCONV *UNESCAPE_CHAR_AT)(int32_t offset, void *context);
    01004 U_CDECL_END
    01005
    01034 U_STABLE UChar32 U_EXPORT2
    01035 u_unescapeAt(UNESCAPE_CHAR_AT charAt,
    01036              int32_t *offset,
    01037              int32_t length,
    01038              void *context);
    01039
    01060 U_STABLE int32_t U_EXPORT2
    01061 u_strToUpper(UChar *dest, int32_t destCapacity,
    01062              const UChar *src, int32_t srcLength,
    01063              const char *locale,
    01064              UErrorCode *pErrorCode);
    01065
    01086 U_STABLE int32_t U_EXPORT2
    01087 u_strToLower(UChar *dest, int32_t destCapacity,
    01088              const UChar *src, int32_t srcLength,
    01089              const char *locale,
    01090              UErrorCode *pErrorCode);
    01091
    01092 #if !UCONFIG_NO_BREAK_ITERATION
    01093
    01132 U_STABLE int32_t U_EXPORT2
    01133 u_strToTitle(UChar *dest, int32_t destCapacity,
    01134              const UChar *src, int32_t srcLength,
    01135              UBreakIterator *titleIter,
    01136              const char *locale,
    01137              UErrorCode *pErrorCode);
    01138
    01139 #endif
    01140
    01163 U_STABLE int32_t U_EXPORT2
    01164 u_strFoldCase(UChar *dest, int32_t destCapacity,
    01165               const UChar *src, int32_t srcLength,
    01166               uint32_t options,
    01167               UErrorCode *pErrorCode);
    01168
    01169 #if defined(U_WCHAR_IS_UTF16) || defined(U_WCHAR_IS_UTF32) || !UCONFIG_NO_CONVERSION
    01170
    01189 U_STABLE wchar_t* U_EXPORT2
    01190 u_strToWCS(wchar_t *dest,
    01191            int32_t destCapacity,
    01192            int32_t *pDestLength,
    01193            const UChar *src,
    01194            int32_t srcLength,
    01195            UErrorCode *pErrorCode);
    01215 U_STABLE UChar* U_EXPORT2
    01216 u_strFromWCS(UChar   *dest,
    01217              int32_t destCapacity,
    01218              int32_t *pDestLength,
    01219              const wchar_t *src,
    01220              int32_t srcLength,
    01221              UErrorCode *pErrorCode);
    01222 #endif /* defined(U_WCHAR_IS_UTF16) || defined(U_WCHAR_IS_UTF32) || !UCONFIG_NO_CONVERSION */
    01223
    01245 U_STABLE char* U_EXPORT2
    01246 u_strToUTF8(char *dest,
    01247             int32_t destCapacity,
    01248             int32_t *pDestLength,
    01249             const UChar *src,
    01250             int32_t srcLength,
    01251             UErrorCode *pErrorCode);
    01252
    01274 U_STABLE UChar* U_EXPORT2
    01275 u_strFromUTF8(UChar *dest,
    01276               int32_t destCapacity,
    01277               int32_t *pDestLength,
    01278               const char *src,
    01279               int32_t srcLength,
    01280               UErrorCode *pErrorCode);
    01281
    01316 U_STABLE char* U_EXPORT2
    01317 u_strToUTF8WithSub(char *dest,
    01318             int32_t destCapacity,
    01319             int32_t *pDestLength,
    01320             const UChar *src,
    01321             int32_t srcLength,
    01322             UChar32 subchar, int32_t *pNumSubstitutions,
    01323             UErrorCode *pErrorCode);
    01324
    01360 U_STABLE UChar* U_EXPORT2
    01361 u_strFromUTF8WithSub(UChar *dest,
    01362               int32_t destCapacity,
    01363               int32_t *pDestLength,
    01364               const char *src,
    01365               int32_t srcLength,
    01366               UChar32 subchar, int32_t *pNumSubstitutions,
    01367               UErrorCode *pErrorCode);
    01368
    01416 U_STABLE UChar * U_EXPORT2
    01417 u_strFromUTF8Lenient(UChar *dest,
    01418                      int32_t destCapacity,
    01419                      int32_t *pDestLength,
    01420                      const char *src,
    01421                      int32_t srcLength,
    01422                      UErrorCode *pErrorCode);
    01423
    01443 U_STABLE UChar32* U_EXPORT2
    01444 u_strToUTF32(UChar32 *dest,
    01445              int32_t  destCapacity,
    01446              int32_t  *pDestLength,
    01447              const UChar *src,
    01448              int32_t  srcLength,
    01449              UErrorCode *pErrorCode);
    01450
    01470 U_STABLE UChar* U_EXPORT2
    01471 u_strFromUTF32(UChar   *dest,
    01472                int32_t destCapacity,
    01473                int32_t *pDestLength,
    01474                const UChar32 *src,
    01475                int32_t srcLength,
    01476                UErrorCode *pErrorCode);
    01477
    01478 #endif