16f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/*
26f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org**********************************************************************
36f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*   Copyright (C) 1998-2013, International Business Machines
46f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*   Corporation and others.  All Rights Reserved.
56f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org**********************************************************************
66f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*
76f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* File unistr.h
86f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*
96f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* Modification History:
106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*
116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*   Date        Name        Description
126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*   09/25/98    stephen     Creation.
136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*   11/11/98    stephen     Changed per 11/9 code review.
146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*   04/20/99    stephen     Overhauled per 4/16 code review.
156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*   11/18/99    aliu        Made to inherit from Replaceable.  Added method
166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*                           handleReplaceBetween(); other methods unchanged.
176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*   06/25/01    grhoten     Remove dependency on iostream.
186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org******************************************************************************
196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*/
206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#ifndef UNISTR_H
226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#define UNISTR_H
236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \file
266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \brief C++ API: Unicode String
276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#include "unicode/utypes.h"
306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#include "unicode/rep.h"
316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#include "unicode/std_string.h"
326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#include "unicode/stringpiece.h"
336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#include "unicode/bytestream.h"
346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#include "unicode/ucasemap.h"
356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgstruct UConverter;          // unicode/ucnv.h
376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgclass  StringThreadTest;
386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#ifndef U_COMPARE_CODE_POINT_ORDER
406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/* see also ustring.h and unorm.h */
416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc:
436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Compare strings in code point order instead of code unit order.
446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.2
456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#define U_COMPARE_CODE_POINT_ORDER  0x8000
476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif
486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#ifndef USTRING_H
506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \ingroup ustring_ustrlen
526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE int32_t U_EXPORT2
546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgu_strlen(const UChar *s);
556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif
566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \def U_STRING_CASE_MAPPER_DEFINED
596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @internal
606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#ifndef U_STRING_CASE_MAPPER_DEFINED
626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#define U_STRING_CASE_MAPPER_DEFINED
636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Internal string case mapping function type.
666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @internal
676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef int32_t U_CALLCONV
696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgUStringCaseMapper(const UCaseMap *csm,
706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                  UChar *dest, int32_t destCapacity,
716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                  const UChar *src, int32_t srcLength,
726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                  UErrorCode *pErrorCode);
736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif
756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_NAMESPACE_BEGIN
776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgclass BreakIterator;        // unicode/brkiter.h
796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgclass Locale;               // unicode/locid.h
806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgclass StringCharacterIterator;
816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgclass UnicodeStringAppendable;  // unicode/appendable.h
826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/* The <iostream> include has been moved to unicode/ustream.h */
846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Constant to be used in the UnicodeString(char *, int32_t, EInvariant) constructor
876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * which constructs a Unicode string from an invariant-character char * string.
886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * About invariant characters see utypes.h.
896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * This constructor has no runtime dependency on conversion code and is
906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * therefore recommended over ones taking a charset name string
916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * (where the empty string "" indicates invariant-character conversion).
926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 3.2
946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#define US_INV icu::UnicodeString::kInvariant
966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Unicode String literals in C++.
996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Dependent on the platform properties, different UnicodeString
1006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * constructors should be used to create a UnicodeString object from
1016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * a string literal.
1026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The macros are defined for maximum performance.
1036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * They work only for strings that contain "invariant characters", i.e.,
1046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * only latin letters, digits, and some punctuation.
1056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * See utypes.h for details.
1066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The string parameter must be a C string literal.
1086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The length of the string, not including the terminating
1096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <code>NUL</code>, must be specified as a constant.
1106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The U_STRING_DECL macro should be invoked exactly once for one
1116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * such string variable before it is used.
1126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
1136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
1146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#if defined(U_DECLARE_UTF16)
1156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#   define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const UChar *)U_DECLARE_UTF16(cs), _length)
1166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#elif U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && (U_CHARSET_FAMILY==U_ASCII_FAMILY || (U_SIZEOF_UCHAR == 2 && defined(U_WCHAR_IS_UTF16)))
1176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#   define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const UChar *)L ## cs, _length)
1186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
1196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#   define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const UChar *)cs, _length)
1206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#else
1216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#   define UNICODE_STRING(cs, _length) icu::UnicodeString(cs, _length, US_INV)
1226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif
1236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
1256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Unicode String literals in C++.
1266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Dependent on the platform properties, different UnicodeString
1276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * constructors should be used to create a UnicodeString object from
1286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * a string literal.
1296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The macros are defined for improved performance.
1306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * They work only for strings that contain "invariant characters", i.e.,
1316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * only latin letters, digits, and some punctuation.
1326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * See utypes.h for details.
1336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The string parameter must be a C string literal.
1356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
1366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
1376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#define UNICODE_STRING_SIMPLE(cs) UNICODE_STRING(cs, -1)
1386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
1406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \def UNISTR_FROM_CHAR_EXPLICIT
1416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * This can be defined to be empty or "explicit".
1426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * If explicit, then the UnicodeString(UChar) and UnicodeString(UChar32)
1436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * constructors are marked as explicit, preventing their inadvertent use.
1446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 49
1456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
1466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#ifndef UNISTR_FROM_CHAR_EXPLICIT
1476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)
1486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    // Auto-"explicit" in ICU library code.
1496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#   define UNISTR_FROM_CHAR_EXPLICIT explicit
1506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# else
1516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    // Empty by default for source code compatibility.
1526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#   define UNISTR_FROM_CHAR_EXPLICIT
1536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# endif
1546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif
1556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
1576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \def UNISTR_FROM_STRING_EXPLICIT
1586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * This can be defined to be empty or "explicit".
1596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * If explicit, then the UnicodeString(const char *) and UnicodeString(const UChar *)
1606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * constructors are marked as explicit, preventing their inadvertent use.
1616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * In particular, this helps prevent accidentally depending on ICU conversion code
1636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * by passing a string literal into an API with a const UnicodeString & parameter.
1646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 49
1656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
1666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#ifndef UNISTR_FROM_STRING_EXPLICIT
1676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)
1686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    // Auto-"explicit" in ICU library code.
1696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#   define UNISTR_FROM_STRING_EXPLICIT explicit
1706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# else
1716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    // Empty by default for source code compatibility.
1726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#   define UNISTR_FROM_STRING_EXPLICIT
1736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org# endif
1746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif
1756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
1776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UnicodeString is a string class that stores Unicode characters directly and provides
1786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * similar functionality as the Java String and StringBuffer classes.
1796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * It is a concrete implementation of the abstract class Replaceable (for transliteration).
1806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The UnicodeString class is not suitable for subclassing.
1826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>For an overview of Unicode strings in C and C++ see the
1846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <a href="http://icu-project.org/userguide/strings.html">User Guide Strings chapter</a>.</p>
1856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>In ICU, a Unicode string consists of 16-bit Unicode <em>code units</em>.
1876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * A Unicode character may be stored with either one code unit
1886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * (the most common case) or with a matched pair of special code units
1896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * ("surrogates"). The data type for code units is UChar.
1906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * For single-character handling, a Unicode character code <em>point</em> is a value
1916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * in the range 0..0x10ffff. ICU uses the UChar32 type for code points.</p>
1926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>Indexes and offsets into and lengths of strings always count code units, not code points.
1946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * This is the same as with multi-byte char* strings in traditional string handling.
1956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Operations on partial strings typically do not test for code point boundaries.
1966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * If necessary, the user needs to take care of such boundaries by testing for the code unit
1976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * values or by using functions like
1986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UnicodeString::getChar32Start() and UnicodeString::getChar32Limit()
1996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * (or, in C, the equivalent macros U16_SET_CP_START() and U16_SET_CP_LIMIT(), see utf.h).</p>
2006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
2016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UnicodeString methods are more lenient with regard to input parameter values
2026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * than other ICU APIs. In particular:
2036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * - If indexes are out of bounds for a UnicodeString object
2046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   (<0 or >length()) then they are "pinned" to the nearest boundary.
2056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * - If primitive string pointer values (e.g., const UChar * or char *)
2066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   for input strings are NULL, then those input string parameters are treated
2076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   as if they pointed to an empty string.
2086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   However, this is <em>not</em> the case for char * parameters for charset names
2096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   or other IDs.
2106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * - Most UnicodeString methods do not take a UErrorCode parameter because
2116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   there are usually very few opportunities for failure other than a shortage
2126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   of memory, error codes in low-level C++ string methods would be inconvenient,
2136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   and the error code as the last parameter (ICU convention) would prevent
2146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   the use of default parameter values.
2156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   Instead, such methods set the UnicodeString into a "bogus" state
2166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   (see isBogus()) if an error occurs.
2176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
2186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * In string comparisons, two UnicodeString objects that are both "bogus"
2196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * compare equal (to be transitive and prevent endless loops in sorting),
2206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * and a "bogus" string compares less than any non-"bogus" one.
2216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
2226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Const UnicodeString methods are thread-safe. Multiple threads can use
2236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * const methods on the same UnicodeString object simultaneously,
2246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * but non-const methods must not be called concurrently (in multiple threads)
2256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * with any other (const or non-const) methods.
2266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
2276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Similarly, const UnicodeString & parameters are thread-safe.
2286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * One object may be passed in as such a parameter concurrently in multiple threads.
2296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * This includes the const UnicodeString & parameters for
2306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * copy construction, assignment, and cloning.
2316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
2326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>UnicodeString uses several storage methods.
2336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * String contents can be stored inside the UnicodeString object itself,
2346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * in an allocated and shared buffer, or in an outside buffer that is "aliased".
2356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Most of this is done transparently, but careful aliasing in particular provides
2366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * significant performance improvements.
2376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Also, the internal buffer is accessible via special functions.
2386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * For details see the
2396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <a href="http://icu-project.org/userguide/strings.html">User Guide Strings chapter</a>.</p>
2406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
2416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see utf.h
2426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see CharacterIterator
2436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
2446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
2456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgclass U_COMMON_API UnicodeString : public Replaceable
2466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org{
2476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgpublic:
2486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
2506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Constant to be used in the UnicodeString(char *, int32_t, EInvariant) constructor
2516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * which constructs a Unicode string from an invariant-character char * string.
2526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Use the macro US_INV instead of the full qualification for this value.
2536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
2546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see US_INV
2556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 3.2
2566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
2576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  enum EInvariant {
2586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
2596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @see EInvariant
2606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 3.2
2616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
2626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    kInvariant
2636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  };
2646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  //========================================
2666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  // Read-only operations
2676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  //========================================
2686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Comparison - bitwise only - for international comparison use collation */
2706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
2726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Equality operator. Performs only bitwise comparison.
2736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The UnicodeString to compare to this one.
2746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if <TT>text</TT> contains the same characters as this one,
2756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * FALSE otherwise.
2766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
2776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
2786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool operator== (const UnicodeString& text) const;
2796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
2816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Inequality operator. Performs only bitwise comparison.
2826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The UnicodeString to compare to this one.
2836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return FALSE if <TT>text</TT> contains the same characters as this one,
2846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * TRUE otherwise.
2856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
2866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
2876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool operator!= (const UnicodeString& text) const;
2886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
2906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Greater than operator. Performs only bitwise comparison.
2916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The UnicodeString to compare to this one.
2926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if the characters in this are bitwise
2936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * greater than the characters in <code>text</code>, FALSE otherwise
2946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
2956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
2966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool operator> (const UnicodeString& text) const;
2976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
2996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Less than operator. Performs only bitwise comparison.
3006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The UnicodeString to compare to this one.
3016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if the characters in this are bitwise
3026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * less than the characters in <code>text</code>, FALSE otherwise
3036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
3046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool operator< (const UnicodeString& text) const;
3066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
3086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Greater than or equal operator. Performs only bitwise comparison.
3096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The UnicodeString to compare to this one.
3106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if the characters in this are bitwise
3116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * greater than or equal to the characters in <code>text</code>, FALSE otherwise
3126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
3136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool operator>= (const UnicodeString& text) const;
3156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
3176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Less than or equal operator. Performs only bitwise comparison.
3186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The UnicodeString to compare to this one.
3196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if the characters in this are bitwise
3206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * less than or equal to the characters in <code>text</code>, FALSE otherwise
3216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
3226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool operator<= (const UnicodeString& text) const;
3246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
3266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare the characters bitwise in this UnicodeString to
3276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the characters in <code>text</code>.
3286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The UnicodeString to compare to this one.
3296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The result of bitwise character comparison: 0 if this
3306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * contains the same characters as <code>text</code>, -1 if the characters in
3316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this are bitwise less than the characters in <code>text</code>, +1 if the
3326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * characters in this are bitwise greater than the characters
3336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <code>text</code>.
3346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
3356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t compare(const UnicodeString& text) const;
3376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
3396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare the characters bitwise in the range
3406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) with the characters
3416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the <b>entire string</b> <TT>text</TT>.
3426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * (The parameters "start" and "length" are not applied to the other text "text".)
3436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the compare operation begins
3446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters of text to compare.
3456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text the other text to be compared against this string.
3466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The result of bitwise character comparison: 0 if this
3476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * contains the same characters as <code>text</code>, -1 if the characters in
3486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this are bitwise less than the characters in <code>text</code>, +1 if the
3496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * characters in this are bitwise greater than the characters
3506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <code>text</code>.
3516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
3526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t compare(int32_t start,
3546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t length,
3556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         const UnicodeString& text) const;
3566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
3586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare the characters bitwise in the range
3596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) with the characters
3606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcText</TT> in the range
3616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>).
3626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the compare operation begins
3636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters in this to compare.
3646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the text to be compared
3656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> to start comparison
3666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>src</TT> to compare
3676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The result of bitwise character comparison: 0 if this
3686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * contains the same characters as <code>srcText</code>, -1 if the characters in
3696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this are bitwise less than the characters in <code>srcText</code>, +1 if the
3706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * characters in this are bitwise greater than the characters
3716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <code>srcText</code>.
3726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
3736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   inline int8_t compare(int32_t start,
3756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t length,
3766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         const UnicodeString& srcText,
3776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t srcStart,
3786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t srcLength) const;
3796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
3816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare the characters bitwise in this UnicodeString with the first
3826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcLength</TT> characters in <TT>srcChars</TT>.
3836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars The characters to compare to this UnicodeString.
3846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT> to compare
3856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The result of bitwise character comparison: 0 if this
3866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * contains the same characters as <code>srcChars</code>, -1 if the characters in
3876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this are bitwise less than the characters in <code>srcChars</code>, +1 if the
3886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * characters in this are bitwise greater than the characters
3896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <code>srcChars</code>.
3906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
3916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t compare(const UChar *srcChars,
3936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t srcLength) const;
3946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
3966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare the characters bitwise in the range
3976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) with the first
3986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>length</TT> characters in <TT>srcChars</TT>
3996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the compare operation begins
4006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters to compare.
4016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars the characters to be compared
4026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The result of bitwise character comparison: 0 if this
4036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * contains the same characters as <code>srcChars</code>, -1 if the characters in
4046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this are bitwise less than the characters in <code>srcChars</code>, +1 if the
4056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * characters in this are bitwise greater than the characters
4066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <code>srcChars</code>.
4076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
4086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
4096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t compare(int32_t start,
4106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t length,
4116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         const UChar *srcChars) const;
4126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
4146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare the characters bitwise in the range
4156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) with the characters
4166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcChars</TT> in the range
4176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>).
4186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the compare operation begins
4196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters in this to compare
4206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars the characters to be compared
4216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcChars</TT> to start comparison
4226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT> to compare
4236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The result of bitwise character comparison: 0 if this
4246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * contains the same characters as <code>srcChars</code>, -1 if the characters in
4256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this are bitwise less than the characters in <code>srcChars</code>, +1 if the
4266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * characters in this are bitwise greater than the characters
4276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <code>srcChars</code>.
4286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
4296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
4306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t compare(int32_t start,
4316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t length,
4326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         const UChar *srcChars,
4336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t srcStart,
4346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t srcLength) const;
4356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
4376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare the characters bitwise in the range
4386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>limit</TT>) with the characters
4396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcText</TT> in the range
4406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcLimit</TT>).
4416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the compare operation begins
4426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param limit the offset immediately following the compare operation
4436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the text to be compared
4446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> to start comparison
4456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLimit the offset into <TT>srcText</TT> to limit comparison
4466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The result of bitwise character comparison: 0 if this
4476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * contains the same characters as <code>srcText</code>, -1 if the characters in
4486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this are bitwise less than the characters in <code>srcText</code>, +1 if the
4496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * characters in this are bitwise greater than the characters
4506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <code>srcText</code>.
4516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
4526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
4536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t compareBetween(int32_t start,
4546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t limit,
4556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            const UnicodeString& srcText,
4566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcStart,
4576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcLimit) const;
4586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
4606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two Unicode strings in code point order.
4616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The result may be different from the results of compare(), operator<, etc.
4626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if supplementary characters are present:
4636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
4646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * In UTF-16, supplementary characters (with code points U+10000 and above) are
4656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff,
4666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * which means that they compare as less than some other BMP characters like U+feff.
4676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function compares Unicode strings in code point order.
4686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
4696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
4706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text Another string to compare this one to.
4716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a negative/zero/positive integer corresponding to whether
4726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this string is less than/equal to/greater than the second one
4736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in code point order
4746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
4756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
4766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t compareCodePointOrder(const UnicodeString& text) const;
4776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
4796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two Unicode strings in code point order.
4806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The result may be different from the results of compare(), operator<, etc.
4816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if supplementary characters are present:
4826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
4836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * In UTF-16, supplementary characters (with code points U+10000 and above) are
4846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff,
4856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * which means that they compare as less than some other BMP characters like U+feff.
4866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function compares Unicode strings in code point order.
4876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
4886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
4896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The start offset in this string at which the compare operation begins.
4906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length The number of code units from this string to compare.
4916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText Another string to compare this one to.
4926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a negative/zero/positive integer corresponding to whether
4936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this string is less than/equal to/greater than the second one
4946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in code point order
4956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
4966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
4976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t compareCodePointOrder(int32_t start,
4986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                      int32_t length,
4996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                      const UnicodeString& srcText) const;
5006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
5026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two Unicode strings in code point order.
5036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The result may be different from the results of compare(), operator<, etc.
5046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if supplementary characters are present:
5056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
5066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * In UTF-16, supplementary characters (with code points U+10000 and above) are
5076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff,
5086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * which means that they compare as less than some other BMP characters like U+feff.
5096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function compares Unicode strings in code point order.
5106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
5116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
5126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The start offset in this string at which the compare operation begins.
5136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length The number of code units from this string to compare.
5146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText Another string to compare this one to.
5156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart The start offset in that string at which the compare operation begins.
5166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength The number of code units from that string to compare.
5176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a negative/zero/positive integer corresponding to whether
5186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this string is less than/equal to/greater than the second one
5196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in code point order
5206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
5216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
5226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   inline int8_t compareCodePointOrder(int32_t start,
5236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                       int32_t length,
5246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                       const UnicodeString& srcText,
5256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                       int32_t srcStart,
5266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                       int32_t srcLength) const;
5276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
5296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two Unicode strings in code point order.
5306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The result may be different from the results of compare(), operator<, etc.
5316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if supplementary characters are present:
5326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
5336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * In UTF-16, supplementary characters (with code points U+10000 and above) are
5346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff,
5356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * which means that they compare as less than some other BMP characters like U+feff.
5366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function compares Unicode strings in code point order.
5376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
5386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
5396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars A pointer to another string to compare this one to.
5406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength The number of code units from that string to compare.
5416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a negative/zero/positive integer corresponding to whether
5426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this string is less than/equal to/greater than the second one
5436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in code point order
5446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
5456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
5466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t compareCodePointOrder(const UChar *srcChars,
5476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                      int32_t srcLength) const;
5486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
5506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two Unicode strings in code point order.
5516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The result may be different from the results of compare(), operator<, etc.
5526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if supplementary characters are present:
5536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
5546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * In UTF-16, supplementary characters (with code points U+10000 and above) are
5556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff,
5566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * which means that they compare as less than some other BMP characters like U+feff.
5576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function compares Unicode strings in code point order.
5586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
5596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
5606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The start offset in this string at which the compare operation begins.
5616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length The number of code units from this string to compare.
5626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars A pointer to another string to compare this one to.
5636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a negative/zero/positive integer corresponding to whether
5646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this string is less than/equal to/greater than the second one
5656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in code point order
5666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
5676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
5686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t compareCodePointOrder(int32_t start,
5696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                      int32_t length,
5706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                      const UChar *srcChars) const;
5716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
5736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two Unicode strings in code point order.
5746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The result may be different from the results of compare(), operator<, etc.
5756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if supplementary characters are present:
5766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
5776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * In UTF-16, supplementary characters (with code points U+10000 and above) are
5786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff,
5796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * which means that they compare as less than some other BMP characters like U+feff.
5806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function compares Unicode strings in code point order.
5816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
5826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
5836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The start offset in this string at which the compare operation begins.
5846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length The number of code units from this string to compare.
5856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars A pointer to another string to compare this one to.
5866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart The start offset in that string at which the compare operation begins.
5876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength The number of code units from that string to compare.
5886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a negative/zero/positive integer corresponding to whether
5896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this string is less than/equal to/greater than the second one
5906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in code point order
5916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
5926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
5936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t compareCodePointOrder(int32_t start,
5946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                      int32_t length,
5956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                      const UChar *srcChars,
5966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                      int32_t srcStart,
5976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                      int32_t srcLength) const;
5986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
6006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two Unicode strings in code point order.
6016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The result may be different from the results of compare(), operator<, etc.
6026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if supplementary characters are present:
6036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * In UTF-16, supplementary characters (with code points U+10000 and above) are
6056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * stored with pairs of surrogate code units. These have values from 0xd800 to 0xdfff,
6066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * which means that they compare as less than some other BMP characters like U+feff.
6076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function compares Unicode strings in code point order.
6086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If either of the UTF-16 strings is malformed (i.e., it contains unpaired surrogates), then the result is not defined.
6096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The start offset in this string at which the compare operation begins.
6116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param limit The offset after the last code unit from this string to compare.
6126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText Another string to compare this one to.
6136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart The start offset in that string at which the compare operation begins.
6146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLimit The offset after the last code unit from that string to compare.
6156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a negative/zero/positive integer corresponding to whether
6166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this string is less than/equal to/greater than the second one
6176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in code point order
6186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
6196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
6206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t compareCodePointOrderBetween(int32_t start,
6216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                             int32_t limit,
6226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                             const UnicodeString& srcText,
6236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                             int32_t srcStart,
6246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                             int32_t srcLimit) const;
6256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
6276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two strings case-insensitively using full case folding.
6286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This is equivalent to this->foldCase(options).compare(text.foldCase(options)).
6296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text Another string to compare this one to.
6316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param options A bit set of options:
6326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
6336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Comparison in code unit order with default case folding.
6346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_COMPARE_CODE_POINT_ORDER
6366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Set to choose code point order instead of code unit order
6376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     (see u_strCompare for details).
6386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
6406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A negative, zero, or positive integer indicating the comparison result.
6426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
6436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
6446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t caseCompare(const UnicodeString& text, uint32_t options) const;
6456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
6476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two strings case-insensitively using full case folding.
6486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This is equivalent to this->foldCase(options).compare(srcText.foldCase(options)).
6496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The start offset in this string at which the compare operation begins.
6516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length The number of code units from this string to compare.
6526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText Another string to compare this one to.
6536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param options A bit set of options:
6546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
6556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Comparison in code unit order with default case folding.
6566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_COMPARE_CODE_POINT_ORDER
6586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Set to choose code point order instead of code unit order
6596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     (see u_strCompare for details).
6606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
6626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A negative, zero, or positive integer indicating the comparison result.
6646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
6656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
6666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t caseCompare(int32_t start,
6676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t length,
6686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         const UnicodeString& srcText,
6696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         uint32_t options) const;
6706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
6726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two strings case-insensitively using full case folding.
6736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This is equivalent to this->foldCase(options).compare(srcText.foldCase(options)).
6746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The start offset in this string at which the compare operation begins.
6766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length The number of code units from this string to compare.
6776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText Another string to compare this one to.
6786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart The start offset in that string at which the compare operation begins.
6796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength The number of code units from that string to compare.
6806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param options A bit set of options:
6816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
6826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Comparison in code unit order with default case folding.
6836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_COMPARE_CODE_POINT_ORDER
6856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Set to choose code point order instead of code unit order
6866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     (see u_strCompare for details).
6876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
6896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
6906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A negative, zero, or positive integer indicating the comparison result.
6916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
6926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
6936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t caseCompare(int32_t start,
6946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t length,
6956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         const UnicodeString& srcText,
6966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t srcStart,
6976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t srcLength,
6986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         uint32_t options) const;
6996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
7016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two strings case-insensitively using full case folding.
7026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This is equivalent to this->foldCase(options).compare(srcChars.foldCase(options)).
7036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars A pointer to another string to compare this one to.
7056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength The number of code units from that string to compare.
7066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param options A bit set of options:
7076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
7086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Comparison in code unit order with default case folding.
7096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_COMPARE_CODE_POINT_ORDER
7116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Set to choose code point order instead of code unit order
7126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     (see u_strCompare for details).
7136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
7156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A negative, zero, or positive integer indicating the comparison result.
7176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
7186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
7196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t caseCompare(const UChar *srcChars,
7206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t srcLength,
7216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         uint32_t options) const;
7226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
7246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two strings case-insensitively using full case folding.
7256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This is equivalent to this->foldCase(options).compare(srcChars.foldCase(options)).
7266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The start offset in this string at which the compare operation begins.
7286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length The number of code units from this string to compare.
7296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars A pointer to another string to compare this one to.
7306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param options A bit set of options:
7316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
7326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Comparison in code unit order with default case folding.
7336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_COMPARE_CODE_POINT_ORDER
7356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Set to choose code point order instead of code unit order
7366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     (see u_strCompare for details).
7376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
7396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A negative, zero, or positive integer indicating the comparison result.
7416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
7426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
7436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t caseCompare(int32_t start,
7446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t length,
7456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         const UChar *srcChars,
7466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         uint32_t options) const;
7476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
7496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two strings case-insensitively using full case folding.
7506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This is equivalent to this->foldCase(options).compare(srcChars.foldCase(options)).
7516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The start offset in this string at which the compare operation begins.
7536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length The number of code units from this string to compare.
7546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars A pointer to another string to compare this one to.
7556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart The start offset in that string at which the compare operation begins.
7566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength The number of code units from that string to compare.
7576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param options A bit set of options:
7586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
7596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Comparison in code unit order with default case folding.
7606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_COMPARE_CODE_POINT_ORDER
7626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Set to choose code point order instead of code unit order
7636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     (see u_strCompare for details).
7646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
7666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A negative, zero, or positive integer indicating the comparison result.
7686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
7696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
7706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t caseCompare(int32_t start,
7716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t length,
7726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         const UChar *srcChars,
7736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t srcStart,
7746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t srcLength,
7756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         uint32_t options) const;
7766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
7786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Compare two strings case-insensitively using full case folding.
7796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This is equivalent to this->foldCase(options).compareBetween(text.foldCase(options)).
7806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The start offset in this string at which the compare operation begins.
7826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param limit The offset after the last code unit from this string to compare.
7836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText Another string to compare this one to.
7846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart The start offset in that string at which the compare operation begins.
7856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLimit The offset after the last code unit from that string to compare.
7866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param options A bit set of options:
7876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
7886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Comparison in code unit order with default case folding.
7896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_COMPARE_CODE_POINT_ORDER
7916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     Set to choose code point order instead of code unit order
7926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *     (see u_strCompare for details).
7936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
7956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
7966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A negative, zero, or positive integer indicating the comparison result.
7976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
7986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
7996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int8_t caseCompareBetween(int32_t start,
8006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t limit,
8016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            const UnicodeString& srcText,
8026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcStart,
8036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcLimit,
8046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            uint32_t options) const;
8056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Determine if this starts with the characters in <TT>text</TT>
8086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The text to match.
8096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if this starts with the characters in <TT>text</TT>,
8106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * FALSE otherwise
8116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
8126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool startsWith(const UnicodeString& text) const;
8146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Determine if this starts with the characters in <TT>srcText</TT>
8176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the range [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>).
8186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText The text to match.
8196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> to start matching
8206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcText</TT> to match
8216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if this starts with the characters in <TT>text</TT>,
8226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * FALSE otherwise
8236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
8246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool startsWith(const UnicodeString& srcText,
8266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcStart,
8276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcLength) const;
8286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Determine if this starts with the characters in <TT>srcChars</TT>
8316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars The characters to match.
8326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT>
8336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if this starts with the characters in <TT>srcChars</TT>,
8346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * FALSE otherwise
8356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
8366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool startsWith(const UChar *srcChars,
8386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcLength) const;
8396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Determine if this ends with the characters in <TT>srcChars</TT>
8426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the range  [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>).
8436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars The characters to match.
8446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> to start matching
8456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT> to match
8466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if this ends with the characters in <TT>srcChars</TT>, FALSE otherwise
8476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
8486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool startsWith(const UChar *srcChars,
8506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcStart,
8516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcLength) const;
8526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Determine if this ends with the characters in <TT>text</TT>
8556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The text to match.
8566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if this ends with the characters in <TT>text</TT>,
8576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * FALSE otherwise
8586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
8596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool endsWith(const UnicodeString& text) const;
8616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Determine if this ends with the characters in <TT>srcText</TT>
8646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the range [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>).
8656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText The text to match.
8666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> to start matching
8676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcText</TT> to match
8686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if this ends with the characters in <TT>text</TT>,
8696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * FALSE otherwise
8706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
8716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool endsWith(const UnicodeString& srcText,
8736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          int32_t srcStart,
8746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          int32_t srcLength) const;
8756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Determine if this ends with the characters in <TT>srcChars</TT>
8786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars The characters to match.
8796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT>
8806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if this ends with the characters in <TT>srcChars</TT>,
8816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * FALSE otherwise
8826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
8836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool endsWith(const UChar *srcChars,
8856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          int32_t srcLength) const;
8866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Determine if this ends with the characters in <TT>srcChars</TT>
8896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the range  [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>).
8906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars The characters to match.
8916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> to start matching
8926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT> to match
8936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if this ends with the characters in <TT>srcChars</TT>,
8946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * FALSE otherwise
8956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
8966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool endsWith(const UChar *srcChars,
8986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          int32_t srcStart,
8996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          int32_t srcLength) const;
9006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Searching - bitwise only */
9036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
9056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence of the characters in <TT>text</TT>,
9066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
9076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The text to search for.
9086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>text</TT>,
9096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
9106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
9116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
9126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t indexOf(const UnicodeString& text) const;
9136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
9156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence of the characters in <TT>text</TT>
9166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * starting at offset <TT>start</TT>, using bitwise comparison.
9176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The text to search for.
9186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The offset at which searching will start.
9196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>text</TT>,
9206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
9216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
9226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
9236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t indexOf(const UnicodeString& text,
9246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start) const;
9256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
9276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence in the range
9286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) of the characters
9296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>text</TT>, using bitwise comparison.
9306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The text to search for.
9316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The offset at which searching will start.
9326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length The number of characters to search
9336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>text</TT>,
9346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
9356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
9366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
9376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t indexOf(const UnicodeString& text,
9386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start,
9396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t length) const;
9406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
9426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence in the range
9436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) of the characters
9446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *  in <TT>srcText</TT> in the range
9456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>),
9466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
9476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText The text to search for.
9486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> at which
9496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * to start matching
9506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcText</TT> to match
9516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset into this at which to start matching
9526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters in this to search
9536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>text</TT>,
9546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
9556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
9566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
9576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t indexOf(const UnicodeString& srcText,
9586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t srcStart,
9596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t srcLength,
9606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start,
9616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t length) const;
9626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
9646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence of the characters in
9656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcChars</TT>
9666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * starting at offset <TT>start</TT>, using bitwise comparison.
9676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars The text to search for.
9686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT> to match
9696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset into this at which to start matching
9706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>text</TT>,
9716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
9726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
9736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
9746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t indexOf(const UChar *srcChars,
9756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t srcLength,
9766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start) const;
9776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
9796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence in the range
9806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) of the characters
9816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcChars</TT>, using bitwise comparison.
9826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars The text to search for.
9836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT>
9846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The offset at which searching will start.
9856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length The number of characters to search
9866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>srcChars</TT>,
9876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
9886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
9896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
9906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t indexOf(const UChar *srcChars,
9916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t srcLength,
9926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start,
9936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t length) const;
9946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
9966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence in the range
9976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) of the characters
9986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcChars</TT> in the range
9996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>),
10006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
10016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars The text to search for.
10026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcChars</TT> at which
10036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * to start matching
10046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT> to match
10056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset into this at which to start matching
10066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters in this to search
10076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>text</TT>,
10086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
10096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
10106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
10116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  int32_t indexOf(const UChar *srcChars,
10126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t srcStart,
10136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t srcLength,
10146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start,
10156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t length) const;
10166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
10176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
10186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence of the BMP code point <code>c</code>,
10196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
10206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param c The code unit to search for.
10216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of <TT>c</TT>, or -1 if not found.
10226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
10236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
10246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t indexOf(UChar c) const;
10256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
10266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
10276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence of the code point <TT>c</TT>,
10286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
10296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
10306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param c The code point to search for.
10316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of <TT>c</TT>, or -1 if not found.
10326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
10336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
10346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t indexOf(UChar32 c) const;
10356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
10366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
10376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence of the BMP code point <code>c</code>,
10386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * starting at offset <TT>start</TT>, using bitwise comparison.
10396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param c The code unit to search for.
10406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The offset at which searching will start.
10416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of <TT>c</TT>, or -1 if not found.
10426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
10436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
10446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t indexOf(UChar c,
10456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start) const;
10466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
10476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
10486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence of the code point <TT>c</TT>
10496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * starting at offset <TT>start</TT>, using bitwise comparison.
10506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
10516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param c The code point to search for.
10526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The offset at which searching will start.
10536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of <TT>c</TT>, or -1 if not found.
10546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
10556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
10566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t indexOf(UChar32 c,
10576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start) const;
10586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
10596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
10606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence of the BMP code point <code>c</code>
10616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the range [<TT>start</TT>, <TT>start + length</TT>),
10626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
10636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param c The code unit to search for.
10646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset into this at which to start matching
10656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters in this to search
10666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of <TT>c</TT>, or -1 if not found.
10676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
10686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
10696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t indexOf(UChar c,
10706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start,
10716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t length) const;
10726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
10736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
10746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the first occurrence of the code point <TT>c</TT>
10756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the range [<TT>start</TT>, <TT>start + length</TT>),
10766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
10776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
10786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param c The code point to search for.
10796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset into this at which to start matching
10806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters in this to search
10816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of <TT>c</TT>, or -1 if not found.
10826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
10836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
10846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t indexOf(UChar32 c,
10856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start,
10866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t length) const;
10876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
10886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
10896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence of the characters in <TT>text</TT>,
10906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
10916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The text to search for.
10926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>text</TT>,
10936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
10946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
10956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
10966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t lastIndexOf(const UnicodeString& text) const;
10976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
10986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
10996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence of the characters in <TT>text</TT>
11006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * starting at offset <TT>start</TT>, using bitwise comparison.
11016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The text to search for.
11026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The offset at which searching will start.
11036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>text</TT>,
11046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
11056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
11066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
11076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t lastIndexOf(const UnicodeString& text,
11086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start) const;
11096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
11106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
11116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence in the range
11126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) of the characters
11136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>text</TT>, using bitwise comparison.
11146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The text to search for.
11156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The offset at which searching will start.
11166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length The number of characters to search
11176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>text</TT>,
11186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
11196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
11206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
11216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t lastIndexOf(const UnicodeString& text,
11226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start,
11236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t length) const;
11246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
11256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
11266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence in the range
11276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) of the characters
11286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcText</TT> in the range
11296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>),
11306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
11316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText The text to search for.
11326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> at which
11336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * to start matching
11346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcText</TT> to match
11356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset into this at which to start matching
11366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters in this to search
11376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>text</TT>,
11386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
11396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
11406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
11416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t lastIndexOf(const UnicodeString& srcText,
11426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t srcStart,
11436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t srcLength,
11446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start,
11456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t length) const;
11466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
11476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
11486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence of the characters in <TT>srcChars</TT>
11496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * starting at offset <TT>start</TT>, using bitwise comparison.
11506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars The text to search for.
11516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT> to match
11526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset into this at which to start matching
11536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>text</TT>,
11546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
11556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
11566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
11576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t lastIndexOf(const UChar *srcChars,
11586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t srcLength,
11596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start) const;
11606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
11616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
11626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence in the range
11636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) of the characters
11646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcChars</TT>, using bitwise comparison.
11656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars The text to search for.
11666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT>
11676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The offset at which searching will start.
11686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length The number of characters to search
11696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>srcChars</TT>,
11706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
11716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
11726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
11736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t lastIndexOf(const UChar *srcChars,
11746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t srcLength,
11756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start,
11766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t length) const;
11776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
11786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
11796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence in the range
11806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) of the characters
11816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcChars</TT> in the range
11826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>),
11836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
11846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars The text to search for.
11856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcChars</TT> at which
11866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * to start matching
11876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT> to match
11886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset into this at which to start matching
11896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters in this to search
11906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of the start of <TT>text</TT>,
11916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or -1 if not found.
11926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
11936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
11946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  int32_t lastIndexOf(const UChar *srcChars,
11956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t srcStart,
11966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t srcLength,
11976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start,
11986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t length) const;
11996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
12016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence of the BMP code point <code>c</code>,
12026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
12036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param c The code unit to search for.
12046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of <TT>c</TT>, or -1 if not found.
12056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
12066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
12076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t lastIndexOf(UChar c) const;
12086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
12106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence of the code point <TT>c</TT>,
12116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
12126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
12136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param c The code point to search for.
12146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of <TT>c</TT>, or -1 if not found.
12156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
12166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
12176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t lastIndexOf(UChar32 c) const;
12186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
12206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence of the BMP code point <code>c</code>
12216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * starting at offset <TT>start</TT>, using bitwise comparison.
12226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param c The code unit to search for.
12236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The offset at which searching will start.
12246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of <TT>c</TT>, or -1 if not found.
12256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
12266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
12276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t lastIndexOf(UChar c,
12286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start) const;
12296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
12316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence of the code point <TT>c</TT>
12326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * starting at offset <TT>start</TT>, using bitwise comparison.
12336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
12346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param c The code point to search for.
12356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start The offset at which searching will start.
12366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of <TT>c</TT>, or -1 if not found.
12376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
12386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
12396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t lastIndexOf(UChar32 c,
12406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start) const;
12416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
12436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence of the BMP code point <code>c</code>
12446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the range [<TT>start</TT>, <TT>start + length</TT>),
12456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
12466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param c The code unit to search for.
12476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset into this at which to start matching
12486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters in this to search
12496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of <TT>c</TT>, or -1 if not found.
12506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
12516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
12526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t lastIndexOf(UChar c,
12536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start,
12546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t length) const;
12556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
12576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Locate in this the last occurrence of the code point <TT>c</TT>
12586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the range [<TT>start</TT>, <TT>start + length</TT>),
12596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * using bitwise comparison.
12606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
12616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param c The code point to search for.
12626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset into this at which to start matching
12636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters in this to search
12646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The offset into this of <TT>c</TT>, or -1 if not found.
12656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
12666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
12676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t lastIndexOf(UChar32 c,
12686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t start,
12696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t length) const;
12706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Character access */
12736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
12756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Return the code unit at offset <tt>offset</tt>.
12766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If the offset is not valid (0..length()-1) then U+ffff is returned.
12776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param offset a valid offset into the text
12786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return the code unit at offset <tt>offset</tt>
12796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *         or 0xffff if the offset is not valid for this string
12806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
12816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
12826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UChar charAt(int32_t offset) const;
12836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
12856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Return the code unit at offset <tt>offset</tt>.
12866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If the offset is not valid (0..length()-1) then U+ffff is returned.
12876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param offset a valid offset into the text
12886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return the code unit at offset <tt>offset</tt>
12896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
12906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
12916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UChar operator[] (int32_t offset) const;
12926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
12946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Return the code point that contains the code unit
12956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * at offset <tt>offset</tt>.
12966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If the offset is not valid (0..length()-1) then U+ffff is returned.
12976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param offset a valid offset into the text
12986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * that indicates the text offset of any of the code units
12996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * that will be assembled into a code point (21-bit value) and returned
13006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return the code point of text at <tt>offset</tt>
13016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *         or 0xffff if the offset is not valid for this string
13026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
13036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
13046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UChar32 char32At(int32_t offset) const;
13056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
13066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
13076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Adjust a random-access offset so that
13086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * it points to the beginning of a Unicode character.
13096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The offset that is passed in points to
13106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * any code unit of a code point,
13116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * while the returned offset will point to the first code unit
13126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * of the same code point.
13136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * In UTF-16, if the input offset points to a second surrogate
13146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * of a surrogate pair, then the returned offset will point
13156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * to the first surrogate.
13166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param offset a valid offset into one code point of the text
13176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return offset of the first code unit of the same code point
13186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see U16_SET_CP_START
13196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
13206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
13216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  int32_t getChar32Start(int32_t offset) const;
13226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
13236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
13246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Adjust a random-access offset so that
13256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * it points behind a Unicode character.
13266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The offset that is passed in points behind
13276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * any code unit of a code point,
13286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * while the returned offset will point behind the last code unit
13296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * of the same code point.
13306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * In UTF-16, if the input offset points behind the first surrogate
13316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * (i.e., to the second surrogate)
13326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * of a surrogate pair, then the returned offset will point
13336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * behind the second surrogate (i.e., to the first surrogate).
13346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param offset a valid offset after any code unit of a code point of the text
13356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return offset of the first code unit after the same code point
13366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see U16_SET_CP_LIMIT
13376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
13386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
13396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  int32_t getChar32Limit(int32_t offset) const;
13406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
13416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
13426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Move the code unit index along the string by delta code points.
13436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Interpret the input index as a code unit-based offset into the string,
13446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * move the index forward or backward by delta code points, and
13456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * return the resulting index.
13466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The input index should point to the first code unit of a code point,
13476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if there is more than one.
13486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
13496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Both input and output indexes are code unit-based as for all
13506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * string indexes/offsets in ICU (and other libraries, like MBCS char*).
13516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If delta<0 then the index is moved backward (toward the start of the string).
13526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If delta>0 then the index is moved forward (toward the end of the string).
13536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
13546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This behaves like CharacterIterator::move32(delta, kCurrent).
13556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
13566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Behavior for out-of-bounds indexes:
13576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>moveIndex32</code> pins the input index to 0..length(), i.e.,
13586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if the input index<0 then it is pinned to 0;
13596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if it is index>length() then it is pinned to length().
13606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Afterwards, the index is moved by <code>delta</code> code points
13616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * forward or backward,
13626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * but no further backward than to 0 and no further forward than to length().
13636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The resulting index return value will be in between 0 and length(), inclusively.
13646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
13656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Examples:
13666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <pre>
13676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * // s has code points 'a' U+10000 'b' U+10ffff U+2029
13686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * UnicodeString s=UNICODE_STRING("a\\U00010000b\\U0010ffff\\u2029", 31).unescape();
13696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
13706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * // initial index: position of U+10000
13716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * int32_t index=1;
13726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
13736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * // the following examples will all result in index==4, position of U+10ffff
13746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
13756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * // skip 2 code points from some position in the string
13766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * index=s.moveIndex32(index, 2); // skips U+10000 and 'b'
13776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
13786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * // go to the 3rd code point from the start of s (0-based)
13796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * index=s.moveIndex32(0, 3); // skips 'a', U+10000, and 'b'
13806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
13816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * // go to the next-to-last code point of s
13826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * index=s.moveIndex32(s.length(), -2); // backward-skips U+2029 and U+10ffff
13836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * </pre>
13846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
13856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param index input code unit index
13866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param delta (signed) code point count to move the index forward or backward
13876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *        in the string
13886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return the resulting code unit index
13896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
13906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
13916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  int32_t moveIndex32(int32_t index, int32_t delta) const;
13926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
13936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Substring extraction */
13946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
13956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
13966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Copy the characters in the range
13976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<tt>start</tt>, <tt>start + length</tt>) into the array <tt>dst</tt>,
13986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * beginning at <tt>dstStart</tt>.
13996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If the string aliases to <code>dst</code> itself as an external buffer,
14006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * then extract() will not copy the contents.
14016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
14026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start offset of first character which will be copied into the array
14036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters to extract
14046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param dst array in which to copy characters.  The length of <tt>dst</tt>
14056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * must be at least (<tt>dstStart + length</tt>).
14066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param dstStart the offset in <TT>dst</TT> where the first character
14076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * will be extracted
14086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
14096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
14106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline void extract(int32_t start,
14116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           int32_t length,
14126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           UChar *dst,
14136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           int32_t dstStart = 0) const;
14146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
14156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
14166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Copy the contents of the string into dest.
14176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This is a convenience function that
14186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * checks if there is enough space in dest,
14196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * extracts the entire string if possible,
14206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * and NUL-terminates dest if possible.
14216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
14226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If the string fits into dest but cannot be NUL-terminated
14236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * (length()==destCapacity) then the error code is set to U_STRING_NOT_TERMINATED_WARNING.
14246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If the string itself does not fit into dest
14256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * (length()>destCapacity) then the error code is set to U_BUFFER_OVERFLOW_ERROR.
14266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
14276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If the string aliases to <code>dest</code> itself as an external buffer,
14286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * then extract() will not copy the contents.
14296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
14306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param dest Destination string buffer.
14316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param destCapacity Number of UChars available at dest.
14326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param errorCode ICU error code.
14336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return length()
14346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
14356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
14366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  int32_t
14376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  extract(UChar *dest, int32_t destCapacity,
14386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          UErrorCode &errorCode) const;
14396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
14406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
14416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Copy the characters in the range
14426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<tt>start</tt>, <tt>start + length</tt>) into the  UnicodeString
14436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <tt>target</tt>.
14446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start offset of first character which will be copied
14456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters to extract
14466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param target UnicodeString into which to copy characters.
14476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A reference to <TT>target</TT>
14486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
14496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
14506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline void extract(int32_t start,
14516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           int32_t length,
14526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           UnicodeString& target) const;
14536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
14546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
14556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Copy the characters in the range [<tt>start</tt>, <tt>limit</tt>)
14566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * into the array <tt>dst</tt>, beginning at <tt>dstStart</tt>.
14576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start offset of first character which will be copied into the array
14586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param limit offset immediately following the last character to be copied
14596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param dst array in which to copy characters.  The length of <tt>dst</tt>
14606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * must be at least (<tt>dstStart + (limit - start)</tt>).
14616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param dstStart the offset in <TT>dst</TT> where the first character
14626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * will be extracted
14636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
14646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
14656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline void extractBetween(int32_t start,
14666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t limit,
14676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              UChar *dst,
14686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t dstStart = 0) const;
14696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
14706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
14716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Copy the characters in the range [<tt>start</tt>, <tt>limit</tt>)
14726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * into the UnicodeString <tt>target</tt>.  Replaceable API.
14736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start offset of first character which will be copied
14746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param limit offset immediately following the last character to be copied
14756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param target UnicodeString into which to copy characters.
14766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A reference to <TT>target</TT>
14776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
14786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
14796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  virtual void extractBetween(int32_t start,
14806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              int32_t limit,
14816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              UnicodeString& target) const;
14826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
14836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
14846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Copy the characters in the range
14856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<tt>start</TT>, <tt>start + length</TT>) into an array of characters.
14866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * All characters must be invariant (see utypes.h).
14876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Use US_INV as the last, signature-distinguishing parameter.
14886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
14896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function does not write any more than <code>targetLength</code>
14906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * characters but returns the length of the entire output string
14916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * so that one can allocate a larger buffer and call the function again
14926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if necessary.
14936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The output string is NUL-terminated if possible.
14946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
14956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start offset of first character which will be copied
14966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param startLength the number of characters to extract
14976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param target the target buffer for extraction, can be NULL
14986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *               if targetLength is 0
14996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param targetCapacity the length of the target buffer
15006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param inv Signature-distinguishing paramater, use US_INV.
15016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return the output string length, not including the terminating NUL
15026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 3.2
15036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
15046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  int32_t extract(int32_t start,
15056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           int32_t startLength,
15066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           char *target,
15076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           int32_t targetCapacity,
15086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           enum EInvariant inv) const;
15096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
15106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION
15116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
15126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
15136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Copy the characters in the range
15146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<tt>start</TT>, <tt>start + length</TT>) into an array of characters
15156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the platform's default codepage.
15166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function does not write any more than <code>targetLength</code>
15176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * characters but returns the length of the entire output string
15186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * so that one can allocate a larger buffer and call the function again
15196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if necessary.
15206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The output string is NUL-terminated if possible.
15216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
15226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start offset of first character which will be copied
15236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param startLength the number of characters to extract
15246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param target the target buffer for extraction
15256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param targetLength the length of the target buffer
15266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If <TT>target</TT> is NULL, then the number of bytes required for
15276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>target</TT> is returned.
15286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return the output string length, not including the terminating NUL
15296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
15306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
15316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  int32_t extract(int32_t start,
15326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           int32_t startLength,
15336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           char *target,
15346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           uint32_t targetLength) const;
15356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
15366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif
15376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
15386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#if !UCONFIG_NO_CONVERSION
15396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
15406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
15416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Copy the characters in the range
15426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<tt>start</TT>, <tt>start + length</TT>) into an array of characters
15436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in a specified codepage.
15446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The output string is NUL-terminated.
15456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
15466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Recommendation: For invariant-character strings use
15476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * extract(int32_t start, int32_t length, char *target, int32_t targetCapacity, enum EInvariant inv) const
15486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * because it avoids object code dependencies of UnicodeString on
15496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the conversion code.
15506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
15516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start offset of first character which will be copied
15526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param startLength the number of characters to extract
15536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param target the target buffer for extraction
15546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param codepage the desired codepage for the characters.  0 has
15556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the special meaning of the default codepage
15566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If <code>codepage</code> is an empty string (<code>""</code>),
15576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * then a simple conversion is performed on the codepage-invariant
15586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * subset ("invariant characters") of the platform encoding. See utypes.h.
15596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If <TT>target</TT> is NULL, then the number of bytes required for
15606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>target</TT> is returned. It is assumed that the target is big enough
15616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * to fit all of the characters.
15626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return the output string length, not including the terminating NUL
15636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
15646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
15656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t extract(int32_t start,
15666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 int32_t startLength,
15676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 char *target,
15686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 const char *codepage = 0) const;
15696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
15706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
15716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Copy the characters in the range
15726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<tt>start</TT>, <tt>start + length</TT>) into an array of characters
15736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in a specified codepage.
15746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function does not write any more than <code>targetLength</code>
15756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * characters but returns the length of the entire output string
15766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * so that one can allocate a larger buffer and call the function again
15776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if necessary.
15786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The output string is NUL-terminated if possible.
15796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
15806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Recommendation: For invariant-character strings use
15816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * extract(int32_t start, int32_t length, char *target, int32_t targetCapacity, enum EInvariant inv) const
15826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * because it avoids object code dependencies of UnicodeString on
15836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the conversion code.
15846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
15856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start offset of first character which will be copied
15866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param startLength the number of characters to extract
15876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param target the target buffer for extraction
15886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param targetLength the length of the target buffer
15896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param codepage the desired codepage for the characters.  0 has
15906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the special meaning of the default codepage
15916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If <code>codepage</code> is an empty string (<code>""</code>),
15926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * then a simple conversion is performed on the codepage-invariant
15936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * subset ("invariant characters") of the platform encoding. See utypes.h.
15946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If <TT>target</TT> is NULL, then the number of bytes required for
15956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>target</TT> is returned.
15966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return the output string length, not including the terminating NUL
15976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
15986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
15996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  int32_t extract(int32_t start,
16006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           int32_t startLength,
16016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           char *target,
16026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           uint32_t targetLength,
16036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           const char *codepage) const;
16046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
16056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
16066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Convert the UnicodeString into a codepage string using an existing UConverter.
16076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The output string is NUL-terminated if possible.
16086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
16096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function avoids the overhead of opening and closing a converter if
16106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * multiple strings are extracted.
16116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
16126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param dest destination string buffer, can be NULL if destCapacity==0
16136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param destCapacity the number of chars available at dest
16146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param cnv the converter object to be used (ucnv_resetFromUnicode() will be called),
16156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *        or NULL for the default converter
16166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param errorCode normal ICU error code
16176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return the length of the output string, not counting the terminating NUL;
16186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *         if the length is greater than destCapacity, then the string will not fit
16196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *         and a buffer of the indicated length would need to be passed in
16206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
16216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
16226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  int32_t extract(char *dest, int32_t destCapacity,
16236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                  UConverter *cnv,
16246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                  UErrorCode &errorCode) const;
16256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
16266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif
16276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
16286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
16296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Create a temporary substring for the specified range.
16306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Unlike the substring constructor and setTo() functions,
16316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the object returned here will be a read-only alias (using getBuffer())
16326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * rather than copying the text.
16336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * As a result, this substring operation is much faster but requires
16346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * that the original string not be modified or deleted during the lifetime
16356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * of the returned substring object.
16366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start offset of the first character visible in the substring
16376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length length of the substring
16386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a read-only alias UnicodeString object for the substring
16396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 4.4
16406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
16416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString tempSubString(int32_t start=0, int32_t length=INT32_MAX) const;
16426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
16436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
16446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Create a temporary substring for the specified range.
16456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Same as tempSubString(start, length) except that the substring range
16466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * is specified as a (start, limit) pair (with an exclusive limit index)
16476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * rather than a (start, length) pair.
16486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start offset of the first character visible in the substring
16496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param limit offset immediately following the last character visible in the substring
16506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a read-only alias UnicodeString object for the substring
16516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 4.4
16526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
16536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString tempSubStringBetween(int32_t start, int32_t limit=INT32_MAX) const;
16546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
16556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
16566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Convert the UnicodeString to UTF-8 and write the result
16576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * to a ByteSink. This is called by toUTF8String().
16586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Unpaired surrogates are replaced with U+FFFD.
16596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Calls u_strToUTF8WithSub().
16606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
16616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param sink A ByteSink to which the UTF-8 version of the string is written.
16626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *             sink.Flush() is called at the end.
16636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 4.2
16646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see toUTF8String
16656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
16666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  void toUTF8(ByteSink &sink) const;
16676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
16686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#if U_HAVE_STD_STRING
16696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
16706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
16716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Convert the UnicodeString to UTF-8 and append the result
16726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * to a standard string.
16736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Unpaired surrogates are replaced with U+FFFD.
16746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Calls toUTF8().
16756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
16766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param result A standard string (or a compatible object)
16776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *        to which the UTF-8 version of the string is appended.
16786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The string object.
16796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 4.2
16806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see toUTF8
16816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
16826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  template<typename StringClass>
16836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  StringClass &toUTF8String(StringClass &result) const {
16846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    StringByteSink<StringClass> sbs(&result);
16856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    toUTF8(sbs);
16866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    return result;
16876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  }
16886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
16896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif
16906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
16916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
16926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Convert the UnicodeString to UTF-32.
16936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Unpaired surrogates are replaced with U+FFFD.
16946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Calls u_strToUTF32WithSub().
16956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
16966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param utf32 destination string buffer, can be NULL if capacity==0
16976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param capacity the number of UChar32s available at utf32
16986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param errorCode Standard ICU error code. Its input value must
16996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  pass the U_SUCCESS() test, or else the function returns
17006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  immediately. Check for U_FAILURE() on output or use with
17016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  function chaining. (See User Guide for details.)
17026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The length of the UTF-32 string.
17036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see fromUTF32
17046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 4.2
17056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
17066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  int32_t toUTF32(UChar32 *utf32, int32_t capacity, UErrorCode &errorCode) const;
17076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
17086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Length operations */
17096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
17106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
17116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Return the length of the UnicodeString object.
17126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The length is the number of UChar code units are in the UnicodeString.
17136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If you want the number of code points, please use countChar32().
17146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return the length of the UnicodeString object
17156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see countChar32
17166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
17176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
17186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t length(void) const;
17196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
17206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
17216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Count Unicode code points in the length UChar code units of the string.
17226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * A code point may occupy either one or two UChar code units.
17236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Counting code points involves reading all code units.
17246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
17256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This functions is basically the inverse of moveIndex32().
17266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
17276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the index of the first code unit to check
17286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of UChar code units to check
17296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return the number of code points in the specified code units
17306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see length
17316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
17326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
17336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  int32_t
17346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  countChar32(int32_t start=0, int32_t length=INT32_MAX) const;
17356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
17366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
17376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Check if the length UChar code units of the string
17386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * contain more Unicode code points than a certain number.
17396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This is more efficient than counting all code points in this part of the string
17406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * and comparing that number with a threshold.
17416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function may not need to scan the string at all if the length
17426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * falls within a certain range, and
17436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * never needs to count more than 'number+1' code points.
17446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Logically equivalent to (countChar32(start, length)>number).
17456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * A Unicode code point may occupy either one or two UChar code units.
17466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
17476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the index of the first code unit to check (0 for the entire string)
17486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of UChar code units to check
17496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *               (use INT32_MAX for the entire string; remember that start/length
17506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                values are pinned)
17516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param number The number of code points in the (sub)string is compared against
17526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *               the 'number' parameter.
17536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return Boolean value for whether the string contains more Unicode code points
17546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *         than 'number'. Same as (u_countChar32(s, length)>number).
17556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see countChar32
17566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see u_strHasMoreChar32Than
17576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.4
17586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
17596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UBool
17606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  hasMoreChar32Than(int32_t start, int32_t length, int32_t number) const;
17616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
17626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
17636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Determine if this string is empty.
17646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if this string contains 0 characters, FALSE otherwise.
17656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
17666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
17676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool isEmpty(void) const;
17686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
17696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
17706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Return the capacity of the internal buffer of the UnicodeString object.
17716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This is useful together with the getBuffer functions.
17726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * See there for details.
17736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
17746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return the number of UChars available in the internal buffer
17756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see getBuffer
17766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
17776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
17786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t getCapacity(void) const;
17796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
17806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Other operations */
17816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
17826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
17836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Generate a hash code for this object.
17846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return The hash code of this UnicodeString.
17856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
17866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
17876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline int32_t hashCode(void) const;
17886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
17896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
17906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Determine if this object contains a valid string.
17916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * A bogus string has no value. It is different from an empty string,
17926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * although in both cases isEmpty() returns TRUE and length() returns 0.
17936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * setToBogus() and isBogus() can be used to indicate that no string value is available.
17946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * For a bogus string, getBuffer() and getTerminatedBuffer() return NULL, and
17956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * length() returns 0.
17966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
17976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if the string is bogus/invalid, FALSE otherwise
17986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see setToBogus()
17996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
18006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
18016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool isBogus(void) const;
18026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
18036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
18046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  //========================================
18056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  // Write operations
18066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  //========================================
18076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
18086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Assignment operations */
18096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
18106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
18116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Assignment operator.  Replace the characters in this UnicodeString
18126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * with the characters from <TT>srcText</TT>.
18136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText The text containing the characters to replace
18146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
18156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
18166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
18176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString &operator=(const UnicodeString &srcText);
18186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
18196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
18206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Almost the same as the assignment operator.
18216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace the characters in this UnicodeString
18226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * with the characters from <code>srcText</code>.
18236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
18246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function works the same as the assignment operator
18256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * for all strings except for ones that are readonly aliases.
18266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
18276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Starting with ICU 2.4, the assignment operator and the copy constructor
18286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * allocate a new buffer and copy the buffer contents even for readonly aliases.
18296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function implements the old, more efficient but less safe behavior
18306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * of making this string also a readonly alias to the same buffer.
18316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
18326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The fastCopyFrom function must be used only if it is known that the lifetime of
18336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this UnicodeString does not exceed the lifetime of the aliased buffer
18346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * including its contents, for example for strings from resource bundles
18356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or aliases to string constants.
18366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
18376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param src The text containing the characters to replace.
18386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
18396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.4
18406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
18416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString &fastCopyFrom(const UnicodeString &src);
18426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
18436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
18446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Assignment operator.  Replace the characters in this UnicodeString
18456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * with the code unit <TT>ch</TT>.
18466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param ch the code unit to replace
18476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
18486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
18496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
18506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& operator= (UChar ch);
18516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
18526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
18536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Assignment operator.  Replace the characters in this UnicodeString
18546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * with the code point <TT>ch</TT>.
18556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param ch the code point to replace
18566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
18576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
18586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
18596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& operator= (UChar32 ch);
18606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
18616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
18626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Set the text in the UnicodeString object to the characters
18636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcText</TT> in the range
18646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcText.length()</TT>).
18656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcText</TT> is not modified.
18666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the source for the new characters
18676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> where new characters
18686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * will be obtained
18696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
18706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.2
18716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
18726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& setTo(const UnicodeString& srcText,
18736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org               int32_t srcStart);
18746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
18756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
18766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Set the text in the UnicodeString object to the characters
18776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcText</TT> in the range
18786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>).
18796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcText</TT> is not modified.
18806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the source for the new characters
18816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> where new characters
18826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * will be obtained
18836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcText</TT> in the
18846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * replace string.
18856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
18866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
18876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
18886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& setTo(const UnicodeString& srcText,
18896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org               int32_t srcStart,
18906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org               int32_t srcLength);
18916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
18926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
18936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Set the text in the UnicodeString object to the characters in
18946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcText</TT>.
18956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcText</TT> is not modified.
18966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the source for the new characters
18976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
18986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
18996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
19006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& setTo(const UnicodeString& srcText);
19016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
19026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
19036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Set the characters in the UnicodeString object to the characters
19046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcChars</TT>. <TT>srcChars</TT> is not modified.
19056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars the source for the new characters
19066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of Unicode characters in srcChars.
19076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
19086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
19096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
19106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& setTo(const UChar *srcChars,
19116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org               int32_t srcLength);
19126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
19136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
19146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Set the characters in the UnicodeString object to the code unit
19156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcChar</TT>.
19166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChar the code unit which becomes the UnicodeString's character
19176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * content
19186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
19196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
19206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
19216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& setTo(UChar srcChar);
19226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
19236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
19246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Set the characters in the UnicodeString object to the code point
19256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcChar</TT>.
19266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChar the code point which becomes the UnicodeString's character
19276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * content
19286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
19296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
19306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
19316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& setTo(UChar32 srcChar);
19326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
19336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
19346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Aliasing setTo() function, analogous to the readonly-aliasing UChar* constructor.
19356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The text will be used for the UnicodeString object, but
19366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * it will not be released when the UnicodeString is destroyed.
19376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This has copy-on-write semantics:
19386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * When the string is modified, then the buffer is first copied into
19396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * newly allocated memory.
19406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The aliased buffer is never modified.
19416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
19426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * In an assignment to another UnicodeString, when using the copy constructor
19436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * or the assignment operator, the text will be copied.
19446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * When using fastCopyFrom(), the text will be aliased again,
19456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * so that both strings then alias the same readonly-text.
19466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
19476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param isTerminated specifies if <code>text</code> is <code>NUL</code>-terminated.
19486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                     This must be true if <code>textLength==-1</code>.
19496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text The characters to alias for the UnicodeString.
19506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param textLength The number of Unicode characters in <code>text</code> to alias.
19516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                   If -1, then this constructor will determine the length
19526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                   by calling <code>u_strlen()</code>.
19536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
19546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
19556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
19566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString &setTo(UBool isTerminated,
19576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                       const UChar *text,
19586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                       int32_t textLength);
19596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
19606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
19616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Aliasing setTo() function, analogous to the writable-aliasing UChar* constructor.
19626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The text will be used for the UnicodeString object, but
19636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * it will not be released when the UnicodeString is destroyed.
19646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This has write-through semantics:
19656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * For as long as the capacity of the buffer is sufficient, write operations
19666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * will directly affect the buffer. When more capacity is necessary, then
19676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * a new buffer will be allocated and the contents copied as with regularly
19686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * constructed strings.
19696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * In an assignment to another UnicodeString, the buffer will be copied.
19706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The extract(UChar *dst) function detects whether the dst pointer is the same
19716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * as the string buffer itself and will in this case not copy the contents.
19726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
19736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param buffer The characters to alias for the UnicodeString.
19746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param buffLength The number of Unicode characters in <code>buffer</code> to alias.
19756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param buffCapacity The size of <code>buffer</code> in UChars.
19766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
19776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
19786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
19796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString &setTo(UChar *buffer,
19806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                       int32_t buffLength,
19816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                       int32_t buffCapacity);
19826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
19836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
19846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Make this UnicodeString object invalid.
19856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The string will test TRUE with isBogus().
19866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
19876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * A bogus string has no value. It is different from an empty string.
19886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * It can be used to indicate that no string value is available.
19896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * getBuffer() and getTerminatedBuffer() return NULL, and
19906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * length() returns 0.
19916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
19926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This utility function is used throughout the UnicodeString
19936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * implementation to indicate that a UnicodeString operation failed,
19946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * and may be used in other functions,
19956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * especially but not exclusively when such functions do not
19966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * take a UErrorCode for simplicity.
19976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
19986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The following methods, and no others, will clear a string object's bogus flag:
19996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * - remove()
20006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * - remove(0, INT32_MAX)
20016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * - truncate(0)
20026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * - operator=() (assignment operator)
20036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * - setTo(...)
20046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
20056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The simplest ways to turn a bogus string into an empty one
20066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * is to use the remove() function.
20076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Examples for other functions that are equivalent to "set to empty string":
20086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * \code
20096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * if(s.isBogus()) {
20106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   s.remove();           // set to an empty string (remove all), or
20116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   s.remove(0, INT32_MAX); // set to an empty string (remove all), or
20126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   s.truncate(0);        // set to an empty string (complete truncation), or
20136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   s=UnicodeString();    // assign an empty string, or
20146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   s.setTo((UChar32)-1); // set to a pseudo code point that is out of range, or
20156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   static const UChar nul=0;
20166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *   s.setTo(&nul, 0);     // set to an empty C Unicode string
20176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * }
20186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * \endcode
20196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
20206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see isBogus()
20216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
20226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
20236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  void setToBogus();
20246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
20256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
20266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Set the character at the specified offset to the specified character.
20276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param offset A valid offset into the text of the character to set
20286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param ch The new character
20296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A reference to this
20306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
20316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
20326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& setCharAt(int32_t offset,
20336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org               UChar ch);
20346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
20356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
20366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Append operations */
20376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
20386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
20396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Append operator. Append the code unit <TT>ch</TT> to the UnicodeString
20406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * object.
20416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param ch the code unit to be appended
20426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
20436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
20446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
20456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org inline  UnicodeString& operator+= (UChar ch);
20466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
20476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
20486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Append operator. Append the code point <TT>ch</TT> to the UnicodeString
20496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * object.
20506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param ch the code point to be appended
20516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
20526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
20536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
20546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org inline  UnicodeString& operator+= (UChar32 ch);
20556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
20566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
20576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Append operator. Append the characters in <TT>srcText</TT> to the
20586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * UnicodeString object. <TT>srcText</TT> is not modified.
20596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the source for the new characters
20606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
20616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
20626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
20636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& operator+= (const UnicodeString& srcText);
20646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
20656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
20666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Append the characters
20676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcText</TT> in the range
20686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>) to the
20696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * UnicodeString object at offset <TT>start</TT>. <TT>srcText</TT>
20706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * is not modified.
20716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the source for the new characters
20726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> where new characters
20736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * will be obtained
20746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcText</TT> in
20756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the append string
20766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
20776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
20786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
20796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& append(const UnicodeString& srcText,
20806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcStart,
20816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcLength);
20826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
20836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
20846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Append the characters in <TT>srcText</TT> to the UnicodeString object.
20856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcText</TT> is not modified.
20866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the source for the new characters
20876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
20886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
20896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
20906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& append(const UnicodeString& srcText);
20916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
20926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
20936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Append the characters in <TT>srcChars</TT> in the range
20946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>) to the UnicodeString
20956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * object at offset
20966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>start</TT>. <TT>srcChars</TT> is not modified.
20976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars the source for the new characters
20986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcChars</TT> where new characters
20996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * will be obtained
21006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT> in
21016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  the append string; can be -1 if <TT>srcChars</TT> is NUL-terminated
21026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
21036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
21046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
21056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& append(const UChar *srcChars,
21066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcStart,
21076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcLength);
21086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
21096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
21106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Append the characters in <TT>srcChars</TT> to the UnicodeString object
21116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * at offset <TT>start</TT>. <TT>srcChars</TT> is not modified.
21126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars the source for the new characters
21136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of Unicode characters in <TT>srcChars</TT>;
21146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  can be -1 if <TT>srcChars</TT> is NUL-terminated
21156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
21166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
21176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
21186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& append(const UChar *srcChars,
21196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcLength);
21206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
21216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
21226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Append the code unit <TT>srcChar</TT> to the UnicodeString object.
21236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChar the code unit to append
21246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
21256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
21266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
21276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& append(UChar srcChar);
21286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
21296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
21306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Append the code point <TT>srcChar</TT> to the UnicodeString object.
21316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChar the code point to append
21326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
21336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
21346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
21356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& append(UChar32 srcChar);
21366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
21376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
21386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Insert operations */
21396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
21406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
21416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Insert the characters in <TT>srcText</TT> in the range
21426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>) into the UnicodeString
21436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * object at offset <TT>start</TT>. <TT>srcText</TT> is not modified.
21446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset where the insertion begins
21456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the source for the new characters
21466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> where new characters
21476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * will be obtained
21486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcText</TT> in
21496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the insert string
21506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
21516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
21526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
21536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& insert(int32_t start,
21546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            const UnicodeString& srcText,
21556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcStart,
21566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcLength);
21576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
21586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
21596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Insert the characters in <TT>srcText</TT> into the UnicodeString object
21606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * at offset <TT>start</TT>. <TT>srcText</TT> is not modified.
21616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset where the insertion begins
21626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the source for the new characters
21636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
21646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
21656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
21666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& insert(int32_t start,
21676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            const UnicodeString& srcText);
21686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
21696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
21706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Insert the characters in <TT>srcChars</TT> in the range
21716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>) into the UnicodeString
21726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *  object at offset <TT>start</TT>. <TT>srcChars</TT> is not modified.
21736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the insertion begins
21746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars the source for the new characters
21756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcChars</TT> where new characters
21766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * will be obtained
21776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT>
21786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the insert string
21796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
21806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
21816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
21826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& insert(int32_t start,
21836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            const UChar *srcChars,
21846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcStart,
21856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcLength);
21866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
21876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
21886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Insert the characters in <TT>srcChars</TT> into the UnicodeString object
21896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * at offset <TT>start</TT>. <TT>srcChars</TT> is not modified.
21906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset where the insertion begins
21916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars the source for the new characters
21926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of Unicode characters in srcChars.
21936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
21946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
21956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
21966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& insert(int32_t start,
21976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            const UChar *srcChars,
21986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            int32_t srcLength);
21996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
22006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
22016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Insert the code unit <TT>srcChar</TT> into the UnicodeString object at
22026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * offset <TT>start</TT>.
22036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the insertion occurs
22046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChar the code unit to insert
22056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
22066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
22076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
22086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& insert(int32_t start,
22096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            UChar srcChar);
22106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
22116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
22126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Insert the code point <TT>srcChar</TT> into the UnicodeString object at
22136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * offset <TT>start</TT>.
22146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the insertion occurs
22156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChar the code point to insert
22166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
22176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
22186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
22196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& insert(int32_t start,
22206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org            UChar32 srcChar);
22216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
22226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
22236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Replace operations */
22246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
22256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
22266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace the characters in the range
22276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) with the characters in
22286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcText</TT> in the range
22296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>).
22306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcText</TT> is not modified.
22316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the replace operation begins
22326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters to replace. The character at
22336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>start + length</TT> is not modified.
22346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the source for the new characters
22356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcText</TT> where new characters
22366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * will be obtained
22376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcText</TT> in
22386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the replace string
22396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
22406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
22416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
22426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& replace(int32_t start,
22436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t length,
22446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             const UnicodeString& srcText,
22456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t srcStart,
22466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t srcLength);
22476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
22486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
22496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace the characters in the range
22506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>)
22516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * with the characters in <TT>srcText</TT>.  <TT>srcText</TT> is
22526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *  not modified.
22536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the replace operation begins
22546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters to replace. The character at
22556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>start + length</TT> is not modified.
22566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the source for the new characters
22576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
22586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
22596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
22606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& replace(int32_t start,
22616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t length,
22626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             const UnicodeString& srcText);
22636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
22646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
22656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace the characters in the range
22666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) with the characters in
22676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcChars</TT> in the range
22686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcStart + srcLength</TT>). <TT>srcChars</TT>
22696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * is not modified.
22706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the replace operation begins
22716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters to replace.  The character at
22726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>start + length</TT> is not modified.
22736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars the source for the new characters
22746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcChars</TT> where new characters
22756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * will be obtained
22766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of characters in <TT>srcChars</TT>
22776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the replace string
22786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
22796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
22806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
22816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& replace(int32_t start,
22826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t length,
22836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             const UChar *srcChars,
22846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t srcStart,
22856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t srcLength);
22866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
22876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
22886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace the characters in the range
22896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) with the characters in
22906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcChars</TT>.  <TT>srcChars</TT> is not modified.
22916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the replace operation begins
22926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length number of characters to replace.  The character at
22936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>start + length</TT> is not modified.
22946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChars the source for the new characters
22956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLength the number of Unicode characters in srcChars
22966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
22976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
22986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
22996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& replace(int32_t start,
23006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t length,
23016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             const UChar *srcChars,
23026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t srcLength);
23036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
23046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
23056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace the characters in the range
23066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) with the code unit
23076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcChar</TT>.
23086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the replace operation begins
23096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters to replace.  The character at
23106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>start + length</TT> is not modified.
23116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChar the new code unit
23126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
23136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
23146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
23156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& replace(int32_t start,
23166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t length,
23176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             UChar srcChar);
23186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
23196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
23206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace the characters in the range
23216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) with the code point
23226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>srcChar</TT>.
23236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the replace operation begins
23246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters to replace.  The character at
23256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <TT>start + length</TT> is not modified.
23266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcChar the new code point
23276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
23286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
23296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
23306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& replace(int32_t start, int32_t length, UChar32 srcChar);
23316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
23326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
23336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace the characters in the range [<TT>start</TT>, <TT>limit</TT>)
23346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * with the characters in <TT>srcText</TT>. <TT>srcText</TT> is not modified.
23356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the replace operation begins
23366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param limit the offset immediately following the replace range
23376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the source for the new characters
23386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
23396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
23406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
23416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& replaceBetween(int32_t start,
23426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                int32_t limit,
23436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                const UnicodeString& srcText);
23446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
23456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
23466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace the characters in the range [<TT>start</TT>, <TT>limit</TT>)
23476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * with the characters in <TT>srcText</TT> in the range
23486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>srcStart</TT>, <TT>srcLimit</TT>). <TT>srcText</TT> is not modified.
23496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset at which the replace operation begins
23506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param limit the offset immediately following the replace range
23516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcText the source for the new characters
23526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcStart the offset into <TT>srcChars</TT> where new characters
23536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * will be obtained
23546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param srcLimit the offset immediately following the range to copy
23556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in <TT>srcText</TT>
23566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
23576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
23586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
23596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& replaceBetween(int32_t start,
23606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                int32_t limit,
23616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                const UnicodeString& srcText,
23626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                int32_t srcStart,
23636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                int32_t srcLimit);
23646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
23656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
23666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace a substring of this object with the given text.
23676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the beginning index, inclusive; <code>0 <= start
23686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <= limit</code>.
23696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param limit the ending index, exclusive; <code>start <= limit
23706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <= length()</code>.
23716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param text the text to replace characters <code>start</code>
23726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * to <code>limit - 1</code>
23736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
23746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
23756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  virtual void handleReplaceBetween(int32_t start,
23766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                    int32_t limit,
23776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                    const UnicodeString& text);
23786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
23796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
23806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replaceable API
23816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if it has MetaData
23826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.4
23836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
23846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  virtual UBool hasMetaData() const;
23856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
23866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
23876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Copy a substring of this object, retaining attribute (out-of-band)
23886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * information.  This method is used to duplicate or reorder substrings.
23896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The destination index must not overlap the source range.
23906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
23916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the beginning index, inclusive; <code>0 <= start <=
23926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * limit</code>.
23936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param limit the ending index, exclusive; <code>start <= limit <=
23946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * length()</code>.
23956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param dest the destination index.  The characters from
23966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>start..limit-1</code> will be copied to <code>dest</code>.
23976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Implementations of this method may assume that <code>dest <= start ||
23986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * dest >= limit</code>.
23996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
24006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
24016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  virtual void copy(int32_t start, int32_t limit, int32_t dest);
24026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
24036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Search and replace operations */
24046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
24056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
24066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace all occurrences of characters in oldText with the characters
24076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in newText
24086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param oldText the text containing the search text
24096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param newText the text containing the replacement text
24106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
24116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
24126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
24136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& findAndReplace(const UnicodeString& oldText,
24146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                const UnicodeString& newText);
24156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
24166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
24176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace all occurrences of characters in oldText with characters
24186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in newText
24196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the range [<TT>start</TT>, <TT>start + length</TT>).
24206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the start of the range in which replace will performed
24216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the length of the range in which replace will be performed
24226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param oldText the text containing the search text
24236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param newText the text containing the replacement text
24246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
24256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
24266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
24276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& findAndReplace(int32_t start,
24286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                int32_t length,
24296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                const UnicodeString& oldText,
24306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                const UnicodeString& newText);
24316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
24326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
24336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Replace all occurrences of characters in oldText in the range
24346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>oldStart</TT>, <TT>oldStart + oldLength</TT>) with the characters
24356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in newText in the range
24366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>newStart</TT>, <TT>newStart + newLength</TT>)
24376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in the range [<TT>start</TT>, <TT>start + length</TT>).
24386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the start of the range in which replace will performed
24396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the length of the range in which replace will be performed
24406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param oldText the text containing the search text
24416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param oldStart the start of the search range in <TT>oldText</TT>
24426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param oldLength the length of the search range in <TT>oldText</TT>
24436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param newText the text containing the replacement text
24446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param newStart the start of the replacement range in <TT>newText</TT>
24456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param newLength the length of the replacement range in <TT>newText</TT>
24466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
24476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
24486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
24496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& findAndReplace(int32_t start,
24506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                int32_t length,
24516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                const UnicodeString& oldText,
24526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                int32_t oldStart,
24536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                int32_t oldLength,
24546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                const UnicodeString& newText,
24556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                int32_t newStart,
24566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                int32_t newLength);
24576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
24586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
24596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Remove operations */
24606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
24616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
24626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Remove all characters from the UnicodeString object.
24636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
24646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
24656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
24666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& remove(void);
24676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
24686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
24696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Remove the characters in the range
24706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>start + length</TT>) from the UnicodeString object.
24716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset of the first character to remove
24726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters to remove
24736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
24746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
24756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
24766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& remove(int32_t start,
24776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                               int32_t length = (int32_t)INT32_MAX);
24786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
24796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
24806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Remove the characters in the range
24816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<TT>start</TT>, <TT>limit</TT>) from the UnicodeString object.
24826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset of the first character to remove
24836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param limit the offset immediately following the range to remove
24846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
24856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
24866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
24876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& removeBetween(int32_t start,
24886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                      int32_t limit = (int32_t)INT32_MAX);
24896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
24906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
24916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Retain only the characters in the range
24926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * [<code>start</code>, <code>limit</code>) from the UnicodeString object.
24936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Removes characters before <code>start</code> and at and after <code>limit</code>.
24946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the offset of the first character to retain
24956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param limit the offset immediately following the range to retain
24966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
24976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 4.4
24986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
24996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString &retainBetween(int32_t start, int32_t limit = INT32_MAX);
25006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Length operations */
25026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
25046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Pad the start of this UnicodeString with the character <TT>padChar</TT>.
25056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If the length of this UnicodeString is less than targetLength,
25066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * length() - targetLength copies of padChar will be added to the
25076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * beginning of this UnicodeString.
25086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param targetLength the desired length of the string
25096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param padChar the character to use for padding. Defaults to
25106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * space (U+0020)
25116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if the text was padded, FALSE otherwise.
25126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
25136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
25146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UBool padLeading(int32_t targetLength,
25156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                    UChar padChar = 0x0020);
25166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
25186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Pad the end of this UnicodeString with the character <TT>padChar</TT>.
25196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * If the length of this UnicodeString is less than targetLength,
25206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * length() - targetLength copies of padChar will be added to the
25216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * end of this UnicodeString.
25226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param targetLength the desired length of the string
25236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param padChar the character to use for padding. Defaults to
25246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * space (U+0020)
25256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if the text was padded, FALSE otherwise.
25266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
25276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
25286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UBool padTrailing(int32_t targetLength,
25296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                     UChar padChar = 0x0020);
25306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
25326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Truncate this UnicodeString to the <TT>targetLength</TT>.
25336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param targetLength the desired length of this UnicodeString.
25346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return TRUE if the text was truncated, FALSE otherwise
25356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
25366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
25376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UBool truncate(int32_t targetLength);
25386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
25406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Trims leading and trailing whitespace from this UnicodeString.
25416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
25426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
25436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
25446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& trim(void);
25456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /* Miscellaneous operations */
25486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
25506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Reverse this UnicodeString in place.
25516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
25526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
25536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
25546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& reverse(void);
25556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
25576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Reverse the range [<TT>start</TT>, <TT>start + length</TT>) in
25586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * this UnicodeString.
25596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param start the start of the range to reverse
25606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param length the number of characters to to reverse
25616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return a reference to this
25626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
25636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
25646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  inline UnicodeString& reverse(int32_t start,
25656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t length);
25666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
25686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Convert the characters in this to UPPER CASE following the conventions of
25696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the default locale.
25706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A reference to this.
25716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
25726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
25736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& toUpper(void);
25746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
25766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Convert the characters in this to UPPER CASE following the conventions of
25776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * a specific locale.
25786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param locale The locale containing the conventions to use.
25796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A reference to this.
25806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
25816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
25826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& toUpper(const Locale& locale);
25836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
25856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Convert the characters in this to lower case following the conventions of
25866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the default locale.
25876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A reference to this.
25886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
25896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
25906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& toLower(void);
25916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
25926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
25936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Convert the characters in this to lower case following the conventions of
25946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * a specific locale.
25956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param locale The locale containing the conventions to use.
25966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A reference to this.
25976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
25986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
25996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString& toLower(const Locale& locale);
26006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
26016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#if !UCONFIG_NO_BREAK_ITERATION
26026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
26036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
26046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Titlecase this string, convenience function using the default locale.
26056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Casing is locale-dependent and context-sensitive.
26076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Titlecasing uses a break iterator to find the first characters of words
26086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * that are to be titlecased. It titlecases those characters and lowercases
26096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * all others.
26106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The titlecase break iterator can be provided to customize for arbitrary
26126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * styles, using rules and dictionaries beyond the standard iterators.
26136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * It may be more efficient to always provide an iterator to avoid
26146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * opening and closing one for each string.
26156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The standard titlecase iterator for the root locale implements the
26166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * algorithm of Unicode TR 21.
26176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function uses only the setText(), first() and next() methods of the
26196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * provided break iterator.
26206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param titleIter A break iterator to find the first characters of words
26226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  that are to be titlecased.
26236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  If none is provided (0), then a standard titlecase
26246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  break iterator is opened.
26256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  Otherwise the provided iterator is set to the string's text.
26266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A reference to this.
26276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.1
26286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
26296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString &toTitle(BreakIterator *titleIter);
26306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
26316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
26326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Titlecase this string.
26336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Casing is locale-dependent and context-sensitive.
26356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Titlecasing uses a break iterator to find the first characters of words
26366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * that are to be titlecased. It titlecases those characters and lowercases
26376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * all others.
26386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The titlecase break iterator can be provided to customize for arbitrary
26406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * styles, using rules and dictionaries beyond the standard iterators.
26416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * It may be more efficient to always provide an iterator to avoid
26426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * opening and closing one for each string.
26436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The standard titlecase iterator for the root locale implements the
26446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * algorithm of Unicode TR 21.
26456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function uses only the setText(), first() and next() methods of the
26476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * provided break iterator.
26486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param titleIter A break iterator to find the first characters of words
26506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  that are to be titlecased.
26516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  If none is provided (0), then a standard titlecase
26526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  break iterator is opened.
26536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  Otherwise the provided iterator is set to the string's text.
26546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param locale    The locale to consider.
26556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A reference to this.
26566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.1
26576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
26586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString &toTitle(BreakIterator *titleIter, const Locale &locale);
26596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
26606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
26616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Titlecase this string, with options.
26626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Casing is locale-dependent and context-sensitive.
26646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Titlecasing uses a break iterator to find the first characters of words
26656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * that are to be titlecased. It titlecases those characters and lowercases
26666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * all others. (This can be modified with options.)
26676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The titlecase break iterator can be provided to customize for arbitrary
26696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * styles, using rules and dictionaries beyond the standard iterators.
26706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * It may be more efficient to always provide an iterator to avoid
26716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * opening and closing one for each string.
26726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The standard titlecase iterator for the root locale implements the
26736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * algorithm of Unicode TR 21.
26746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This function uses only the setText(), first() and next() methods of the
26766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * provided break iterator.
26776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param titleIter A break iterator to find the first characters of words
26796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  that are to be titlecased.
26806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  If none is provided (0), then a standard titlecase
26816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  break iterator is opened.
26826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *                  Otherwise the provided iterator is set to the string's text.
26836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param locale    The locale to consider.
26846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param options Options bit set, see ucasemap_open().
26856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @return A reference to this.
26866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see U_TITLECASE_NO_LOWERCASE
26876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see U_TITLECASE_NO_BREAK_ADJUSTMENT
26886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see ucasemap_open
26896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 3.8
26906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
26916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UnicodeString &toTitle(BreakIterator *titleIter, const Locale &locale, uint32_t options);
26926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
26936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif
26946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
26956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
26966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Case-folds the characters in this string.
26976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
26986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Case-folding is locale-independent and not context-sensitive,
26996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * but there is an option for whether to include or exclude mappings for dotted I
27006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * and dotless i that are marked with 'T' in CaseFolding.txt.
27016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
27026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The result may be longer or shorter than the original.
27036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *
27046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @param options Either U_FOLD_CASE_DEFAULT or U_FOLD_CASE_EXCLUDE_SPECIAL_I
27056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org<