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
00027 U_CAPI int32_t U_EXPORT2
00028 u_strlen(const UChar *s);
00029
00040 U_CAPI UChar* U_EXPORT2
00041 u_strcat(UChar *dst,
00042 const UChar *src);
00043
00054 U_CAPI UChar* U_EXPORT2
00055 u_strncat(UChar *dst,
00056 const UChar *src,
00057 int32_t n);
00058
00068 U_CAPI UChar* U_EXPORT2
00069 u_strchr(const UChar *s,
00070 UChar c);
00071
00080 U_CAPI UChar * U_EXPORT2
00081 u_strstr(const UChar *s, const UChar *substring);
00082
00094 U_CAPI UChar * U_EXPORT2
00095 u_strchr32(const UChar *s, UChar32 c);
00096
00107 U_CAPI int32_t U_EXPORT2
00108 u_strcmp(const UChar *s1,
00109 const UChar *s2);
00110
00122 U_CAPI int32_t U_EXPORT2
00123 u_strncmp(const UChar *ucs1,
00124 const UChar *ucs2,
00125 int32_t n);
00126
00135 U_CAPI UChar* U_EXPORT2
00136 u_strcpy(UChar *dst,
00137 const UChar *src);
00138
00149 U_CAPI UChar* U_EXPORT2
00150 u_strncpy(UChar *dst,
00151 const UChar *src,
00152 int32_t n);
00153
00163 U_CAPI UChar* U_EXPORT2 u_uastrcpy(UChar *ucs1,
00164 const char *s2 );
00165
00177 U_CAPI UChar* U_EXPORT2 u_uastrncpy(UChar *ucs1,
00178 const char *s2,
00179 int32_t n);
00180
00190 U_CAPI char* U_EXPORT2 u_austrcpy(char *s1,
00191 const UChar *us2 );
00192
00228 #if U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && U_CHARSET_FAMILY==U_ASCII_FAMILY
00229 # define U_STRING_DECL(var, cs, length) static const wchar_t var[(length)+1]={ L ## cs }
00230 # define U_STRING_INIT(var, cs, length)
00231 #elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
00232 # define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]={ (const UChar *)cs }
00233 # define U_STRING_INIT(var, cs, length)
00234 #else
00235 # define U_STRING_DECL(var, cs, length) static UChar var[(length)+1]
00236 # define U_STRING_INIT(var, cs, length) u_charsToUChars(cs, var, length+1)
00237 #endif
00238
00284 U_CAPI int32_t U_EXPORT2
00285 u_unescape(const char *src,
00286 UChar *dest, int32_t destCapacity);
00287
00294 U_CDECL_BEGIN
00295 typedef UChar (*UNESCAPE_CHAR_AT)(int32_t offset, void *context);
00296 U_CDECL_END
00297
00325 U_CAPI UChar32 U_EXPORT2
00326 u_unescapeAt(UNESCAPE_CHAR_AT charAt,
00327 int32_t *offset,
00328 int32_t length,
00329 void *context);
00330
00350 U_CAPI int32_t U_EXPORT2
00351 u_strToUpper(const UChar *src, int32_t srcLength,
00352 UChar *dest, int32_t destCapacity,
00353 const char *locale,
00354 UErrorCode *pErrorCode);
00355
00375 U_CAPI int32_t U_EXPORT2
00376 u_strToLower(const UChar *src, int32_t srcLength,
00377 UChar *dest, int32_t destCapacity,
00378 const char *locale,
00379 UErrorCode *pErrorCode);
00380
00381 #endif