// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * * Copyright (C) 2002-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* */ #ifndef STRENUM_H #define STRENUM_H #include "unicode/utypes.h" #if U_SHOW_CPLUSPLUS_API #include "unicode/uobject.h" #include "unicode/unistr.h" /** * \file * \brief C++ API: String Enumeration */ U_NAMESPACE_BEGIN /** * Base class for 'pure' C++ implementations of uenum api. Adds a * method that returns the next UnicodeString since in C++ this can * be a common storage format for strings. * * <p>The model is that the enumeration is over strings maintained by * a 'service.' At any point, the service might change, invalidating * the enumerator (though this is expected to be rare). The iterator * returns an error if this has occurred. Lack of the error is no * guarantee that the service didn't change immediately after the * call, so the returned string still might not be 'valid' on * subsequent use.</p> * * <p>Strings may take the form of const char*, const char16_t*, or const * UnicodeString*. The type you get is determine by the variant of * 'next' that you call. In general the StringEnumeration is * optimized for one of these types, but all StringEnumerations can * return all types. Returned strings are each terminated with a NUL. * Depending on the service data, they might also include embedded NUL * characters, so API is provided to optionally return the true * length, counting the embedded NULs but not counting the terminating * NUL.</p> * * <p>The pointers returned by next, unext, and snext become invalid * upon any subsequent call to the enumeration's destructor, next, * unext, snext, or reset.</p> * * ICU 2.8 adds some default implementations and helper functions * for subclasses. * * @stable ICU 2.4 */ class U_COMMON_API StringEnumeration : public UObject { … }; U_NAMESPACE_END #endif /* U_SHOW_CPLUSPLUS_API */ /* STRENUM_H */ #endif