The model is that the enumeration is over strings maintained by 35 * a 'service.' At any point, the service might change, invalidating 36 * the enumerator (though this is expected to be rare). The iterator 37 * returns an error if this has occurred. Lack of the error is no 38 * guarantee that the service didn't change immediately after the 39 * call, so the returned string still might not be 'valid' on 40 * subsequent use.
Strings may take the form of const char*, const char16_t*, or const 43 * UnicodeString*. The type you get is determine by the variant of 44 * 'next' that you call. In general the StringEnumeration is 45 * optimized for one of these types, but all StringEnumerations can 46 * return all types. Returned strings are each terminated with a NUL. 47 * Depending on the service data, they might also include embedded NUL 48 * characters, so API is provided to optionally return the true 49 * length, counting the embedded NULs but not counting the terminating 50 * NUL.
The pointers returned by next, unext, and snext become invalid 53 * upon any subsequent call to the enumeration's destructor, next, 54 * unext, snext, or reset.
Return the number of elements that the iterator traverses. If 85 * the iterator is out of sync with its service, status is set to 86 * U_ENUM_OUT_OF_SYNC_ERROR, and the return value is zero.
The return value will not change except possibly as a result of 89 * a subsequent call to reset, or if the iterator becomes out of sync.
This is a convenience function. It can end up being very 92 * expensive as all the items might have to be pre-fetched 93 * (depending on the storage format of the data being 94 * traversed).
Returns the next element as a NUL-terminated char*. If there 104 * are no more elements, returns nullptr. If the resultLength pointer 105 * is not nullptr, the length of the string (not counting the 106 * terminating NUL) is returned at that address. If an error 107 * status is returned, the value at resultLength is undefined.
The returned pointer is owned by this iterator and must not be 110 * deleted by the caller. The pointer is valid until the next call 111 * to next, unext, snext, reset, or the enumerator's destructor.
If the iterator is out of sync with its service, status is set 114 * to U_ENUM_OUT_OF_SYNC_ERROR and nullptr is returned.
If the native service string is a char16_t* string, it is 117 * converted to char* with the invariant converter. If the 118 * conversion fails (because a character cannot be converted) then 119 * status is set to U_INVARIANT_CONVERSION_ERROR and the return 120 * value is undefined (though not nullptr).
Returns the next element as a NUL-terminated char16_t*. If there 136 * are no more elements, returns nullptr. If the resultLength pointer 137 * is not nullptr, the length of the string (not counting the 138 * terminating NUL) is returned at that address. If an error 139 * status is returned, the value at resultLength is undefined.
The returned pointer is owned by this iterator and must not be 142 * deleted by the caller. The pointer is valid until the next call 143 * to next, unext, snext, reset, or the enumerator's destructor.
If the iterator is out of sync with its service, status is set 146 * to U_ENUM_OUT_OF_SYNC_ERROR and nullptr is returned.
Returns the next element a UnicodeString*. If there are no 161 * more elements, returns nullptr.
The returned pointer is owned by this iterator and must not be 164 * deleted by the caller. The pointer is valid until the next call 165 * to next, unext, snext, reset, or the enumerator's destructor.
If the iterator is out of sync with its service, status is set 168 * to U_ENUM_OUT_OF_SYNC_ERROR and nullptr is returned.
Resets the iterator. This re-establishes sync with the 183 * service and rewinds the iterator to start at the first 184 * element.
Previous pointers returned by next, unext, or snext become 187 * invalid, and the value returned by count might change.