ICU 4.8.1.1  4.8.1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
BytesTrie::Iterator Class Reference

Iterator for all of the (byte sequence, value) pairs in a BytesTrie. More...

#include <bytestrie.h>

Inheritance diagram for BytesTrie::Iterator:
UMemory

Public Member Functions

 Iterator (const void *trieBytes, int32_t maxStringLength, UErrorCode &errorCode)
 Iterates from the root of a byte-serialized BytesTrie.
 Iterator (const BytesTrie &trie, int32_t maxStringLength, UErrorCode &errorCode)
 Iterates from the current state of the specified BytesTrie.
 ~Iterator ()
 Destructor.
Iteratorreset ()
 Resets this iterator to its initial state.
UBool hasNext () const
UBool next (UErrorCode &errorCode)
 Finds the next (byte sequence, value) pair if there is one.
const StringPiecegetString () const
int32_t getValue () const

Detailed Description

Iterator for all of the (byte sequence, value) pairs in a BytesTrie.

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

Definition at line 242 of file bytestrie.h.


Constructor & Destructor Documentation

BytesTrie::Iterator::Iterator ( const void *  trieBytes,
int32_t  maxStringLength,
UErrorCode errorCode 
)

Iterates from the root of a byte-serialized BytesTrie.

Parameters:
trieBytesThe trie bytes.
maxStringLengthIf 0, the iterator returns full strings/byte sequences. Otherwise, the iterator returns strings with this maximum length.
errorCodeStandard ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.)
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8
BytesTrie::Iterator::Iterator ( const BytesTrie trie,
int32_t  maxStringLength,
UErrorCode errorCode 
)

Iterates from the current state of the specified BytesTrie.

Parameters:
trieThe trie whose state will be copied for iteration.
maxStringLengthIf 0, the iterator returns full strings/byte sequences. Otherwise, the iterator returns strings with this maximum length.
errorCodeStandard ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.)
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Destructor.

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

Member Function Documentation

const StringPiece& BytesTrie::Iterator::getString ( ) const [inline]
Returns:
The NUL-terminated byte sequence for the last successful next().
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Definition at line 309 of file bytestrie.h.

Returns:
The value for the last successful next().
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Definition at line 314 of file bytestrie.h.

Returns:
TRUE if there are more elements.
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Finds the next (byte sequence, value) pair if there is one.

If the byte sequence is truncated to the maximum length and does not have a real value, then the value is set to -1. In this case, this "not a real value" is indistinguishable from a real value of -1.

Parameters:
errorCodeStandard ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.)
Returns:
TRUE if there is another element.
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Resets this iterator to its initial state.

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

The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines