]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - icu/unicode/uenum.h
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / icu / unicode / uenum.h
index 63690f8b2cd679e2ae50ec7bf79ce4d758a508f7..0e7d90cc5ca0b9c0608df8b89fd0768d19f5c688 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2002-2004, International Business Machines
+*   Copyright (C) 2002-2010, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
 #define __UENUM_H
 
 #include "unicode/utypes.h"
+#include "unicode/localpointer.h"
+
+#if U_SHOW_CPLUSPLUS_API
+#include "unicode/strenum.h"
+#endif
 
+/**
+ * \file
+ * \brief C API: String Enumeration 
+ */
 /**
  * An enumeration object.
  * For usage in C programs.
@@ -38,6 +48,25 @@ typedef struct UEnumeration UEnumeration;
 U_STABLE void U_EXPORT2
 uenum_close(UEnumeration* en);
 
+#if U_SHOW_CPLUSPLUS_API
+
+U_NAMESPACE_BEGIN
+
+/**
+ * \class LocalUEnumerationPointer
+ * "Smart pointer" class, closes a UEnumeration via uenum_close().
+ * For most methods see the LocalPointerBase base class.
+ *
+ * @see LocalPointerBase
+ * @see LocalPointer
+ * @stable ICU 4.4
+ */
+U_DEFINE_LOCAL_OPEN_POINTER(LocalUEnumerationPointer, UEnumeration, uenum_close);
+
+U_NAMESPACE_END
+
+#endif
+
 /**
  * Returns the number of elements that the iterator traverses.  If
  * the iterator is out-of-sync with its service, status is set to
@@ -126,4 +155,20 @@ uenum_next(UEnumeration* en,
 U_STABLE void U_EXPORT2
 uenum_reset(UEnumeration* en, UErrorCode* status);
 
+#if U_SHOW_CPLUSPLUS_API
+
+/**
+ * Given a StringEnumeration, wrap it in a UEnumeration.  The
+ * StringEnumeration is adopted; after this call, the caller must not
+ * delete it (regardless of error status).
+ * @param adopted the C++ StringEnumeration to be wrapped in a UEnumeration.
+ * @param ec the error code.
+ * @return a UEnumeration wrapping the adopted StringEnumeration.
+ * @draft ICU 4.2
+ */
+U_CAPI UEnumeration* U_EXPORT2
+uenum_openFromStringEnumeration(U_NAMESPACE_QUALIFIER StringEnumeration* adopted, UErrorCode* ec);
+
+#endif
+
 #endif