00001
00002
00003
00004
00005
00006 #ifndef UBRK_H
00007 #define UBRK_H
00008
00009 #include "unicode/utypes.h"
00010 #include "unicode/parseerr.h"
00011
00173 #ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
00174 # define UBRK_TYPEDEF_UBREAK_ITERATOR
00175 typedef void UBreakIterator;
00176 #endif
00177
00179 enum UBreakIteratorType {
00181 UBRK_CHARACTER,
00183 UBRK_WORD,
00185 UBRK_LINE,
00187 UBRK_SENTENCE,
00189 UBRK_TITLE
00190 };
00191 typedef enum UBreakIteratorType UBreakIteratorType;
00192
00196 #define UBRK_DONE ((int32_t) -1)
00197
00198
00206 enum UWordBreak {
00209 UBRK_WORD_NONE = 0,
00211 UBRK_WORD_NONE_LIMIT = 100,
00213 UBRK_WORD_NUMBER = 100,
00215 UBRK_WORD_NUMBER_LIMIT = 200,
00218 UBRK_WORD_LETTER = 200,
00220 UBRK_WORD_LETTER_LIMIT = 300,
00222 UBRK_WORD_KANA = 300,
00224 UBRK_WORD_KANA_LIMIT = 400,
00226 UBRK_WORD_IDEO = 400,
00228 UBRK_WORD_IDEO_LIMIT = 500
00229 };
00230 typedef enum UWordBreak UWordBreak;
00231
00232
00247 U_CAPI UBreakIterator* U_EXPORT2
00248 ubrk_open(UBreakIteratorType type,
00249 const char *locale,
00250 const UChar *text,
00251 int32_t textLength,
00252 UErrorCode *status);
00253
00269 U_CAPI UBreakIterator* U_EXPORT2
00270 ubrk_openRules(const UChar *rules,
00271 int32_t rulesLength,
00272 const UChar *text,
00273 int32_t textLength,
00274 UParseError *parseErr,
00275 UErrorCode *status);
00276
00293 U_CAPI UBreakIterator * U_EXPORT2
00294 ubrk_safeClone(
00295 const UBreakIterator *bi,
00296 void *stackBuffer,
00297 int32_t *pBufferSize,
00298 UErrorCode *status);
00299
00300 #define U_BRK_SAFECLONE_BUFFERSIZE 512
00301
00308 U_CAPI void U_EXPORT2
00309 ubrk_close(UBreakIterator *bi);
00310
00319 U_CAPI void U_EXPORT2
00320 ubrk_setText(UBreakIterator* bi,
00321 const UChar* text,
00322 int32_t textLength,
00323 UErrorCode* status);
00324
00333 U_CAPI int32_t U_EXPORT2
00334 ubrk_current(const UBreakIterator *bi);
00335
00345 U_CAPI int32_t U_EXPORT2
00346 ubrk_next(UBreakIterator *bi);
00347
00357 U_CAPI int32_t U_EXPORT2
00358 ubrk_previous(UBreakIterator *bi);
00359
00368 U_CAPI int32_t U_EXPORT2
00369 ubrk_first(UBreakIterator *bi);
00370
00381 U_CAPI int32_t U_EXPORT2
00382 ubrk_last(UBreakIterator *bi);
00383
00393 U_CAPI int32_t U_EXPORT2
00394 ubrk_preceding(UBreakIterator *bi,
00395 int32_t offset);
00396
00406 U_CAPI int32_t U_EXPORT2
00407 ubrk_following(UBreakIterator *bi,
00408 int32_t offset);
00409
00419 U_CAPI const char* U_EXPORT2
00420 ubrk_getAvailable(int32_t index);
00421
00430 U_CAPI int32_t U_EXPORT2
00431 ubrk_countAvailable(void);
00432
00433
00443 U_CAPI UBool U_EXPORT2
00444 ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
00445
00455 U_CAPI int32_t U_EXPORT2
00456 ubrk_getRuleStatus(UBreakIterator *bi);
00457
00458
00459 #endif