+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
-* Copyright (C) 2011-2013 International Business Machines
+* Copyright (C) 2011-2014 International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
#define INDEXCHARS_H
#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
#include "unicode/uobject.h"
#include "unicode/locid.h"
+#include "unicode/unistr.h"
-
-#if !UCONFIG_NO_COLLATION && !UCONFIG_NO_NORMALIZATION
+#if !UCONFIG_NO_COLLATION
/**
* \file
*/
class U_I18N_API AlphabeticIndex: public UObject {
public:
-#ifdef U_HIDE_DRAFT_API
- class Bucket;
-#else
/**
* An index "bucket" with a label string and type.
* It is referenced by getBucketIndex(),
* and returned by ImmutableIndex.getBucket().
*
* The Bucket class is not intended for public subclassing.
- * @draft ICU 51
+ * @stable ICU 51
*/
class U_I18N_API Bucket : public UObject {
public:
/**
* Destructor.
- * @draft ICU 51
+ * @stable ICU 51
*/
virtual ~Bucket();
* Returns the label string.
*
* @return the label string for the bucket
- * @draft ICU 51
+ * @stable ICU 51
*/
const UnicodeString &getLabel() const { return label_; }
/**
* Returns whether this bucket is a normal, underflow, overflow, or inflow bucket.
*
* @return the bucket label type
- * @draft ICU 51
+ * @stable ICU 51
*/
UAlphabeticIndexLabelType getLabelType() const { return labelType_; }
*
* The ImmutableIndex class is not intended for public subclassing.
*
- * @draft ICU 51
+ * @stable ICU 51
*/
class U_I18N_API ImmutableIndex : public UObject {
public:
/**
* Destructor.
- * @draft ICU 51
+ * @stable ICU 51
*/
virtual ~ImmutableIndex();
* Returns the number of index buckets and labels, including underflow/inflow/overflow.
*
* @return the number of index buckets
- * @draft ICU 51
+ * @stable ICU 51
*/
int32_t getBucketCount() const;
* Use getBucket() to get the bucket's properties.
*
* @param name the string to be sorted into an index bucket
+ * @param errorCode Error code, will be set with the reason if the
+ * operation fails.
* @return the bucket number for the name
- * @draft ICU 51
+ * @stable ICU 51
*/
int32_t getBucketIndex(const UnicodeString &name, UErrorCode &errorCode) const;
*
* @param index bucket number
* @return the index-th bucket
- * @draft ICU 51
+ * @stable ICU 51
*/
const Bucket *getBucket(int32_t index) const;
BucketList *buckets_;
Collator *collatorPrimaryOnly_;
};
-#endif /* U_HIDE_DRAFT_API */
/**
* Construct an AlphabeticIndex object for the specified locale. If the locale's
*/
AlphabeticIndex(const Locale &locale, UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Construct an AlphabeticIndex that uses a specific collator.
*
* @param collator The collator to use to order the contents of this index.
* @param status Error code, will be set with the reason if the
* operation fails.
- * @draft ICU 51
+ * @stable ICU 51
*/
AlphabeticIndex(RuleBasedCollator *collator, UErrorCode &status);
-#endif /* U_HIDE_DRAFT_API */
/**
* Add Labels to this Index. The labels are additions to those
*/
virtual ~AlphabeticIndex();
-#ifndef U_HIDE_DRAFT_API
/**
* Builds an immutable, thread-safe version of this instance, without data records.
*
* @return an immutable index instance
- * @draft ICU 51
+ * @stable ICU 51
*/
ImmutableIndex *buildImmutableIndex(UErrorCode &errorCode);
-#endif /* U_HIDE_DRAFT_API */
/**
* Get the Collator that establishes the ordering of the items in this index.
/**
- * Get the default label used for abbreviated buckets <i>between</i> other index characters.
- * For example, consider the labels when Latin and Greek are used:
- * X Y Z ... Α Β Γ.
+ * Get the default label used for abbreviated buckets *between* other index characters.
+ * For example, consider the labels when Latin (X Y Z) and Greek (Α Β Γ) are used:
+ *
+ * X Y Z ... Α Β Γ.
*
* @return inflow label
* @stable ICU 4.8
/**
* No assignment.
*/
- AlphabeticIndex &operator =(const AlphabeticIndex & /*other*/) { return *this;};
+ AlphabeticIndex &operator =(const AlphabeticIndex & /*other*/) { return *this;}
/**
* No Equality operators.
/**
* A (name, data) pair, to be sorted by name into one of the index buckets.
* The user data is not used by the index implementation.
+ * \cond
* @internal
*/
struct Record: public UMemory {
Record(const UnicodeString &name, const void *data);
~Record();
};
+ /** \endcond */
#endif /* U_HIDE_INTERNAL_API */
private:
U_NAMESPACE_END
-#endif /* UCONFIG_NO_COLLATION / UCONFIG_NO_NORMALIZATION */
+#endif // !UCONFIG_NO_COLLATION
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
#endif