00001
00002
00003
00004
00005
00006
00007
00008 #ifndef UBRK_H
00009 #define UBRK_H
00010
00011 #include "unicode/utypes.h"
00012 #include "unicode/uloc.h"
00013 #include "unicode/utext.h"
00014
00019 #ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
00020 # define UBRK_TYPEDEF_UBREAK_ITERATOR
00021
00025 typedef void UBreakIterator;
00026 #endif
00027
00028 #if !UCONFIG_NO_BREAK_ITERATION
00029
00030 #include "unicode/parseerr.h"
00031
00087 typedef enum UBreakIteratorType {
00089 UBRK_CHARACTER = 0,
00091 UBRK_WORD = 1,
00093 UBRK_LINE = 2,
00095 UBRK_SENTENCE = 3,
00096
00097 #ifndef U_HIDE_DEPRECATED_API
00098
00106 UBRK_TITLE = 4,
00107 #endif
00108 UBRK_COUNT = 5
00109 } UBreakIteratorType;
00110
00114 #define UBRK_DONE ((int32_t) -1)
00115
00116
00125 typedef enum UWordBreak {
00128 UBRK_WORD_NONE = 0,
00130 UBRK_WORD_NONE_LIMIT = 100,
00132 UBRK_WORD_NUMBER = 100,
00134 UBRK_WORD_NUMBER_LIMIT = 200,
00137 UBRK_WORD_LETTER = 200,
00139 UBRK_WORD_LETTER_LIMIT = 300,
00141 UBRK_WORD_KANA = 300,
00143 UBRK_WORD_KANA_LIMIT = 400,
00145 UBRK_WORD_IDEO = 400,
00147 UBRK_WORD_IDEO_LIMIT = 500
00148 } UWordBreak;
00149
00158 typedef enum ULineBreakTag {
00161 UBRK_LINE_SOFT = 0,
00163 UBRK_LINE_SOFT_LIMIT = 100,
00165 UBRK_LINE_HARD = 100,
00167 UBRK_LINE_HARD_LIMIT = 200
00168 } ULineBreakTag;
00169
00170
00171
00180 typedef enum USentenceBreakTag {
00185 UBRK_SENTENCE_TERM = 0,
00187 UBRK_SENTENCE_TERM_LIMIT = 100,
00192 UBRK_SENTENCE_SEP = 100,
00194 UBRK_SENTENCE_SEP_LIMIT = 200
00196 } USentenceBreakTag;
00197
00198
00213 U_STABLE UBreakIterator* U_EXPORT2
00214 ubrk_open(UBreakIteratorType type,
00215 const char *locale,
00216 const UChar *text,
00217 int32_t textLength,
00218 UErrorCode *status);
00219
00235 U_STABLE UBreakIterator* U_EXPORT2
00236 ubrk_openRules(const UChar *rules,
00237 int32_t rulesLength,
00238 const UChar *text,
00239 int32_t textLength,
00240 UParseError *parseErr,
00241 UErrorCode *status);
00242
00259 U_STABLE UBreakIterator * U_EXPORT2
00260 ubrk_safeClone(
00261 const UBreakIterator *bi,
00262 void *stackBuffer,
00263 int32_t *pBufferSize,
00264 UErrorCode *status);
00265
00270 #define U_BRK_SAFECLONE_BUFFERSIZE 512
00271
00278 U_STABLE void U_EXPORT2
00279 ubrk_close(UBreakIterator *bi);
00280
00289 U_STABLE void U_EXPORT2
00290 ubrk_setText(UBreakIterator* bi,
00291 const UChar* text,
00292 int32_t textLength,
00293 UErrorCode* status);
00294
00295
00303 U_DRAFT void U_EXPORT2
00304 ubrk_setUText(UBreakIterator* bi,
00305 UText* text,
00306 UErrorCode* status);
00307
00308
00309
00318 U_STABLE int32_t U_EXPORT2
00319 ubrk_current(const UBreakIterator *bi);
00320
00330 U_STABLE int32_t U_EXPORT2
00331 ubrk_next(UBreakIterator *bi);
00332
00342 U_STABLE int32_t U_EXPORT2
00343 ubrk_previous(UBreakIterator *bi);
00344
00353 U_STABLE int32_t U_EXPORT2
00354 ubrk_first(UBreakIterator *bi);
00355
00366 U_STABLE int32_t U_EXPORT2
00367 ubrk_last(UBreakIterator *bi);
00368
00378 U_STABLE int32_t U_EXPORT2
00379 ubrk_preceding(UBreakIterator *bi,
00380 int32_t offset);
00381
00391 U_STABLE int32_t U_EXPORT2
00392 ubrk_following(UBreakIterator *bi,
00393 int32_t offset);
00394
00404 U_STABLE const char* U_EXPORT2
00405 ubrk_getAvailable(int32_t index);
00406
00415 U_STABLE int32_t U_EXPORT2
00416 ubrk_countAvailable(void);
00417
00418
00428 U_STABLE UBool U_EXPORT2
00429 ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
00430
00440 U_STABLE int32_t U_EXPORT2
00441 ubrk_getRuleStatus(UBreakIterator *bi);
00442
00460 U_STABLE int32_t U_EXPORT2
00461 ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status);
00462
00472 U_STABLE const char* U_EXPORT2
00473 ubrk_getLocaleByType(const UBreakIterator *bi, ULocDataLocaleType type, UErrorCode* status);
00474
00475
00476 #endif
00477
00478 #endif