]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/unicode/utext.h
ICU-59180.0.1.tar.gz
[apple/icu.git] / icuSources / common / unicode / utext.h
index 088a5327397fd6cf85eb3412057eff5d90de012f..657ba755af6efb035536503e23fee73711100975 100644 (file)
@@ -1,12 +1,14 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 *******************************************************************************
 *
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2004-2010, International Business Machines
+*   Copyright (C) 2004-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
 *   file name:  utext.h
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
 *   file name:  utext.h
-*   encoding:   US-ASCII
+*   encoding:   UTF-8
 *   tab size:   8 (not used)
 *   indentation:4
 *
 *   tab size:   8 (not used)
 *   indentation:4
 *
 #include "unicode/rep.h"
 #include "unicode/unistr.h"
 #include "unicode/chariter.h"
 #include "unicode/rep.h"
 #include "unicode/unistr.h"
 #include "unicode/chariter.h"
-#endif
+#endif // U_SHOW_CPLUSPLUS_API
 
 
 U_CDECL_BEGIN
 
 
 U_CDECL_BEGIN
@@ -198,7 +200,7 @@ U_DEFINE_LOCAL_OPEN_POINTER(LocalUTextPointer, UText, utext_close);
 
 U_NAMESPACE_END
 
 
 U_NAMESPACE_END
 
-#endif
+#endif // U_SHOW_CPLUSPLUS_API
 
 /**
  * Open a read-only UText implementation for UTF-8 strings.
 
 /**
  * Open a read-only UText implementation for UTF-8 strings.
@@ -257,7 +259,7 @@ utext_openUChars(UText *ut, const UChar *s, int64_t length, UErrorCode *status);
  * @stable ICU 3.4
  */
 U_STABLE UText * U_EXPORT2
  * @stable ICU 3.4
  */
 U_STABLE UText * U_EXPORT2
-utext_openUnicodeString(UText *ut, U_NAMESPACE_QUALIFIER UnicodeString *s, UErrorCode *status);
+utext_openUnicodeString(UText *ut, icu::UnicodeString *s, UErrorCode *status);
 
 
 /**
 
 
 /**
@@ -273,7 +275,7 @@ utext_openUnicodeString(UText *ut, U_NAMESPACE_QUALIFIER UnicodeString *s, UErro
  * @stable ICU 3.4
  */
 U_STABLE UText * U_EXPORT2
  * @stable ICU 3.4
  */
 U_STABLE UText * U_EXPORT2
-utext_openConstUnicodeString(UText *ut, const U_NAMESPACE_QUALIFIER UnicodeString *s, UErrorCode *status);
+utext_openConstUnicodeString(UText *ut, const icu::UnicodeString *s, UErrorCode *status);
 
 
 /**
 
 
 /**
@@ -289,7 +291,7 @@ utext_openConstUnicodeString(UText *ut, const U_NAMESPACE_QUALIFIER UnicodeStrin
  * @stable ICU 3.4
  */
 U_STABLE UText * U_EXPORT2
  * @stable ICU 3.4
  */
 U_STABLE UText * U_EXPORT2
-utext_openReplaceable(UText *ut, U_NAMESPACE_QUALIFIER Replaceable *rep, UErrorCode *status);
+utext_openReplaceable(UText *ut, icu::Replaceable *rep, UErrorCode *status);
 
 /**
  * Open a  UText implementation over an ICU CharacterIterator.
 
 /**
  * Open a  UText implementation over an ICU CharacterIterator.
@@ -304,9 +306,9 @@ utext_openReplaceable(UText *ut, U_NAMESPACE_QUALIFIER Replaceable *rep, UErrorC
  * @stable ICU 3.4
  */
 U_STABLE UText * U_EXPORT2
  * @stable ICU 3.4
  */
 U_STABLE UText * U_EXPORT2
