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 #include "unicode/localpointer.h"
00015
00020 #ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
00021 # define UBRK_TYPEDEF_UBREAK_ITERATOR
00022
00026 typedef struct UBreakIterator UBreakIterator;
00027 #endif
00028
00029 #if !UCONFIG_NO_BREAK_ITERATION
00030
00031 #include "unicode/parseerr.h"
00032
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 528
00271
00278 U_STABLE void U_EXPORT2
00279 ubrk_close(UBreakIterator *bi);
00280
00281 #if U_SHOW_CPLUSPLUS_API
00282
00283 U_NAMESPACE_BEGIN
00284
00294 U_DEFINE_LOCAL_OPEN_POINTER(LocalUBreakIteratorPointer, UBreakIterator, ubrk_close);
00295
00296 U_NAMESPACE_END
00297
00298 #endif
00299
00308 U_STABLE void U_EXPORT2
00309 ubrk_setText(UBreakIterator* bi,
00310 const UChar* text,
00311 int32_t textLength,
00312 UErrorCode* status);
00313
00314
00326 U_STABLE void U_EXPORT2
00327 ubrk_setUText(UBreakIterator* bi,
00328 UText* text,
00329 UErrorCode* status);
00330
00331
00332
00341 U_STABLE int32_t U_EXPORT2
00342 ubrk_current(const UBreakIterator *bi);
00343
00353 U_STABLE int32_t U_EXPORT2
00354 ubrk_next(UBreakIterator *bi);
00355
00365 U_STABLE int32_t U_EXPORT2
00366 ubrk_previous(UBreakIterator *bi);
00367
00376 U_STABLE int32_t U_EXPORT2
00377 ubrk_first(UBreakIterator *bi);
00378
00388 U_STABLE int32_t U_EXPORT2
00389 ubrk_last(UBreakIterator *bi);
00390
00400 U_STABLE int32_t U_EXPORT2
00401 ubrk_preceding(UBreakIterator *bi,
00402 int32_t offset);
00403
00413 U_STABLE int32_t U_EXPORT2
00414 ubrk_following(UBreakIterator *bi,
00415 int32_t offset);
00416
00426 U_STABLE const char* U_EXPORT2
00427 ubrk_getAvailable(int32_t index);
00428
00437 U_STABLE int32_t U_EXPORT2
00438 ubrk_countAvailable(void);
00439
00440
00450 U_STABLE UBool U_EXPORT2
00451 ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
00452
00462 U_STABLE int32_t U_EXPORT2
00463 ubrk_getRuleStatus(UBreakIterator *bi);
00464
00482 U_STABLE int32_t U_EXPORT2
00483 ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status);
00484
00494 U_STABLE const char* U_EXPORT2
00495 ubrk_getLocaleByType(const UBreakIterator *bi, ULocDataLocaleType type, UErrorCode* status);
00496
00497 #ifndef U_HIDE_DRAFT_API
00498
00523 U_DRAFT void U_EXPORT2
00524 ubrk_refreshUText(UBreakIterator *bi,
00525 UText *text,
00526 UErrorCode *status);
00527 #endif
00528
00529 #endif
00530
00531 #endif