ICU 4.8.1.1
4.8.1.1
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
i18n
unicode
usearch.h
Go to the documentation of this file.
1
/*
2
**********************************************************************
3
* Copyright (C) 2001-2011 IBM and others. All rights reserved.
4
**********************************************************************
5
* Date Name Description
6
* 06/28/2001 synwee Creation.
7
**********************************************************************
8
*/
9
#ifndef USEARCH_H
10
#define USEARCH_H
11
12
#include "
unicode/utypes.h
"
13
14
#if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION
15
16
#include "
unicode/localpointer.h
"
17
#include "
unicode/ucol.h
"
18
#include "
unicode/ucoleitr.h
"
19
#include "
unicode/ubrk.h
"
20
140
#define USEARCH_DONE -1
141
146
struct
UStringSearch
;
151
typedef
struct
UStringSearch
UStringSearch
;
152
156
typedef
enum
{
158
USEARCH_OVERLAP
,
163
USEARCH_CANONICAL_MATCH
,
169
USEARCH_ELEMENT_COMPARISON
,
170
171
USEARCH_ATTRIBUTE_COUNT
172
}
USearchAttribute
;
173
177
typedef
enum
{
179
USEARCH_DEFAULT
= -1,
181
USEARCH_OFF
,
183
USEARCH_ON
,
190
USEARCH_STANDARD_ELEMENT_COMPARISON
,
204
USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
,
218
USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
,
219
220
USEARCH_ATTRIBUTE_VALUE_COUNT
221
}
USearchAttributeValue
;
222
223
/* open and close ------------------------------------------------------ */
224
247
U_STABLE
UStringSearch
*
U_EXPORT2
usearch_open
(
const
UChar
*pattern,
248
int32_t patternlength,
249
const
UChar
*text,
250
int32_t textlength,
251
const
char
*locale,
252
UBreakIterator
*breakiter,
253
UErrorCode
*status);
254
279
U_STABLE
UStringSearch
*
U_EXPORT2
usearch_openFromCollator
(
280
const
UChar
*pattern,
281
int32_t patternlength,
282
const
UChar
*text,
283
int32_t textlength,
284
const
UCollator
*collator,
285
UBreakIterator
*breakiter,
286
UErrorCode
*status);
287
294
U_STABLE
void
U_EXPORT2
usearch_close
(
UStringSearch
*searchiter);
295
296
#if U_SHOW_CPLUSPLUS_API
297
298
U_NAMESPACE_BEGIN
299
309
U_DEFINE_LOCAL_OPEN_POINTER(LocalUStringSearchPointer,
UStringSearch
,
usearch_close
);
310
311
U_NAMESPACE_END
312
313
#endif
314
315
/* get and set methods -------------------------------------------------- */
316
332
U_STABLE
void
U_EXPORT2
usearch_setOffset
(
UStringSearch
*strsrch,
333
int32_t position,
334
UErrorCode
*status);
335
344
U_STABLE
int32_t
U_EXPORT2
usearch_getOffset
(
const
UStringSearch
*strsrch);
345
357
U_STABLE
void
U_EXPORT2
usearch_setAttribute
(
UStringSearch
*strsrch,
358
USearchAttribute
attribute,
359
USearchAttributeValue
value,
360
UErrorCode
*status);
361
370
U_STABLE
USearchAttributeValue
U_EXPORT2
usearch_getAttribute
(
371
const
UStringSearch
*strsrch,
372
USearchAttribute
attribute);
373
393
U_STABLE
int32_t
U_EXPORT2
usearch_getMatchedStart
(
394
const
UStringSearch
*strsrch);
395
413
U_STABLE
int32_t
U_EXPORT2
usearch_getMatchedLength
(
414
const
UStringSearch
*strsrch);
415
441
U_STABLE
int32_t
U_EXPORT2
usearch_getMatchedText
(
const
UStringSearch
*strsrch,
442
UChar
*result,
443
int32_t resultCapacity,
444
UErrorCode
*status);
445
446
#if !UCONFIG_NO_BREAK_ITERATION
447
463
U_STABLE
void
U_EXPORT2
usearch_setBreakIterator
(
UStringSearch
*strsrch,
464
UBreakIterator
*breakiter,
465
UErrorCode
*status);
466
478
U_STABLE
const
UBreakIterator
*
U_EXPORT2
usearch_getBreakIterator
(
479
const
UStringSearch
*strsrch);
480
481
#endif
482
496
U_STABLE
void
U_EXPORT2
usearch_setText
(
UStringSearch
*strsrch,
497
const
UChar
*text,
498
int32_t textlength,
499
UErrorCode
*status);
500
509
U_STABLE
const
UChar
*
U_EXPORT2
usearch_getText
(
const
UStringSearch
*strsrch,
510
int32_t *length);
511
522
U_STABLE
UCollator
*
U_EXPORT2
usearch_getCollator
(
523
const
UStringSearch
*strsrch);
524
535
U_STABLE
void
U_EXPORT2
usearch_setCollator
(
UStringSearch
*strsrch,
536
const
UCollator
*collator,
537
UErrorCode
*status);
538
551
U_STABLE
void
U_EXPORT2
usearch_setPattern
(
UStringSearch
*strsrch,
552
const
UChar
*pattern,
553
int32_t patternlength,
554
UErrorCode
*status);
555
564
U_STABLE
const
UChar
*
U_EXPORT2
usearch_getPattern
(
565
const
UStringSearch
*strsrch,
566
int32_t *length);
567
568
/* methods ------------------------------------------------------------- */
569
585
U_STABLE
int32_t
U_EXPORT2
usearch_first
(
UStringSearch
*strsrch,
586
UErrorCode
*status);
587
609
U_STABLE
int32_t
U_EXPORT2
usearch_following
(
UStringSearch
*strsrch,
610
int32_t position,
611
UErrorCode
*status);
612
628
U_STABLE
int32_t
U_EXPORT2
usearch_last
(
UStringSearch
*strsrch,
629
UErrorCode
*status);
630
656
U_STABLE
int32_t
U_EXPORT2
usearch_preceding
(
UStringSearch
*strsrch,
657
int32_t position,
658
UErrorCode
*status);
659
677
U_STABLE
int32_t
U_EXPORT2
usearch_next
(
UStringSearch
*strsrch,
678
UErrorCode
*status);
679
697
U_STABLE
int32_t
U_EXPORT2
usearch_previous
(
UStringSearch
*strsrch,
698
UErrorCode
*status);
699
710
U_STABLE
void
U_EXPORT2
usearch_reset
(
UStringSearch
*strsrch);
711
766
U_INTERNAL
UBool
U_EXPORT2
usearch_search
(
UStringSearch
*strsrch,
767
int32_t startIdx,
768
int32_t *matchStart,
769
int32_t *matchLimit,
770
UErrorCode
*status);
771
826
U_INTERNAL
UBool
U_EXPORT2
usearch_searchBackwards
(
UStringSearch
*strsrch,
827
int32_t startIdx,
828
int32_t *matchStart,
829
int32_t *matchLimit,
830
UErrorCode
*status);
831
832
#endif
/* #if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION */
833
834
#endif
Generated on Wed Nov 27 2019 19:32:14 for ICU 4.8.1.1 by
1.8.1.2