/*
**********************************************************************
* Copyright (C) 1998-2011, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*
* File unistr.h
*
* Modification History:
*
* Date Name Description
* 09/25/98 stephen Creation.
* 11/11/98 stephen Changed per 11/9 code review.
* 04/20/99 stephen Overhauled per 4/16 code review.
* 11/18/99 aliu Made to inherit from Replaceable. Added method
* handleReplaceBetween(); other methods unchanged.
* 06/25/01 grhoten Remove dependency on iostream.
******************************************************************************
*/
#ifndef UNISTR_H
#define UNISTR_H
/**
* \file
* \brief C++ API: Unicode String
*/
#include "unicode/utypes.h"
#include "unicode/rep.h"
#include "unicode/std_string.h"
#include "unicode/stringpiece.h"
#include "unicode/bytestream.h"
struct UConverter; // unicode/ucnv.h
class StringThreadTest;
#ifndef U_COMPARE_CODE_POINT_ORDER
/* see also ustring.h and unorm.h */
/**
* Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc:
* Compare strings in code point order instead of code unit order.
* @stable ICU 2.2
*/
#define U_COMPARE_CODE_POINT_ORDER 0x8000
#endif
#ifndef USTRING_H
/**
* \ingroup ustring_ustrlen
*/
U_STABLE int32_t U_EXPORT2
u_strlen(const UChar *s);
#endif
U_NAMESPACE_BEGIN
class BreakIterator; // unicode/brkiter.h
class Locale; // unicode/locid.h
class StringCharacterIterator;
class UnicodeStringAppendable; // unicode/appendable.h
/* The <iostream> include has been moved to unicode/ustream.h */
/**
* Constant to be used in the UnicodeString(char *, int32_t, EInvariant) constructor
* which constructs a Unicode string from an invariant-character char * string.
* About invariant characters see utypes.h.
* This constructor has no runtime dependency on conversion code and is
* therefore recommended over ones taking a charset name string
* (where the empty string "" indicates invariant-character conversion).
*
* @stable ICU 3.2
*/
#define US_INV U_NAMESPACE_QUALIFIER UnicodeString::kInvariant
/**
* Unicode String literals in C++.
* Dependent on the platform properties, different UnicodeString
* constructors should be used to create a UnicodeString object from
* a string literal.
* The macros are defined for maximum performance.
* They work only for strings that contain "invariant characters", i.e.,
* only latin letters, digits, and some punctuation.
* See utypes.h for details.
*
* The string parameter must be a C string literal.
* The length of the string, not including the terminating
* <code>NUL</code>, must be specified as a constant.
* The U_STRING_DECL macro should be invoked exactly once for one
* such string variable before it is used.
* @stable ICU 2.0
*/
#if defined(U_DECLARE_UTF16)
# define UNICODE_STRING(cs, _length) U_NAMESPACE_QUALIFIER UnicodeString(TRUE, (const UChar *)U_DECLARE_UTF16(cs), _length)
#elif U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && (U_CHARSET_FAMILY==U_ASCII_FAMILY || (U_SIZEOF_UCHAR == 2 && defined(U_WCHAR_IS_UTF16)))
# define UNICODE_STRING(cs, _length) U_NAMESPACE_QUALIFIER UnicodeString(TRUE, (const UChar *)L ## cs, _length)
#elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
# define UNICODE_STRING(cs, _length) U_NAMESPACE_QUALIFIER UnicodeString(TRUE, (const UChar *)cs, _length)
#else
# define UNICODE_STRING(cs, _length) U_NAMESPACE_QUALIFIER UnicodeString(cs, _length, US_INV)
#endif
/**
* Unicode String literals in C++.
* Dependent on the platform properties, different UnicodeString
* constructors should be used to create a UnicodeString object from
* a string literal.
* The macros are defined for improved performance.
* They work only for strings that contain "invariant characters", i.e.,
* only latin letters, digits, and some punctuation.
* See utypes.h for details.
*
* The string parameter must be a C string literal.
* @stable ICU 2.0
*/
#define UNICODE_STRING_SIMPLE(cs) UNICODE_STRING(cs, -1)
/**
* UnicodeString is a string class that stores Unicode characters directly and provides
* similar functionality as the Java String and StringBuffer classes.
* It is a concrete implementation of the abstract class Replaceable (for transliteration).
*
* The UnicodeString class is not suitable for subclassing.
*
* <p>For an overview of Unicode strings in C and C++ see the
* <a href="http://icu-project.org/userguide/strings.html">User Guide Strings chapter</a>.</p>
*
* <p>In ICU, a Unicode string consists of 16-bit Unicode <em>code units</em>.
* A Unicode character may be stored with either one code unit
* (the most common case) or with a matched pair of special code units
* ("surrogates"). The data type for code units is UChar.
* For single-character handling, a Unicode character code <em>point</em> is a value
* in the range 0..0x10ffff. ICU uses the UChar32 type for code points.</p>
*
* <p>Indexes and offsets into and lengths of strings always count code units, not code points.
* This is the same as with multi-byte char* strings in traditional string handling.
* Operations on partial strings typically do not test for code point boundaries.
* If necessary, the user needs to take care of such boundaries by testing for the code unit
* values or by using functions like
* UnicodeString::getChar32Start() and UnicodeString::getChar32Limit()
* (or, in C, the equivalent macros U16_SET_CP_START() and U16_SET_CP_LIMIT(), see utf.h).</p>
*
* UnicodeString methods are more lenient with regard to input parameter values
* than other ICU APIs. In particular:
* - If indexes are out of bounds for a UnicodeString object
* (<0 or >length()) then they are "pinned" to the nearest boundary.
* - If primitive string pointer values (e.g., const UChar * or char *)
* for input strings are NULL, then those input string parameters are treated
* as if they pointed to an empty string.
* However, this is <em>not</em> the case for char * parameters for charset names
* or other IDs.
* - Most UnicodeString methods do not take a UErrorCode parameter because
* there are usually very few opportunities for failure other than a shortage
* of memory, error codes in low-level C++ string methods would be inconvenient,
* and the error code as the last parameter (ICU convention) would prevent
* the use of default parameter values.
* Instead, such methods set the UnicodeString into a "bogus" state
* (see isBogus()) if an error occurs.
*
* In string comparisons, two UnicodeString objects that are both "bogus"
* compare equal (to be transitive and prevent endless loops in sorting),
* and a "bogus" string compares less than any non-"bogus" one.
*
* Const UnicodeString methods are thread-safe. Multiple threads can use
* const methods on the same UnicodeString object simultaneously,
* but non-const methods must not be called concurrently (in multiple threads)
* with any other (const or non-const) methods.
*
* Similarly, const UnicodeString & parameters are thread-safe.
* One object may be passed in as such a parameter concurrently in multiple threads.
* This includes the const UnicodeString & parameters for
* copy construction, assignment, and cloning.
*
* <p>UnicodeString uses several storage methods.
* String contents can be stored inside the UnicodeString object itself,
* in an allocated and shared buffer, or in an outside buffer that is "aliased".
* Most of this is done transparently, but careful aliasing in particular provides
* significant performance improvements.
* Also, the internal buffer is accessible via special functions.
* For details see the
* <a href="http://icu-project.org/userguide/strings.html">User Guide Strings chapter</a>.</p>
*
* @see utf.h
* @see CharacterIterator
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
icu4c-4_8-Win32-msvc10 (214个子文件)
icudt48.dll 17.35MB
icuin48.dll 1.25MB
icuuc48.dll 1018KB
icule48.dll 165KB
icutu48.dll 113KB
iculx48.dll 38KB
icuio48.dll 36KB
testplug.dll 9KB
genrb.exe 68KB
uconv.exe 39KB
makeconv.exe 29KB
gennorm2.exe 28KB
pkgdata.exe 24KB
gencnval.exe 16KB
gensprep.exe 15KB
derb.exe 15KB
icupkg.exe 13KB
genbrk.exe 12KB
genctd.exe 12KB
icuinfo.exe 11KB
gencfu.exe 9KB
genccode.exe 8KB
gencmn.exe 8KB
icuin.exp 660KB
icuuc.exp 463KB
iculx.exp 32KB
icule.exp 32KB
icutu.exp 29KB
icuio.exp 6KB
testplug.exp 1KB
icudt.exp 609B
unistr.h 162KB
urename.h 155KB
uchar.h 113KB
decimfmt.h 92KB
calendar.h 91KB
ubidi.h 89KB
ucnv.h 83KB
regex.h 83KB
ustring.h 73KB
uregex.h 72KB
utext.h 64KB
uniset.h 63KB
ucol.h 55KB
translit.h 53KB
smpdtfmt.h 53KB
coll.h 50KB
ucal.h 46KB
simpletz.h 45KB
rbnf.h 45KB
uloc.h 44KB
utf_old.h 43KB
msgfmt.h 43KB
numfmt.h 40KB
tblcoll.h 40KB
uset.h 39KB
dtitvfmt.h 39KB
uspoof.h 39KB
unum.h 37KB
ustdio.h 36KB
usearch.h 36KB
ures.h 36KB
utypes.h 35KB
tzrule.h 35KB
udat.h 35KB
timezone.h 34KB
messagepattern.h 33KB
gregocal.h 33KB
uidna.h 31KB
datefmt.h 30KB
locid.h 30KB
normlzr.h 29KB
rbbi.h 28KB
dtfmtsym.h 27KB
choicfmt.h 26KB
alphaindex.h 25KB
umsg.h 24KB
chariter.h 24KB
udatpg.h 23KB
utrans.h 23KB
unorm.h 23KB
uiter.h 23KB
ParagraphLayout.h 23KB
brkiter.h 22KB
plurfmt.h 22KB
search.h 22KB
utf8.h 22KB
stsearch.h 22KB
fmtable.h 22KB
ucharstrie.h 21KB
normalizer2.h 21KB
ucnv_err.h 21KB
RunArrays.h 20KB
vtzone.h 20KB
dtptngen.h 19KB
uscript.h 19KB
bytestrie.h 19KB
LayoutEngine.h 19KB
dtitvinf.h 19KB
utf16.h 18KB
共 214 条
- 1
- 2
- 3
资源评论
SBDCW
- 粉丝: 0
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功