00001
00002
00003
00004
00005
00006 #ifndef UBRK_H
00007 #define UBRK_H
00008
00009 #include "unicode/utypes.h"
00010 #include "unicode/uloc.h"
00011 #include "unicode/utext.h"
00012
00017 #ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
00018 # define UBRK_TYPEDEF_UBREAK_ITERATOR
00019
00023 typedef void UBreakIterator;
00024 #endif
00025
00026 #if !UCONFIG_NO_BREAK_ITERATION
00027
00028 #include "unicode/parseerr.h"
00029
00188 typedef enum UBreakIteratorType {
00190 UBRK_CHARACTER,
00192 UBRK_WORD,
00194 UBRK_LINE,
00196 UBRK_SENTENCE,
00197
00198 #ifndef U_HIDE_DEPRECATED_API
00199
00207 UBRK_TITLE
00208 #endif
00209
00210 } UBreakIteratorType;
00211
00215 #define UBRK_DONE ((int32_t) -1)
00216
00217
00226 typedef enum UWordBreak {
00229 UBRK_WORD_NONE = 0,
00231 UBRK_WORD_NONE_LIMIT = 100,
00233 UBRK_WORD_NUMBER = 100,
00235 UBRK_WORD_NUMBER_LIMIT = 200,
00238 UBRK_WORD_LETTER = 200,
00240 UBRK_WORD_LETTER_LIMIT = 300,
00242 UBRK_WORD_KANA = 300,
00244 UBRK_WORD_KANA_LIMIT = 400,
00246 UBRK_WORD_IDEO = 400,
00248 UBRK_WORD_IDEO_LIMIT = 500
00249 } UWordBreak;
00250
00259 typedef enum ULineBreakTag {
00262 UBRK_LINE_SOFT = 0,
00264 UBRK_LINE_SOFT_LIMIT = 100,
00266 UBRK_LINE_HARD = 100,
00268 UBRK_LINE_HARD_LIMIT = 200
00269 } ULineBreakTag;
00270
00271
00272
00281 typedef enum USentenceBreakTag {
00286 UBRK_SENTENCE_TERM = 0,
00288 UBRK_SENTENCE_TERM_LIMIT = 100,
00293 UBRK_SENTENCE_SEP = 100,
00295 UBRK_SENTENCE_SEP_LIMIT = 200
00297 } USentenceBreakTag;
00298
00299
00314 U_STABLE UBreakIterator* U_EXPORT2
00315 ubrk_open(UBreakIteratorType type,
00316 const char *locale,
00317 const UChar *text,
00318 int32_t textLength,
00319 UErrorCode *status);
00320
00336 U_STABLE UBreakIterator* U_EXPORT2
00337 ubrk_openRules(const UChar *rules,
00338 int32_t rulesLength,
00339 const UChar *text,
00340 int32_t textLength,
00341 UParseError *parseErr,
00342 UErrorCode *status);
00343
00360 U_STABLE UBreakIterator * U_EXPORT2
00361 ubrk_safeClone(
00362 const UBreakIterator *bi,
00363 void *stackBuffer,
00364 int32_t *pBufferSize,
00365 UErrorCode *status);
00366
00371 #define U_BRK_SAFECLONE_BUFFERSIZE 512
00372
00379 U_STABLE void U_EXPORT2
00380 ubrk_close(UBreakIterator *bi);
00381
00390 U_STABLE void U_EXPORT2
00391 ubrk_setText(UBreakIterator* bi,
00392 const UChar* text,
00393 int32_t textLength,
00394 UErrorCode* status);
00395
00396
00404 U_DRAFT void U_EXPORT2
00405 ubrk_setUText(UBreakIterator* bi,
00406 UText* text,
00407 UErrorCode* status);
00408
00409
00410
00419 U_STABLE int32_t U_EXPORT2
00420 ubrk_current(const UBreakIterator *bi);
00421
00431 U_STABLE int32_t U_EXPORT2
00432 ubrk_next(UBreakIterator *bi);
00433
00443 U_STABLE int32_t U_EXPORT2
00444 ubrk_previous(UBreakIterator *bi);
00445
00454 U_STABLE int32_t U_EXPORT2
00455 ubrk_first(UBreakIterator *bi);
00456
00467 U_STABLE int32_t U_EXPORT2
00468 ubrk_last(UBreakIterator *bi);
00469
00479 U_STABLE int32_t U_EXPORT2
00480 ubrk_preceding(UBreakIterator *bi,
00481 int32_t offset);
00482
00492 U_STABLE int32_t U_EXPORT2
00493 ubrk_following(UBreakIterator *bi,
00494 int32_t offset);
00495
00505 U_STABLE const char* U_EXPORT2
00506 ubrk_getAvailable(int32_t index);
00507
00516 U_STABLE int32_t U_EXPORT2
00517 ubrk_countAvailable(void);
00518
00519
00529 U_STABLE UBool U_EXPORT2
00530 ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
00531
00541 U_STABLE int32_t U_EXPORT2
00542 ubrk_getRuleStatus(UBreakIterator *bi);
00543
00561 U_DRAFT int32_t U_EXPORT2
00562 ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status);
00563
00573 U_DRAFT const char* U_EXPORT2
00574 ubrk_getLocaleByType(const UBreakIterator *bi, ULocDataLocaleType type, UErrorCode* status);
00575
00576
00577 #endif
00578
00579 #endif