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

- File List
- Globals

# ubrk.h

Go to the documentation of this file.

    00001 /*
    00002 ******************************************************************************
    00003 * Copyright (C) 1996-2010, 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 #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 /* 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
    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
    00389 U_STABLE int32_t U_EXPORT2
    00390 ubrk_last(UBreakIterator *bi);
    00391
    00401 U_STABLE int32_t U_EXPORT2
    00402 ubrk_preceding(UBreakIterator *bi,
    00403            int32_t offset);
    00404
    00414 U_STABLE int32_t U_EXPORT2
    00415 ubrk_following(UBreakIterator *bi,
    00416            int32_t offset);
    00417
    00427 U_STABLE const char* U_EXPORT2
    00428 ubrk_getAvailable(int32_t index);
    00429
    00438 U_STABLE int32_t U_EXPORT2
    00439 ubrk_countAvailable(void);
    00440
    00441
    00451 U_STABLE  UBool U_EXPORT2
    00452 ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
    00453
    00463 U_STABLE  int32_t U_EXPORT2
    00464 ubrk_getRuleStatus(UBreakIterator *bi);
    00465
    00483 U_STABLE  int32_t U_EXPORT2
    00484 ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status);
    00485
    00495 U_STABLE const char* U_EXPORT2
    00496 ubrk_getLocaleByType(const UBreakIterator *bi, ULocDataLocaleType type, UErrorCode* status);
    00497
    00498
    00499 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */
    00500
    00501 #endif

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines