00001
00002
00003
00004
00005
00006 #ifndef UBRK_H
00007 #define UBRK_H
00008
00009 #include "unicode/utypes.h"
00010
00015 #ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
00016 # define UBRK_TYPEDEF_UBREAK_ITERATOR
00017 typedef void UBreakIterator;
00018 #endif
00019
00020 #if !UCONFIG_NO_BREAK_ITERATION
00021
00022 #include "unicode/parseerr.h"
00023
00182 typedef enum UBreakIteratorType {
00184 UBRK_CHARACTER,
00186 UBRK_WORD,
00188 UBRK_LINE,
00190 UBRK_SENTENCE,
00192 UBRK_TITLE
00193 } UBreakIteratorType;
00194
00198 #define UBRK_DONE ((int32_t) -1)
00199
00200
00208 typedef enum UWordBreak {
00211 UBRK_WORD_NONE = 0,
00213 UBRK_WORD_NONE_LIMIT = 100,
00215 UBRK_WORD_NUMBER = 100,
00217 UBRK_WORD_NUMBER_LIMIT = 200,
00220 UBRK_WORD_LETTER = 200,
00222 UBRK_WORD_LETTER_LIMIT = 300,
00224 UBRK_WORD_KANA = 300,
00226 UBRK_WORD_KANA_LIMIT = 400,
00228 UBRK_WORD_IDEO = 400,
00230 UBRK_WORD_IDEO_LIMIT = 500
00231 } UWordBreak;
00232
00233
00248 U_CAPI UBreakIterator* U_EXPORT2
00249 ubrk_open(UBreakIteratorType type,
00250 const char *locale,
00251 const UChar *text,
00252 int32_t textLength,
00253 UErrorCode *status);
00254
00270 U_CAPI UBreakIterator* U_EXPORT2
00271 ubrk_openRules(const UChar *rules,
00272 int32_t rulesLength,
00273 const UChar *text,
00274 int32_t textLength,
00275 UParseError *parseErr,
00276 UErrorCode *status);
00277
00294 U_CAPI UBreakIterator * U_EXPORT2
00295 ubrk_safeClone(
00296 const UBreakIterator *bi,
00297 void *stackBuffer,
00298 int32_t *pBufferSize,
00299 UErrorCode *status);
00300
00301 #define U_BRK_SAFECLONE_BUFFERSIZE 512
00302
00309 U_CAPI void U_EXPORT2
00310 ubrk_close(UBreakIterator *bi);
00311
00320 U_CAPI void U_EXPORT2
00321 ubrk_setText(UBreakIterator* bi,
00322 const UChar* text,
00323 int32_t textLength,
00324 UErrorCode* status);
00325
00334 U_CAPI int32_t U_EXPORT2
00335 ubrk_current(const UBreakIterator *bi);
00336
00346 U_CAPI int32_t U_EXPORT2
00347 ubrk_next(UBreakIterator *bi);
00348
00358 U_CAPI int32_t U_EXPORT2
00359 ubrk_previous(UBreakIterator *bi);
00360
00369 U_CAPI int32_t U_EXPORT2
00370 ubrk_first(UBreakIterator *bi);
00371
00382 U_CAPI int32_t U_EXPORT2
00383 ubrk_last(UBreakIterator *bi);
00384
00394 U_CAPI int32_t U_EXPORT2
00395 ubrk_preceding(UBreakIterator *bi,
00396 int32_t offset);
00397
00407 U_CAPI int32_t U_EXPORT2
00408 ubrk_following(UBreakIterator *bi,
00409 int32_t offset);
00410
00420 U_CAPI const char* U_EXPORT2
00421 ubrk_getAvailable(int32_t index);
00422
00431 U_CAPI int32_t U_EXPORT2
00432 ubrk_countAvailable(void);
00433
00434
00444 U_CAPI UBool U_EXPORT2
00445 ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
00446
00456 U_CAPI int32_t U_EXPORT2
00457 ubrk_getRuleStatus(UBreakIterator *bi);
00458
00459 #endif
00460
00461 #endif