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

- Search for |

- File List
- Globals

# ubrk.h

Go to the documentation of this file.

    00001 /*
    00002 ******************************************************************************
    00003 * Copyright (C) 1996-2007, 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
    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 /* U_HIDE_DEPRECATED_API */
    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
    00307 U_STABLE void U_EXPORT2
    00308 ubrk_setUText(UBreakIterator* bi,
    00309              UText*          text,
    00310              UErrorCode*     status);
    00311
    00312
    00313
    00322 U_STABLE int32_t U_EXPORT2
    00323 ubrk_current(const UBreakIterator *bi);
    00324
    00334 U_STABLE int32_t U_EXPORT2
    00335 ubrk_next(UBreakIterator *bi);
    00336
    00346 U_STABLE int32_t U_EXPORT2
    00347 ubrk_previous(UBreakIterator *bi);
    00348
    00357 U_STABLE int32_t U_EXPORT2
    00358 ubrk_first(UBreakIterator *bi);
    00359
    00370 U_STABLE int32_t U_EXPORT2
    00371 ubrk_last(UBreakIterator *bi);
    00372
    00382 U_STABLE int32_t U_EXPORT2
    00383 ubrk_preceding(UBreakIterator *bi,
    00384            int32_t offset);
    00385
    00395 U_STABLE int32_t U_EXPORT2
    00396 ubrk_following(UBreakIterator *bi,
    00397            int32_t offset);
    00398
    00408 U_STABLE const char* U_EXPORT2
    00409 ubrk_getAvailable(int32_t index);
    00410
    00419 U_STABLE int32_t U_EXPORT2
    00420 ubrk_countAvailable(void);
    00421
    00422
    00432 U_STABLE  UBool U_EXPORT2
    00433 ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
    00434
    00444 U_STABLE  int32_t U_EXPORT2
    00445 ubrk_getRuleStatus(UBreakIterator *bi);
    00446
    00464 U_STABLE  int32_t U_EXPORT2
    00465 ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status);
    00466
    00476 U_STABLE const char* U_EXPORT2
    00477 ubrk_getLocaleByType(const UBreakIterator *bi, ULocDataLocaleType type, UErrorCode* status);
    00478
    00479
    00480 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */
    00481
    00482 #endif