00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef UBRK_H
00011 #define UBRK_H
00012
00013 #include "unicode/utypes.h"
00014 #include "unicode/uloc.h"
00015 #include "unicode/utext.h"
00016 #include "unicode/localpointer.h"
00017
00022 #ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
00023 # define UBRK_TYPEDEF_UBREAK_ITERATOR
00024
00028 typedef struct UBreakIterator UBreakIterator;
00029 #endif
00030
00031 #if !UCONFIG_NO_BREAK_ITERATION
00032
00033 #include "unicode/parseerr.h"
00034
00099 typedef enum UBreakIteratorType {
00101 UBRK_CHARACTER = 0,
00103 UBRK_WORD = 1,
00105 UBRK_LINE = 2,
00107 UBRK_SENTENCE = 3,
00108
00109 #ifndef U_HIDE_DEPRECATED_API
00110
00118 UBRK_TITLE = 4,
00123 UBRK_COUNT = 5
00124 #endif // U_HIDE_DEPRECATED_API
00125 } UBreakIteratorType;
00126
00130 #define UBRK_DONE ((int32_t) -1)
00131
00132
00144 typedef enum UWordBreak {
00147 UBRK_WORD_NONE = 0,
00149 UBRK_WORD_NONE_LIMIT = 100,
00151 UBRK_WORD_NUMBER = 100,
00153 UBRK_WORD_NUMBER_LIMIT = 200,
00156 UBRK_WORD_LETTER = 200,
00158 UBRK_WORD_LETTER_LIMIT = 300,
00160 UBRK_WORD_KANA = 300,
00162 UBRK_WORD_KANA_LIMIT = 400,
00164 UBRK_WORD_IDEO = 400,
00166 UBRK_WORD_IDEO_LIMIT = 500
00167 } UWordBreak;
00168
00180 typedef enum ULineBreakTag {
00183 UBRK_LINE_SOFT = 0,
00185 UBRK_LINE_SOFT_LIMIT = 100,
00187 UBRK_LINE_HARD = 100,
00189 UBRK_LINE_HARD_LIMIT = 200
00190 } ULineBreakTag;
00191
00192
00193
00205 typedef enum USentenceBreakTag {
00210 UBRK_SENTENCE_TERM = 0,
00212 UBRK_SENTENCE_TERM_LIMIT = 100,
00217 UBRK_SENTENCE_SEP = 100,
00219 UBRK_SENTENCE_SEP_LIMIT = 200
00221 } USentenceBreakTag;
00222
00223
00241 U_STABLE UBreakIterator* U_EXPORT2
00242 ubrk_open(UBreakIteratorType type,
00243 const char *locale,
00244 const UChar *text,
00245 int32_t textLength,
00246 UErrorCode *status);
00247
00263 U_STABLE UBreakIterator* U_EXPORT2
00264 ubrk_openRules(const UChar *rules,
00265 int32_t rulesLength,
00266 const UChar *text,
00267 int32_t textLength,
00268 UParseError *parseErr,
00269 UErrorCode *status);
00270
00271 #ifndef U_HIDE_DRAFT_API
00272
00292 U_DRAFT UBreakIterator* U_EXPORT2
00293 ubrk_openBinaryRules(const uint8_t *binaryRules, int32_t rulesLength,
00294 const UChar * text, int32_t textLength,
00295 UErrorCode * status);
00296
00297 #endif
00298
00317 U_STABLE UBreakIterator * U_EXPORT2
00318 ubrk_safeClone(
00319 const UBreakIterator *bi,
00320 void *stackBuffer,
00321 int32_t *pBufferSize,
00322 UErrorCode *status);
00323
00324 #ifndef U_HIDE_DEPRECATED_API
00325
00330 #define U_BRK_SAFECLONE_BUFFERSIZE 1
00331
00332 #endif
00333
00340 U_STABLE void U_EXPORT2
00341 ubrk_close(UBreakIterator *bi);
00342
00343 #if U_SHOW_CPLUSPLUS_API
00344
00345 U_NAMESPACE_BEGIN
00346
00356 U_DEFINE_LOCAL_OPEN_POINTER(LocalUBreakIteratorPointer, UBreakIterator, ubrk_close);
00357
00358 U_NAMESPACE_END
00359
00360 #endif
00361
00374 U_STABLE void U_EXPORT2
00375 ubrk_setText(UBreakIterator* bi,
00376 const UChar* text,
00377 int32_t textLength,
00378 UErrorCode* status);
00379
00380
00398 U_STABLE void U_EXPORT2
00399 ubrk_setUText(UBreakIterator* bi,
00400 UText* text,
00401 UErrorCode* status);
00402
00403
00404
00413 U_STABLE int32_t U_EXPORT2
00414 ubrk_current(const UBreakIterator *bi);
00415
00425 U_STABLE int32_t U_EXPORT2
00426 ubrk_next(UBreakIterator *bi);
00427
00437 U_STABLE int32_t U_EXPORT2
00438 ubrk_previous(UBreakIterator *bi);
00439
00447 U_STABLE int32_t U_EXPORT2
00448 ubrk_first(UBreakIterator *bi);
00449
00459 U_STABLE int32_t U_EXPORT2
00460 ubrk_last(UBreakIterator *bi);
00461
00471 U_STABLE int32_t U_EXPORT2
00472 ubrk_preceding(UBreakIterator *bi,
00473 int32_t offset);
00474
00484 U_STABLE int32_t U_EXPORT2
00485 ubrk_following(UBreakIterator *bi,
00486 int32_t offset);
00487
00497 U_STABLE const char* U_EXPORT2
00498 ubrk_getAvailable(int32_t index);
00499
00508 U_STABLE int32_t U_EXPORT2
00509 ubrk_countAvailable(void);
00510
00511
00521 U_STABLE UBool U_EXPORT2
00522 ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
00523
00533 U_STABLE int32_t U_EXPORT2
00534 ubrk_getRuleStatus(UBreakIterator *bi);
00535
00553 U_STABLE int32_t U_EXPORT2
00554 ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status);
00555
00565 U_STABLE const char* U_EXPORT2
00566 ubrk_getLocaleByType(const UBreakIterator *bi, ULocDataLocaleType type, UErrorCode* status);
00567
00593 U_STABLE void U_EXPORT2
00594 ubrk_refreshUText(UBreakIterator *bi,
00595 UText *text,
00596 UErrorCode *status);
00597
00598
00599 #ifndef U_HIDE_DRAFT_API
00600
00625 U_DRAFT int32_t U_EXPORT2
00626 ubrk_getBinaryRules(UBreakIterator *bi,
00627 uint8_t * binaryRules, int32_t rulesCapacity,
00628 UErrorCode * status);
00629
00630 #endif
00631
00632 #endif
00633
00634 #endif