-utext_openCharacterIterator(UText *ut, U_NAMESPACE_QUALIFIER CharacterIterator *ic, UErrorCode *status);
+utext_openCharacterIterator(UText *ut, icu::CharacterIterator *ci, UErrorCode *status);
 
 
-#endif
+#endif // U_SHOW_CPLUSPLUS_API
 
 
 /**
 
 
 /**
@@ -675,147 +677,6 @@ utext_extract(UText *ut,
              UErrorCode *status);
 
 
              UErrorCode *status);
 
 
-/**
- * Compare two UTexts (binary order). The comparison begins at each source text's
- * iteration position. The iteration position of each UText will be left following
- * the last character compared.
- *
- * The comparison is done in code point order; unlike u_strCompare, you
- * cannot choose to use code unit order. This is because the characters
- * in a UText are accessed one code point at a time, and may not be from a UTF-16
- * context.
- *
- * This functions works with strings of different explicitly specified lengths
- * unlike the ANSI C-like u_strcmp() and u_memcmp() etc.
- * A length argument of -1 signifies that as much of the string should be used as
- * is necessary to compare with the other string. If both length arguments are -1,
- * the entire remaining portionss of both strings are used.
- *
- * @param s1 First source string.
- * @param length1 Length of first source string in UTF-32 code points.
- *
- * @param s2 Second source string.
- * @param length2 Length of second source string in UTF-32 code points.
- *
- * @return <0 or 0 or >0 as usual for string comparisons
- *
- * @internal ICU 4.4 technology preview
- */
-U_INTERNAL int32_t U_EXPORT2
-utext_compare(UText *s1, int32_t length1,
-              UText *s2, int32_t length2);    
-
-/**
- * Compare two UTexts (binary order). The comparison begins at each source text's
- * iteration position. The iteration position of each UText will be left following
- * the last character compared. This method differs from utext_compare in that
- * it accepts native limits rather than lengths for each string.
- *
- * The comparison is done in code point order; unlike u_strCompare, you
- * cannot choose to use code unit order. This is because the characters
- * in a UText are accessed one code point at a time, and may not be from a UTF-16
- * context.
- *
- * This functions works with strings of different explicitly specified lengths
- * unlike the ANSI C-like u_strcmp() and u_memcmp() etc.
- * A limit argument of -1 signifies that as much of the string should be used as
- * is necessary to compare with the other string. If both limit arguments are -1,
- * the entire remaining portionss of both strings are used.
- *
- * @param s1 First source string.
- * @param limit1 Native index of the last character in the first source string to be considered.
- *
- * @param s2 Second source string.
- * @param limit2 Native index of the last character in the second source string to be considered.
- *
- * @return <0 or 0 or >0 as usual for string comparisons
- *
- * @internal ICU 4.4 technology preview
- */
-U_INTERNAL int32_t U_EXPORT2
-utext_compareNativeLimit(UText *s1, int64_t limit1,
-                         UText *s2, int64_t limit2);    
-
-/**
- * Compare two UTexts case-insensitively using full case folding. The comparison
- * begins at each source text's iteration position. The iteration position of each
- * UText will be left following the last character compared.
- *
- * The comparison is done in code point order; this is because the characters
- * in a UText are accessed one code point at a time, and may not be from a UTF-16
- * context.
- *
- * This functions works with strings of different explicitly specified lengths
- * unlike the ANSI C-like u_strcmp() and u_memcmp() etc.
- * A length argument of -1 signifies that as much of the string should be used as
- * is necessary to compare with the other string. If both length arguments are -1,
- * the entire remaining portionss of both strings are used.
- *
- * @param s1 First source string.
- * @param length1 Length of first source string in UTF-32 code points.
- *
- * @param s2 Second source string.
- * @param length2 Length of second source string in UTF-32 code points.
- *
- * @param options A bit set of options:
- *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
- *     Comparison in code point order with default case folding.
- *
- *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
- *
- * @param pErrorCode Must be a valid pointer to an error code value,
- *                  which must not indicate a failure before the function call.
- *
- * @return <0 or 0 or >0 as usual for string comparisons
- *
- * @internal ICU 4.4 technology preview
- */
-U_INTERNAL int32_t U_EXPORT2
-utext_caseCompare(UText *s1, int32_t length1,
-                  UText *s2, int32_t length2,
-                  uint32_t options, UErrorCode *pErrorCode);    
-
-/**
- * Compare two UTexts case-insensitively using full case folding. The comparison
- * begins at each source text's iteration position. The iteration position of each
- * UText will be left following the last character compared. This method differs from
- * utext_caseCompare in that it accepts native limits rather than lengths for each
- * string.
- *
- * The comparison is done in code point order; this is because the characters
- * in a UText are accessed one code point at a time, and may not be from a UTF-16
- * context.
- *
- * This functions works with strings of different explicitly specified lengths
- * unlike the ANSI C-like u_strcmp() and u_memcmp() etc.
- * A limit argument of -1 signifies that as much of the string should be used as
- * is necessary to compare with the other string. If both length arguments are -1,
- * the entire remaining portionss of both strings are used.
- *
- * @param s1 First source string.
- * @param limit1 Native index of the last character in the first source string to be considered.
- *
- * @param s2 Second source string.
- * @param limit2 Native index of the last character in the second source string to be considered.
- *
- * @param options A bit set of options:
- *   - U_FOLD_CASE_DEFAULT or 0 is used for default options:
- *     Comparison in code point order with default case folding.
- *
- *   - U_FOLD_CASE_EXCLUDE_SPECIAL_I
- *
- * @param pErrorCode Must be a valid pointer to an error code value,
- *                  which must not indicate a failure before the function call.
- *
- * @return <0 or 0 or >0 as usual for string comparisons
- *
- * @internal ICU 4.4 technology preview
- */
-U_INTERNAL int32_t U_EXPORT2
-utext_caseCompareNativeLimit(UText *s1, int64_t limit1,
-                             UText *s2, int64_t limit2,
-                             uint32_t options, UErrorCode *pErrorCode);    
-
 
 /************************************************************************************
  *
 
 /************************************************************************************
  *
@@ -832,6 +693,7 @@ utext_caseCompareNativeLimit(UText *s1, int64_t limit1,
  *
  ************************************************************************************/
 
  *
  ************************************************************************************/
 
