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
00021 typedef void UBreakIterator;
00022 #endif
00023
00024 #if !UCONFIG_NO_BREAK_ITERATION
00025
00026 #include "unicode/parseerr.h"
00027
00186 typedef enum UBreakIteratorType {
00188 UBRK_CHARACTER,
00190 UBRK_WORD,
00192 UBRK_LINE,
00194 UBRK_SENTENCE,
00202 UBRK_TITLE
00203 } UBreakIteratorType;
00204
00208 #define UBRK_DONE ((int32_t) -1)
00209
00210
00219 typedef enum UWordBreak {
00222 UBRK_WORD_NONE = 0,
00224 UBRK_WORD_NONE_LIMIT = 100,
00226 UBRK_WORD_NUMBER = 100,
00228 UBRK_WORD_NUMBER_LIMIT = 200,
00231 UBRK_WORD_LETTER = 200,
00233 UBRK_WORD_LETTER_LIMIT = 300,
00235 UBRK_WORD_KANA = 300,
00237 UBRK_WORD_KANA_LIMIT = 400,
00239 UBRK_WORD_IDEO = 400,
00241 UBRK_WORD_IDEO_LIMIT = 500
00242 } UWordBreak;
00243
00244
00259 U_CAPI UBreakIterator* U_EXPORT2
00260 ubrk_open(UBreakIteratorType type,
00261 const char *locale,
00262 const UChar *text,
00263 int32_t textLength,
00264 UErrorCode *status);
00265
00281 U_CAPI UBreakIterator* U_EXPORT2
00282 ubrk_openRules(const UChar *rules,
00283 int32_t rulesLength,
00284 const UChar *text,
00285 int32_t textLength,
00286 UParseError *parseErr,
00287 UErrorCode *status);
00288
00305 U_CAPI UBreakIterator * U_EXPORT2
00306 ubrk_safeClone(
00307 const UBreakIterator *bi,
00308 void *stackBuffer,
00309 int32_t *pBufferSize,
00310 UErrorCode *status);
00311
00316 #define U_BRK_SAFECLONE_BUFFERSIZE 512
00317
00324 U_CAPI void U_EXPORT2
00325 ubrk_close(UBreakIterator *bi);
00326
00335 U_CAPI void U_EXPORT2
00336 ubrk_setText(UBreakIterator* bi,
00337 const UChar* text,
00338 int32_t textLength,
00339 UErrorCode* status);
00340
00349 U_CAPI int32_t U_EXPORT2
00350 ubrk_current(const UBreakIterator *bi);
00351
00361 U_CAPI int32_t U_EXPORT2
00362 ubrk_next(UBreakIterator *bi);
00363
00373 U_CAPI int32_t U_EXPORT2
00374 ubrk_previous(UBreakIterator *bi);
00375
00384 U_CAPI int32_t U_EXPORT2
00385 ubrk_first(UBreakIterator *bi);
00386
00397 U_CAPI int32_t U_EXPORT2
00398 ubrk_last(UBreakIterator *bi);
00399
00409 U_CAPI int32_t U_EXPORT2
00410 ubrk_preceding(UBreakIterator *bi,
00411 int32_t offset);
00412
00422 U_CAPI int32_t U_EXPORT2
00423 ubrk_following(UBreakIterator *bi,
00424 int32_t offset);
00425
00435 U_CAPI const char* U_EXPORT2
00436 ubrk_getAvailable(int32_t index);
00437
00446 U_CAPI int32_t U_EXPORT2
00447 ubrk_countAvailable(void);
00448
00449
00459 U_CAPI UBool U_EXPORT2
00460 ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
00461
00471 U_CAPI int32_t U_EXPORT2
00472 ubrk_getRuleStatus(UBreakIterator *bi);
00473
00474 #endif
00475
00476 #endif