Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

usearch.h

Go to the documentation of this file.
00001 /*
00002 **********************************************************************
00003 *   Copyright (C) 2001 IBM and others. All rights reserved.
00004 **********************************************************************
00005 *   Date        Name        Description
00006 *  06/28/2001   synwee      Creation.
00007 **********************************************************************
00008 */
00009 #ifndef USEARCH_H
00010 #define USEARCH_H
00011 
00012 #include "unicode/utypes.h"
00013 #include "unicode/ucol.h"
00014 #include "unicode/ucoleitr.h"
00015 #include "unicode/ubrk.h"
00016 
00124 #define USEARCH_DONE -1
00125 
00129 struct UStringSearch;
00130 typedef struct UStringSearch UStringSearch;
00131 
00132 typedef enum {
00134     USEARCH_OVERLAP,
00139     USEARCH_CANONICAL_MATCH,
00140     USEARCH_ATTRIBUTE_COUNT
00141 } USearchAttribute;
00142 
00143 typedef enum {
00145     USEARCH_DEFAULT = -1,
00147     USEARCH_OFF, 
00149     USEARCH_ON,
00150     USEARCH_ATTRIBUTE_VALUE_COUNT
00151 } USearchAttributeValue;
00152 
00153 /* open and close ------------------------------------------------------ */
00154 
00177 U_CAPI UStringSearch * U_EXPORT2 usearch_open(const UChar          *pattern, 
00178                                               int32_t         patternlength, 
00179                                         const UChar          *text, 
00180                                               int32_t         textlength,
00181                                         const char           *locale,
00182                                               UBreakIterator *breakiter,
00183                                               UErrorCode     *status);
00184 
00207 U_CAPI UStringSearch * U_EXPORT2 usearch_openFromCollator(
00208                                          const UChar *pattern, 
00209                                                int32_t         patternlength,
00210                                          const UChar          *text, 
00211                                                int32_t         textlength,
00212                                          const UCollator      *collator,
00213                                                UBreakIterator *breakiter,
00214                                                UErrorCode     *status);
00215 
00222 U_CAPI void U_EXPORT2 usearch_close(UStringSearch *strsrch);
00223 
00224 /* get and set methods -------------------------------------------------- */
00225 
00239 U_CAPI void U_EXPORT2 usearch_setOffset(UStringSearch *strsrch, 
00240                                         UTextOffset    position,
00241                                         UErrorCode    *status);
00242 
00250 U_CAPI UTextOffset U_EXPORT2 usearch_getOffset(const UStringSearch *strsrch);
00251     
00263 U_CAPI void U_EXPORT2 usearch_setAttribute(UStringSearch         *strsrch, 
00264                                            USearchAttribute       attribute,
00265                                            USearchAttributeValue  value,
00266                                            UErrorCode            *status);
00267 
00276 U_CAPI USearchAttributeValue U_EXPORT2 usearch_getAttribute(
00277                                          const UStringSearch    *strsrch,
00278                                                USearchAttribute  attribute);
00279 
00294 U_CAPI UTextOffset U_EXPORT2 usearch_getMatchedStart(
00295                                                const UStringSearch *strsrch);
00296     
00309 U_CAPI int32_t U_EXPORT2 usearch_getMatchedLength(
00310                                                const UStringSearch *strsrch);
00311 
00332 U_CAPI int32_t U_EXPORT2 usearch_getMatchedText(const UStringSearch *strsrch, 
00333                                             UChar         *result, 
00334                                             int32_t        resultCapacity, 
00335                                             UErrorCode    *status);
00336 
00352 U_CAPI void U_EXPORT2 usearch_setBreakIterator(UStringSearch  *strsrch, 
00353                                                UBreakIterator *breakiter,
00354                                                UErrorCode     *status);
00355     
00367 U_CAPI const UBreakIterator * U_EXPORT2 usearch_getBreakIterator(
00368                                               const UStringSearch *strsrch);
00369     
00383 U_CAPI void U_EXPORT2 usearch_setText(      UStringSearch *strsrch, 
00384                                       const UChar         *text,
00385                                             int32_t        textlength,
00386                                             UErrorCode    *status);
00387 
00396 U_CAPI const UChar * U_EXPORT2 usearch_getText(const UStringSearch *strsrch, 
00397                                                int32_t       *length);
00398 
00409 U_CAPI UCollator * U_EXPORT2 usearch_getCollator(
00410                                                const UStringSearch *strsrch);
00411 
00422 U_CAPI void U_EXPORT2 usearch_setCollator(      UStringSearch *strsrch, 
00423                                           const UCollator     *collator,
00424                                                 UErrorCode    *status);
00425 
00438 U_CAPI void U_EXPORT2 usearch_setPattern(      UStringSearch *strsrch, 
00439                                          const UChar         *pattern,
00440                                                int32_t        patternlength,
00441                                                UErrorCode    *status);
00442 
00451 U_CAPI const UChar * U_EXPORT2 usearch_getPattern(
00452                                                const UStringSearch *strsrch, 
00453                                                      int32_t       *length);
00454 
00455 /* methods ------------------------------------------------------------- */
00456 
00470 U_CAPI UTextOffset U_EXPORT2 usearch_first(UStringSearch *strsrch, 
00471                                            UErrorCode    *status);
00472 
00491 U_CAPI UTextOffset U_EXPORT2 usearch_following(UStringSearch *strsrch, 
00492                                                UTextOffset    position, 
00493                                                UErrorCode    *status);
00494     
00508 U_CAPI UTextOffset U_EXPORT2 usearch_last(UStringSearch *strsrch, 
00509                                           UErrorCode    *status);
00510 
00528 U_CAPI UTextOffset U_EXPORT2 usearch_preceding(UStringSearch *strsrch, 
00529                                                UTextOffset    position, 
00530                                                UErrorCode    *status);
00531     
00547 U_CAPI UTextOffset U_EXPORT2 usearch_next(UStringSearch *strsrch, 
00548                                           UErrorCode    *status);
00549 
00564 U_CAPI UTextOffset U_EXPORT2 usearch_previous(UStringSearch *strsrch, 
00565                                               UErrorCode    *status);
00566     
00576 U_CAPI void U_EXPORT2 usearch_reset(UStringSearch *strsrch);
00577 
00578 #endif
00579 
00580 

Generated on Mon Dec 3 19:00:28 2001 for ICU 2.0 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001