]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/unicode/brkiter.h
ICU-59173.0.1.tar.gz
[apple/icu.git] / icuSources / common / unicode / brkiter.h
index 6fc9fefa5b9a97cc7021c841214bf1cee3bed977..98560e55ec761ba01d801a067c8a30bd224d3ad1 100644 (file)
@@ -1,6 +1,8 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 ********************************************************************************
-*   Copyright (C) 1997-2014, International Business Machines
+*   Copyright (C) 1997-2016, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 ********************************************************************************
 *
@@ -29,6 +31,7 @@
 
 #if UCONFIG_NO_BREAK_ITERATION
 
+#if U_SHOW_CPLUSPLUS_API
 U_NAMESPACE_BEGIN
 
 /*
@@ -38,6 +41,7 @@ U_NAMESPACE_BEGIN
 class BreakIterator;
 
 U_NAMESPACE_END
+#endif // U_SHOW_CPLUSPLUS_API
 
 #else
 
@@ -50,6 +54,7 @@ U_NAMESPACE_END
 #include "unicode/utext.h"
 #include "unicode/umisc.h"
 
+#if U_SHOW_CPLUSPLUS_API
 U_NAMESPACE_BEGIN
 
 /**
@@ -168,6 +173,11 @@ public:
     /**
      * Change the text over which this operates. The text boundary is
      * reset to the start.
+     *
+     * The BreakIterator will retain a reference to the supplied string.
+     * The caller must not modify or delete the text while the BreakIterator
+     * retains the reference.
+     *
      * @param text The UnicodeString used to change the text.
      * @stable ICU 2.0
      */
@@ -213,8 +223,8 @@ public:
     };
 
     /**
-     * Set the iterator position to the index of the first character in the text being scanned.
-     * @return The index of the first character in the text being scanned.
+     * Sets the current iteration position to the beginning of the text, position zero.
+     * @return The offset of the beginning of the text, zero.
      * @stable ICU 2.0
      */
     virtual int32_t first(void) = 0;
@@ -291,7 +301,7 @@ public:
     virtual int32_t next(int32_t n) = 0;
 
    /**
-     * For RuleBasedBreakIterators, return the status tag from the 
+     * For RuleBasedBreakIterators, return the status tag from the
      * break rule that determined the most recently
      * returned break position.
      * <p>
@@ -302,12 +312,12 @@ public:
      *         returned break position.
      * @see RuleBaseBreakIterator::getRuleStatus()
      * @see UWordBreak
-     * @draft ICU 52
+     * @stable ICU 52
      */
     virtual int32_t getRuleStatus() const;
 
    /**
-    * For RuleBasedBreakIterators, get the status (tag) values from the break rule(s) 
+    * For RuleBasedBreakIterators, get the status (tag) values from the break rule(s)
     * that determined the most recently returned break position.
     * <p>
     * For break iterator types that do not support rule status,
@@ -332,7 +342,7 @@ public:
     *                  is the total number of status values that were available,
     *                  not the reduced number that were actually returned.
     * @see getRuleStatus
-    * @draft ICU 52
+    * @stable ICU 52
     */
     virtual int32_t getRuleStatusVec(int32_t *fillInVec, int32_t capacity, UErrorCode &status);
 
@@ -623,8 +633,12 @@ protected:
     BreakIterator();
     /** @internal */
     BreakIterator (const BreakIterator &other) : UObject(other) {}
+#ifndef U_HIDE_INTERNAL_API
     /** @internal */
     BreakIterator (const Locale& valid, const Locale& actual);
+#endif  /* U_HIDE_INTERNAL_API */
+    UBool fKeepAll;
+
 private:
 
     /** @internal */
@@ -636,8 +650,14 @@ private:
      * It's provided to make the compiler happy. Do not call.
      */
     BreakIterator& operator=(const BreakIterator&);
+    void setKeepAll(UBool keepAll);
 };
 
+inline void BreakIterator::setKeepAll(UBool keepAll)
+{
+    fKeepAll = keepAll;
+}
+
 #ifndef U_HIDE_DEPRECATED_API
 
 inline UBool BreakIterator::isBufferClone()
@@ -648,6 +668,7 @@ inline UBool BreakIterator::isBufferClone()
 #endif /* U_HIDE_DEPRECATED_API */
 
 U_NAMESPACE_END
+#endif // U_SHOW_CPLUSPLUS_API
 
 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */