ICU 4.8.1.1  4.8.1.1
Defines | Enumerations
ustringtrie.h File Reference

C API: Helper definitions for dictionary trie APIs. More...

#include "unicode/utypes.h"

Go to the source code of this file.

Defines

#define USTRINGTRIE_MATCHES(result)   ((result)!=USTRINGTRIE_NO_MATCH)
 Same as (result!=USTRINGTRIE_NO_MATCH).
#define USTRINGTRIE_HAS_VALUE(result)   ((result)>=USTRINGTRIE_FINAL_VALUE)
 Equivalent to (result==USTRINGTRIE_INTERMEDIATE_VALUE || result==USTRINGTRIE_FINAL_VALUE) but this macro evaluates result exactly once.
#define USTRINGTRIE_HAS_NEXT(result)   ((result)&1)
 Equivalent to (result==USTRINGTRIE_NO_VALUE || result==USTRINGTRIE_INTERMEDIATE_VALUE) but this macro evaluates result exactly once.

Enumerations

enum  UStringTrieResult { USTRINGTRIE_NO_MATCH, USTRINGTRIE_NO_VALUE, USTRINGTRIE_FINAL_VALUE, USTRINGTRIE_INTERMEDIATE_VALUE }
 Return values for BytesTrie::next(), UCharsTrie::next() and similar methods. More...

Detailed Description

C API: Helper definitions for dictionary trie APIs.

Definition in file ustringtrie.h.


Define Documentation

#define USTRINGTRIE_HAS_NEXT (   result)    ((result)&1)

Equivalent to (result==USTRINGTRIE_NO_VALUE || result==USTRINGTRIE_INTERMEDIATE_VALUE) but this macro evaluates result exactly once.

Parameters:
resultA result from BytesTrie::first(), UCharsTrie::next() etc.
Returns:
true if another input byte/unit can continue a matching string.
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Definition at line 92 of file ustringtrie.h.

Referenced by UCharsTrie::firstForCodePoint(), and UCharsTrie::nextForCodePoint().

#define USTRINGTRIE_HAS_VALUE (   result)    ((result)>=USTRINGTRIE_FINAL_VALUE)

Equivalent to (result==USTRINGTRIE_INTERMEDIATE_VALUE || result==USTRINGTRIE_FINAL_VALUE) but this macro evaluates result exactly once.

Parameters:
resultA result from BytesTrie::first(), UCharsTrie::next() etc.
Returns:
true if there is a value for the input bytes/units so far.
See also:
BytesTrie::getValue
UCharsTrie::getValue
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Definition at line 83 of file ustringtrie.h.

#define USTRINGTRIE_MATCHES (   result)    ((result)!=USTRINGTRIE_NO_MATCH)

Same as (result!=USTRINGTRIE_NO_MATCH).

Parameters:
resultA result from BytesTrie::first(), UCharsTrie::next() etc.
Returns:
true if the input bytes/units so far are part of a matching string/byte sequence.
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Definition at line 72 of file ustringtrie.h.


Enumeration Type Documentation

Return values for BytesTrie::next(), UCharsTrie::next() and similar methods.

See also:
USTRINGTRIE_MATCHES
USTRINGTRIE_HAS_VALUE
USTRINGTRIE_HAS_NEXT
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8
Enumerator:
USTRINGTRIE_NO_MATCH 

The input unit(s) did not continue a matching string.

Once current()/next() return USTRINGTRIE_NO_MATCH, all further calls to current()/next() will also return USTRINGTRIE_NO_MATCH, until the trie is reset to its original state or to a saved state.

Draft:
This API may be changed in the future versions and was introduced in ICU 4.8
USTRINGTRIE_NO_VALUE 

The input unit(s) continued a matching string but there is no value for the string so far.

(It is a prefix of a longer string.)

Draft:
This API may be changed in the future versions and was introduced in ICU 4.8
USTRINGTRIE_FINAL_VALUE 

The input unit(s) continued a matching string and there is a value for the string so far.

This value will be returned by getValue(). No further input byte/unit can continue a matching string.

Draft:
This API may be changed in the future versions and was introduced in ICU 4.8
USTRINGTRIE_INTERMEDIATE_VALUE 

The input unit(s) continued a matching string and there is a value for the string so far.

This value will be returned by getValue(). Another input byte/unit can continue a matching string.

Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Definition at line 32 of file ustringtrie.h.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines