- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- Search for |

- File List
- Globals

# ubrk.h

Go to the documentation of this file.

    00001 /*
    00002 ******************************************************************************
    00003 * Copyright (C) 1996-2009, International Business Machines Corporation and others.
    00004 * All Rights Reserved.
    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
    00086 typedef enum UBreakIteratorType {
    00088   UBRK_CHARACTER = 0,
    00090   UBRK_WORD = 1,
    00092   UBRK_LINE = 2,
    00094   UBRK_SENTENCE = 3,
    00095
    00096 #ifndef U_HIDE_DEPRECATED_API
    00097
    00105   UBRK_TITLE = 4,
    00106 #endif /* U_HIDE_DEPRECATED_API */
    00107   UBRK_COUNT = 5
    00108 } UBreakIteratorType;
    00109
    00113 #define UBRK_DONE ((int32_t) -1)
    00114
    00115
    00124 typedef enum UWordBreak {
    00127     UBRK_WORD_NONE           = 0,
    00129     UBRK_WORD_NONE_LIMIT     = 100,
    00131     UBRK_WORD_NUMBER         = 100,
    00133     UBRK_WORD_NUMBER_LIMIT   = 200,
    00136     UBRK_WORD_LETTER         = 200,
    00138     UBRK_WORD_LETTER_LIMIT   = 300,
    00140     UBRK_WORD_KANA           = 300,
    00142     UBRK_WORD_KANA_LIMIT     = 400,
    00144     UBRK_WORD_IDEO           = 400,
    00146     UBRK_WORD_IDEO_LIMIT     = 500
    00147 } UWordBreak;
    00148
    00157 typedef enum ULineBreakTag {
    00160     UBRK_LINE_SOFT            = 0,
    00162     UBRK_LINE_SOFT_LIMIT      = 100,
    00164     UBRK_LINE_HARD            = 100,
    00166     UBRK_LINE_HARD_LIMIT      = 200
    00167 } ULineBreakTag;
    00168
    00169
    00170
    00179 typedef enum USentenceBreakTag {
    00184     UBRK_SENTENCE_TERM       = 0,
    00186     UBRK_SENTENCE_TERM_LIMIT = 100,
    00191     UBRK_SENTENCE_SEP        = 100,
    00193     UBRK_SENTENCE_SEP_LIMIT  = 200
    00195 } USentenceBreakTag;
    00196
    00197
    00212 U_STABLE UBreakIterator* U_EXPORT2
    00213 ubrk_open(UBreakIteratorType type,
    00214       const char *locale,
    00215       const UChar *text,
    00216       int32_t textLength,
    00217       UErrorCode *status);
    00218
    00234 U_STABLE UBreakIterator* U_EXPORT2
    00235 ubrk_openRules(const UChar     *rules,
    00236                int32_t         rulesLength,
    00237                const UChar     *text,
    00238                int32_t          textLength,
    00239                UParseError     *parseErr,
    00240                UErrorCode      *status);
    00241
    00258 U_STABLE UBreakIterator * U_EXPORT2
    00259 ubrk_safeClone(
    00260           const UBreakIterator *bi,
    00261           void *stackBuffer,
    00262           int32_t *pBufferSize,
    00263           UErrorCode *status);
    00264
    00269 #define U_BRK_SAFECLONE_BUFFERSIZE 512
    00270
    00277 U_STABLE void U_EXPORT2
    00278 ubrk_close(UBreakIterator *bi);
    00279
    00288 U_STABLE void U_EXPORT2
    00289 ubrk_setText(UBreakIterator* bi,
    00290              const UChar*    text,
    00291              int32_t         textLength,
    00292              UErrorCode*     status);
    00293
    00294
    00306 U_STABLE void U_EXPORT2
    00307 ubrk_setUText(UBreakIterator* bi,
    00308              UText*          text,
    00309              UErrorCode*     status);
    00310
    00311
    00312
    00321 U_STABLE int32_t U_EXPORT2
    00322 ubrk_current(const UBreakIterator *bi);
    00323
    00333 U_STABLE int32_t U_EXPORT2
    00334 ubrk_next(UBreakIterator *bi);
    00335
    00345 U_STABLE int32_t U_EXPORT2
    00346 ubrk_previous(UBreakIterator *bi);
    00347
    00356 U_STABLE int32_t U_EXPORT2
    00357 ubrk_first(UBreakIterator *bi);
    00358
    00369 U_STABLE int32_t U_EXPORT2
    00370 ubrk_last(UBreakIterator *bi);
    00371
    00381 U_STABLE int32_t U_EXPORT2
    00382 ubrk_preceding(UBreakIterator *bi,
    00383            int32_t offset);
    00384
    00394 U_STABLE int32_t U_EXPORT2
    00395 ubrk_following(UBreakIterator *bi,
    00396            int32_t offset);
    00397
    00407 U_STABLE const char* U_EXPORT2
    00408 ubrk_getAvailable(int32_t index);
    00409
    00418 U_STABLE int32_t U_EXPORT2
    00419 ubrk_countAvailable(void);
    00420
    00421
    00431 U_STABLE  UBool U_EXPORT2
    00432 ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
    00433
    00443 U_STABLE  int32_t U_EXPORT2
    00444 ubrk_getRuleStatus(UBreakIterator *bi);
    00445
    00463 U_STABLE  int32_t U_EXPORT2
    00464 ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status);
    00465
    00475 U_STABLE const char* U_EXPORT2
    00476 ubrk_getLocaleByType(const UBreakIterator *bi, ULocDataLocaleType type, UErrorCode* status);
    00477
    00478
    00479 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */
    00480
    00481 #endif