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
00109 UBRK_X_GRAPHEME_CLUSTER=5,
00110 UBRK_COUNT = 6
00111 } UBreakIteratorType;
00112
00116 #define UBRK_DONE ((int32_t) -1)
00117
00118
00127 typedef enum UWordBreak {
00130 UBRK_WORD_NONE = 0,
00132 UBRK_WORD_NONE_LIMIT = 100,
00134 UBRK_WORD_NUMBER = 100,
00136 UBRK_WORD_NUMBER_LIMIT = 200,
00139 UBRK_WORD_LETTER = 200,
00141 UBRK_WORD_LETTER_LIMIT = 300,
00143 UBRK_WORD_KANA = 300,
00145 UBRK_WORD_KANA_LIMIT = 400,
00147 UBRK_WORD_IDEO = 400,
00149 UBRK_WORD_IDEO_LIMIT = 500
00150 } UWordBreak;
00151
00160 typedef enum ULineBreakTag {
00163 UBRK_LINE_SOFT = 0,
00165 UBRK_LINE_SOFT_LIMIT = 100,
00167 UBRK_LINE_HARD = 100,
00169 UBRK_LINE_HARD_LIMIT = 200
00170 } ULineBreakTag;
00171
00172
00173
00182 typedef enum USentenceBreakTag {
00187 UBRK_SENTENCE_TERM = 0,
00189 UBRK_SENTENCE_TERM_LIMIT = 100,
00194 UBRK_SENTENCE_SEP = 100,
00196 UBRK_SENTENCE_SEP_LIMIT = 200
00198 } USentenceBreakTag;
00199
00200
00215 U_STABLE UBreakIterator* U_EXPORT2
00216 ubrk_open(UBreakIteratorType type,
00217 const char *locale,
00218 const UChar *text,
00219 int32_t textLength,
00220 UErrorCode *status);
00221
00237 U_STABLE UBreakIterator* U_EXPORT2
00238 ubrk_openRules(const UChar *rules,
00239 int32_t rulesLength,
00240 const UChar *text,
00241 int32_t textLength,
00242 UParseError *parseErr,
00243 UErrorCode *status);
00244
00261 U_STABLE UBreakIterator * U_EXPORT2
00262 ubrk_safeClone(
00263 const UBreakIterator *bi,
00264 void *stackBuffer,
00265 int32_t *pBufferSize,
00266 UErrorCode *status);
00267
00272 #define U_BRK_SAFECLONE_BUFFERSIZE 512
00273
00280 U_STABLE void U_EXPORT2
00281 ubrk_close(UBreakIterator *bi);
00282
00291 U_STABLE void U_EXPORT2
00292 ubrk_setText(UBreakIterator* bi,
00293 const UChar* text,
00294 int32_t textLength,
00295 UErrorCode* status);
00296
00297
00309 U_DRAFT void U_EXPORT2
00310 ubrk_setUText(UBreakIterator* bi,
00311 UText* text,
00312 UErrorCode* status);
00313
00314
00315
00324 U_STABLE int32_t U_EXPORT2
00325 ubrk_current(const UBreakIterator *bi);
00326
00336 U_STABLE int32_t U_EXPORT2
00337 ubrk_next(UBreakIterator *bi);
00338
00348 U_STABLE int32_t U_EXPORT2
00349 ubrk_previous(UBreakIterator *bi);
00350
00359 U_STABLE int32_t U_EXPORT2
00360 ubrk_first(UBreakIterator *bi);
00361
00372 U_STABLE int32_t U_EXPORT2
00373 ubrk_last(UBreakIterator *bi);
00374
00384 U_STABLE int32_t U_EXPORT2
00385 ubrk_preceding(UBreakIterator *bi,
00386 int32_t offset);
00387
00397 U_STABLE int32_t U_EXPORT2
00398 ubrk_following(UBreakIterator *bi,
00399 int32_t offset);
00400
00410 U_STABLE const char* U_EXPORT2
00411 ubrk_getAvailable(int32_t index);
00412
00421 U_STABLE int32_t U_EXPORT2
00422 ubrk_countAvailable(void);
00423
00424
00434 U_STABLE UBool U_EXPORT2
00435 ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
00436
00446 U_STABLE int32_t U_EXPORT2
00447 ubrk_getRuleStatus(UBreakIterator *bi);
00448
00466 U_STABLE int32_t U_EXPORT2
00467 ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status);
00468
00478 U_STABLE const char* U_EXPORT2
00479 ubrk_getLocaleByType(const UBreakIterator *bi, ULocDataLocaleType type, UErrorCode* status);
00480
00481
00482 #endif
00483
00484 #endif