+#ifndef U_HIDE_INTERNAL_API
 /**
  * inline version of utext_current32(), for performance-critical situations.
  *
 /**
  * inline version of utext_current32(), for performance-critical situations.
  *
@@ -844,6 +706,7 @@ utext_caseCompareNativeLimit(UText *s1, int64_t limit1,
 #define UTEXT_CURRENT32(ut)  \
     ((ut)->chunkOffset < (ut)->chunkLength && ((ut)->chunkContents)[(ut)->chunkOffset]<0xd800 ? \
     ((ut)->chunkContents)[((ut)->chunkOffset)] : utext_current32(ut))
 #define UTEXT_CURRENT32(ut)  \
     ((ut)->chunkOffset < (ut)->chunkLength && ((ut)->chunkContents)[(ut)->chunkOffset]<0xd800 ? \
     ((ut)->chunkContents)[((ut)->chunkOffset)] : utext_current32(ut))
+#endif  /* U_HIDE_INTERNAL_API */
 
 /**
  * inline version of utext_next32(), for performance-critical situations.
 
 /**
  * inline version of utext_next32(), for performance-critical situations.
@@ -1692,6 +1555,7 @@ struct UText {
 U_STABLE UText * U_EXPORT2
 utext_setup(UText *ut, int32_t extraSpace, UErrorCode *status);
 
 U_STABLE UText * U_EXPORT2
 utext_setup(UText *ut, int32_t extraSpace, UErrorCode *status);
 
+#ifndef U_HIDE_INTERNAL_API
 /**
   * @internal
   *  Value used to help identify correctly initialized UText structs.
 /**
   * @internal
   *  Value used to help identify correctly initialized UText structs.
@@ -1700,6 +1564,7 @@ utext_setup(UText *ut, int32_t extraSpace, UErrorCode *status);
 enum {
     UTEXT_MAGIC = 0x345ad82c
 };
 enum {
     UTEXT_MAGIC = 0x345ad82c
 };
+#endif  /* U_HIDE_INTERNAL_API */
 
 /**
  * initializer to be used with local (stack) instances of a UText
 
 /**
  * initializer to be used with local (stack) instances of a UText