ICU-903 updated copyright notices.

X-SVN-Rev: 4249
This commit is contained in:
Andy Heninger 2001-03-22 00:09:10 +00:00
parent 811dfb2c4a
commit 72b45a433b
30 changed files with 585 additions and 585 deletions

View file

@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "I18N_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\source\common" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "I18N_EXPORTS" /D "U_I18N_IMPLEMENTATION" /YX /FD /c
# ADD CPP /nologo /G6 /MD /W3 /GX /Zi /O2 /Ob2 /I "..\..\source\common" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "I18N_EXPORTS" /D "U_I18N_IMPLEMENTATION" /FR /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
@ -53,7 +53,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 ..\..\lib\icuuc.lib /nologo /base:"0x4a900000" /dll /machine:I386 /out:"..\..\bin\icuin18.dll" /implib:"..\..\lib\icuin.lib"
# ADD LINK32 ..\..\lib\icuuc.lib /nologo /base:"0x4a900000" /dll /debug /machine:I386 /out:"..\..\bin\icuin18.dll" /implib:"..\..\lib\icuin.lib"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "i18n - Win32 Debug"
@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "I18N_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\source\common" /D "_WINDOWS" /D "_USRDLL" /D "I18N_EXPORTS" /D "U_I18N_IMPLEMENTATION" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "UDATA_MAP" /FR /YX /FD /GZ /c
# ADD CPP /nologo /G6 /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\source\common" /D "_WINDOWS" /D "_USRDLL" /D "I18N_EXPORTS" /D "U_I18N_IMPLEMENTATION" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "UDATA_MAP" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1999}, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 12/15/99 rgillam Port from Java.
@ -58,7 +58,7 @@ protected:
* A temporary place to hold the rules as they're being processed.
*/
UVector tempRuleList;
/**
* A temporary holding place used for calculating the character categories.
* This object contains UnicodeSet objects.

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1999}, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 11/17/99 aliu Creation.
@ -52,7 +52,7 @@ public:
* the stored rules.
*/
Hashtable* variableNames;
/**
* Map category variable (UChar) to set (UnicodeSet).
* Variables that correspond to a set of characters are mapped
@ -63,7 +63,7 @@ public:
* setVariables[i] represents character (setVariablesBase + i).
*/
UnicodeSet** setVariables;
/**
* The character that represents setVariables[0]. Characters
* setVariablesBase through setVariablesBase +

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1999}, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 11/17/99 aliu Creation.
@ -86,7 +86,7 @@ public:
parse(const UnicodeString& rules,
UTransDirection direction,
UParseError* parseError = 0);
private:
/**
@ -145,7 +145,7 @@ private:
* character.
*/
//UChar registerSet(UnicodeSet* adoptedSet);
/**
* Parse a UnicodeSet out, store it, and return the stand-in character
* used to represent it.
@ -159,7 +159,7 @@ private:
*/
void appendVariableDef(const UnicodeString& name,
UnicodeString& buf);
/**
* Determines what part of the private use region of Unicode we can use for
* variable stand-ins. The correct way to do this is as follows: Parse each

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1999-2001}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1999-2001}, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 11/17/99 aliu Creation.
@ -29,7 +29,7 @@ class UnicodeFilter;
* may contain variables. Variables represent a set of Unicode
* characters, such as the letters <i>a</i> through <i>z</i>.
* Variables are detected by looking up each character in a supplied
* variable list to see if it has been so defined.
* variable list to see if it has been so defined.
*
* @author Alan Liu
*/
@ -61,7 +61,7 @@ public:
* long enough.
*/
PARTIAL_MATCH,
/**
* Constant returned by <code>getMatchDegree()</code>
* indicating a complete match between the text and this rule.
@ -340,7 +340,7 @@ public:
const UTransPosition& pos,
const TransliterationRuleData& data,
const UnicodeFilter* filter) const;
/**
* Return true if the given key matches the given text. This method
* accounts for the fact that the key character may represent a character

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1999}, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 11/17/99 aliu Creation.
@ -123,7 +123,7 @@ public:
const UTransPosition& pos,
const TransliterationRuleData& data,
const UnicodeFilter* filter) const;
/**
* Attempt to find a matching rule at the specified point in the text.
* Unlike <code>findMatch()</code>, this method does an incremental match.

View file

@ -1,14 +1,14 @@
/*
******************************************************************************
* Copyright © {1996-2001}, International Business Machines Corporation and *
* others. All Rights Reserved. *
* Copyright (C) {1996-2001}, International Business Machines Corporation and *
* others. All Rights Reserved. *
******************************************************************************
*/
/**
* File tblcoll.cpp
*
* Created by: Helena Shih
* Created by: Helena Shih
*
* Modification History:
*
@ -47,7 +47,7 @@
* 06/22/99 stephen Fixed logic in constructFromFile() since .ctx
* files are no longer used.
* 11/02/99 helena Collator performance enhancements. Special case
* for NO_OP situations.
* for NO_OP situations.
* 11/17/99 srl More performance enhancements. Inlined some internal functions.
* 12/15/99 aliu Update to support Thai collation. Move NormalizerIterator
* to implementation file.
@ -80,15 +80,15 @@ U_CAPI UChar forwardCharIteratorGlue(void *iterator);
/* RuleBasedCollator declaration ----------------------------------------- */
/* ---------------------------------------------------------------------------
The following diagram shows the data structure of the RuleBasedCollator object.
Suppose we have the rule, where 'o-umlaut' is the unicode char 0x00F6.
"a, A < b, B < c, C, ch, cH, Ch, CH < d, D ... < o, O;
The following diagram shows the data structure of the RuleBasedCollator object.
Suppose we have the rule, where 'o-umlaut' is the unicode char 0x00F6.
"a, A < b, B < c, C, ch, cH, Ch, CH < d, D ... < o, O;
'o-umlaut'/E, 'O-umlaut'/E ...".
What the rule says is, sorts 'ch'ligatures and 'c' only with tertiary
What the rule says is, sorts 'ch'ligatures and 'c' only with tertiary
difference and sorts 'o-umlaut' as if it's always expanded with 'e'.
mapping table contracting list expanding list
(contains all unicode
(contains all unicode
char entries) ___ ____________ _________________________
________ |=>|_*_|->|'c' |v('c') | |=>|v('o')|v('umlaut')|v('e')|
|_\u0001_|-> v('\u0001') | |_:_| |------------| | |-------------------------|
@ -111,41 +111,41 @@ char entries) ___ ____________ _________________________
/**
* Copy constructor
*/
RuleBasedCollator::RuleBasedCollator(const RuleBasedCollator& that) :
RuleBasedCollator::RuleBasedCollator(const RuleBasedCollator& that) :
Collator(that), dataIsOwned(FALSE), ucollator(that.ucollator),
urulestring(that.urulestring)
{
}
RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules,
UErrorCode& status) :
dataIsOwned(FALSE)
UErrorCode& status) :
dataIsOwned(FALSE)
{
if (U_FAILURE(status))
return;
int32_t length = rules.length();
UChar ucharrules[STACK_BUFFER_LENGTH_];
UChar *pucharrules = ucharrules;
if (length >= STACK_BUFFER_LENGTH_)
pucharrules = new UChar[length + 1];
rules.extract(0, length, pucharrules);
pucharrules[length] = 0;
ucollator = ucol_openRules(pucharrules, length, UCOL_DEFAULT_NORMALIZATION,
ucollator = ucol_openRules(pucharrules, length, UCOL_DEFAULT_NORMALIZATION,
UCOL_DEFAULT_STRENGTH, &status);
if (U_SUCCESS(status))
{
const UChar *r = ucol_getRules(ucollator, &length);
urulestring = new UnicodeString(r, length);
dataIsOwned = TRUE;
}
if (pucharrules != ucharrules)
delete[] pucharrules;
}
@ -156,20 +156,20 @@ RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules,
{
if (U_FAILURE(status))
return;
int32_t length = rules.length();
UChar ucharrules[STACK_BUFFER_LENGTH_];
UChar *pucharrules = ucharrules;
if (length >= STACK_BUFFER_LENGTH_)
pucharrules = new UChar[length + 1];
rules.extract(0, length, pucharrules);
pucharrules[length] = 0;
UCollationStrength strength = getUCollationStrength(collationStrength);
ucollator = ucol_openRules(pucharrules, length, UCOL_DEFAULT_NORMALIZATION,
ucollator = ucol_openRules(pucharrules, length, UCOL_DEFAULT_NORMALIZATION,
strength, &status);
if (U_SUCCESS(status))
@ -178,33 +178,33 @@ RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules,
urulestring = new UnicodeString(r, length);
dataIsOwned = TRUE;
}
if (pucharrules != ucharrules)
delete[] pucharrules;
}
RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules,
Normalizer::EMode decompositionMode,
UErrorCode& status) :
UErrorCode& status) :
dataIsOwned(FALSE)
{
if (U_FAILURE(status))
return;
int32_t length = rules.length();
UChar ucharrules[STACK_BUFFER_LENGTH_];
UChar *pucharrules = ucharrules;
if (length >= STACK_BUFFER_LENGTH_)
pucharrules = new UChar[length + 1];
rules.extract(0, length, pucharrules);
pucharrules[length] = 0;
UNormalizationMode mode = Normalizer::getUNormalizationMode(
decompositionMode, status);
ucollator = ucol_openRules(pucharrules, length, mode,
ucollator = ucol_openRules(pucharrules, length, mode,
UCOL_DEFAULT_STRENGTH, &status);
if (U_SUCCESS(status))
@ -213,7 +213,7 @@ RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules,
urulestring = new UnicodeString(r, length);
dataIsOwned = TRUE;
}
if (pucharrules != ucharrules)
delete[] pucharrules;
}
@ -230,10 +230,10 @@ RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules,
UChar ucharrules[STACK_BUFFER_LENGTH_];
UChar *pucharrules = ucharrules;
if (length >= STACK_BUFFER_LENGTH_)
pucharrules = new UChar[length + 1];
rules.extract(0, length, pucharrules);
pucharrules[length] = 0;
@ -273,10 +273,10 @@ UBool RuleBasedCollator::operator==(const Collator& that) const
/* only checks for address equals here */
if (Collator::operator==(that))
return TRUE;
if (getDynamicClassID() != that.getDynamicClassID())
return FALSE; /* not the same class */
RuleBasedCollator& thatAlias = (RuleBasedCollator&)that;
/*
@ -284,7 +284,7 @@ UBool RuleBasedCollator::operator==(const Collator& that) const
*/
if (ucollator != thatAlias.ucollator)
return FALSE;
return TRUE;
}
@ -299,7 +299,7 @@ RuleBasedCollator& RuleBasedCollator::operator=(
ucollator = NULL;
delete urulestring;
}
dataIsOwned = FALSE;
ucollator = that.ucollator;
urulestring = that.urulestring;
@ -312,47 +312,47 @@ Collator* RuleBasedCollator::clone() const
return new RuleBasedCollator(*this);
}
/**
* Create a CollationElementIterator object that will iterator over the
* elements in a string, using the collation rules defined in this
/**
* Create a CollationElementIterator object that will iterator over the
* elements in a string, using the collation rules defined in this
* RuleBasedCollator
*/
CollationElementIterator* RuleBasedCollator::createCollationElementIterator
(const UnicodeString& source) const
{
UErrorCode status = U_ZERO_ERROR;
CollationElementIterator *result = new CollationElementIterator(source, this,
CollationElementIterator *result = new CollationElementIterator(source, this,
status);
if (U_FAILURE(status))
return NULL;
return result;
}
/**
* Create a CollationElementIterator object that will iterator over the
* elements in a string, using the collation rules defined in this
/**
* Create a CollationElementIterator object that will iterator over the
* elements in a string, using the collation rules defined in this
* RuleBasedCollator
*/
CollationElementIterator* RuleBasedCollator::createCollationElementIterator
(const CharacterIterator& source) const
{
UErrorCode status = U_ZERO_ERROR;
CollationElementIterator *result = new CollationElementIterator(source, this,
CollationElementIterator *result = new CollationElementIterator(source, this,
status);
if (U_FAILURE(status))
return NULL;
return result;
}
/**
* Return a string representation of this collator's rules. The string can
* later be passed to the constructor that takes a UnicodeString argument,
* which will construct a collator that's functionally identical to this one.
* You can also allow users to edit the string in order to change the collation
/**
* Return a string representation of this collator's rules. The string can
* later be passed to the constructor that takes a UnicodeString argument,
* which will construct a collator that's functionally identical to this one.
* You can also allow users to edit the string in order to change the collation
* data, or you can print it out for inspection, or whatever.
*/
const UnicodeString& RuleBasedCollator::getRules() const
@ -374,13 +374,13 @@ Collator::EComparisonResult RuleBasedCollator::compare(
return compare(source_togo, target_togo);
}
Collator::EComparisonResult RuleBasedCollator::compare(const UChar* source,
Collator::EComparisonResult RuleBasedCollator::compare(const UChar* source,
int32_t sourceLength,
const UChar* target,
int32_t targetLength)
int32_t targetLength)
const
{
return getEComparisonResult(ucol_strcoll(ucollator, source, sourceLength,
return getEComparisonResult(ucol_strcoll(ucollator, source, sourceLength,
target, targetLength));
}
@ -400,10 +400,10 @@ Collator::EComparisonResult RuleBasedCollator::compare(
if(sourceLen >= STACK_BUFFER_LENGTH_)
uSource = new UChar[sourceLen+1];
if(targetLen >= STACK_BUFFER_LENGTH_)
uTarget = new UChar[targetLen+1];
source.extract(0, sourceLen, uSource);
uSource[sourceLen] = 0;
target.extract(0, targetLen, uTarget);
@ -412,44 +412,44 @@ Collator::EComparisonResult RuleBasedCollator::compare(
if(uSstart != uSource)
delete[] uSource;
if(uTstart != uTarget)
delete[] uTarget;
return result;
}
/**
* Retrieve a collation key for the specified string. The key can be compared
* with other collation keys using a bitwise comparison (e.g. memcmp) to find
* the ordering of their respective source strings. This is handy when doing a
* Retrieve a collation key for the specified string. The key can be compared
* with other collation keys using a bitwise comparison (e.g. memcmp) to find
* the ordering of their respective source strings. This is handy when doing a
* sort, where each sort key must be compared many times.
*
* The basic algorithm here is to find all of the collation elements for each
* character in the source string, convert them to an ASCII representation, and
* put them into the collation key. But it's trickier than that. Each
* collation element in a string has three components: primary ('A' vs 'B'),
* character in the source string, convert them to an ASCII representation, and
* put them into the collation key. But it's trickier than that. Each
* collation element in a string has three components: primary ('A' vs 'B'),
* secondary ('u' vs 'ü'), and tertiary ('A' vs 'a'), and a primary difference
* at the end of a string takes precedence over a secondary or tertiary
* at the end of a string takes precedence over a secondary or tertiary
* difference earlier in the string.
*
* To account for this, we put all of the primary orders at the beginning of
* the string, followed by the secondary and tertiary orders. Each set of
* orders is terminated by nulls so that a key for a string which is a initial
* To account for this, we put all of the primary orders at the beginning of
* the string, followed by the secondary and tertiary orders. Each set of
* orders is terminated by nulls so that a key for a string which is a initial
* substring of another key will compare less without any special case.
*
* Here's a hypothetical example, with the collation element represented as a
* Here's a hypothetical example, with the collation element represented as a
* three-digit number, one digit for primary, one for secondary, etc.
*
* String: A a B É
* Collation Elements: 101 100 201 511
* Collation Key: 1125<null>0001<null>1011<null>
*
* To make things even trickier, secondary differences (accent marks) are
* compared starting at the *end* of the string in languages with French
* secondary ordering. But when comparing the accent marks on a single base
* character, they are compared from the beginning. To handle this, we reverse
* all of the accents that belong to each base character, then we reverse the
* To make things even trickier, secondary differences (accent marks) are
* compared starting at the *end* of the string in languages with French
* secondary ordering. But when comparing the accent marks on a single base
* character, they are compared from the beginning. To handle this, we reverse
* all of the accents that belong to each base character, then we reverse the
* entire string of secondary orderings at the end.
*/
CollationKey& RuleBasedCollator::getCollationKey(
@ -463,7 +463,7 @@ CollationKey& RuleBasedCollator::getCollationKey(
if(sourceLen >= STACK_BUFFER_LENGTH_)
uSource = new UChar[sourceLen+1];
source.extract(0, sourceLen, uSource);
uSource[sourceLen] = 0;
CollationKey& result = getCollationKey(uSource, sourceLen, sortkey, status);
@ -483,28 +483,28 @@ CollationKey& RuleBasedCollator::getCollationKey(const UChar* source,
status = U_ILLEGAL_ARGUMENT_ERROR;
return sortkey.setToBogus();
}
if ((!source) || (sourceLen == 0))
return sortkey.reset();
/*
* have to use malloc, lowest denomination, since adopt can be used by
/*
* have to use malloc, lowest denomination, since adopt can be used by
* a c return value.
*/
uint8_t *result = (uint8_t *)uprv_malloc(UCOL_MAX_BUFFER * sizeof(uint8_t));
uint8_t resLen = ucol_getSortKey(ucollator, source, sourceLen, result,
UCOL_MAX_BUFFER);
sortkey.adopt(result, resLen);
return sortkey;
}
/**
* Return the maximum length of any expansion sequences that end with the
* Return the maximum length of any expansion sequences that end with the
* specified comparison order.
* @param order a collation order returned by previous or next.
* @return the maximum length of any expansion seuences ending with the
* specified order or 1 if collation order does not occur at the end of any
* @return the maximum length of any expansion seuences ending with the
* specified order or 1 if collation order does not occur at the end of any
* expansion sequence.
* @see CollationElementIterator#getMaxExpansion
*/
@ -515,37 +515,37 @@ int32_t RuleBasedCollator::getMaxExpansion(int32_t order) const
return result;
}
uint8_t* RuleBasedCollator::cloneRuleData(int32_t &length,
uint8_t* RuleBasedCollator::cloneRuleData(int32_t &length,
UErrorCode &status)
{
return ucol_cloneRuleData(ucollator, &length, &status);
}
void RuleBasedCollator::setAttribute(UColAttribute attr,
UColAttributeValue value,
UErrorCode &status)
void RuleBasedCollator::setAttribute(UColAttribute attr,
UColAttributeValue value,
UErrorCode &status)
{
if (U_FAILURE(status))
return;
ucol_setAttribute(ucollator, attr, value, &status);
}
UColAttributeValue RuleBasedCollator::getAttribute(UColAttribute attr,
UErrorCode &status)
UColAttributeValue RuleBasedCollator::getAttribute(UColAttribute attr,
UErrorCode &status)
{
if (U_FAILURE(status))
return UCOL_DEFAULT;
return ucol_getAttribute(ucollator, attr, &status);
}
Collator* RuleBasedCollator::safeClone(void)
Collator* RuleBasedCollator::safeClone(void)
{
UErrorCode intStatus = U_ZERO_ERROR;
UCollator *ucol = ucol_safeClone(ucollator, NULL, 0, &intStatus);
if (U_FAILURE(intStatus))
return NULL;
int32_t length = 0;
UnicodeString *r = new UnicodeString(ucol_getRules(ucollator, &length),
UnicodeString *r = new UnicodeString(ucol_getRules(ucollator, &length),
length);
RuleBasedCollator *result = new RuleBasedCollator(ucol, r);
result->dataIsOwned = TRUE;
@ -554,23 +554,23 @@ Collator* RuleBasedCollator::safeClone(void)
Collator::EComparisonResult RuleBasedCollator::compare(
ForwardCharacterIterator &source,
ForwardCharacterIterator &target)
ForwardCharacterIterator &target)
{
return getEComparisonResult(
ucol_strcollinc(ucollator, forwardCharIteratorGlue, &source,
ucol_strcollinc(ucollator, forwardCharIteratorGlue, &source,
forwardCharIteratorGlue, &target));
}
int32_t RuleBasedCollator::getSortKey(const UnicodeString& source,
uint8_t *result, int32_t resultLength)
const
int32_t RuleBasedCollator::getSortKey(const UnicodeString& source,
uint8_t *result, int32_t resultLength)
const
{
UChar sStart[STACK_BUFFER_LENGTH_];
UChar *uSource = sStart;
uint32_t sourceLen = source.length();
if(sourceLen >= STACK_BUFFER_LENGTH_)
uSource = new UChar[sourceLen+1];
source.extract(0, sourceLen, uSource);
uSource[sourceLen] = 0;
@ -582,9 +582,9 @@ int32_t RuleBasedCollator::getSortKey(const UnicodeString& source,
return resLen;
}
int32_t RuleBasedCollator::getSortKey(const UChar *source,
int32_t RuleBasedCollator::getSortKey(const UChar *source,
int32_t sourceLength, uint8_t *result,
int32_t resultLength) const
int32_t resultLength) const
{
return ucol_getSortKey(ucollator, source, sourceLength, result, resultLength);
}
@ -592,7 +592,7 @@ int32_t RuleBasedCollator::getSortKey(const UChar *source,
Collator::ECollationStrength RuleBasedCollator::getStrength(void) const
{
UErrorCode intStatus = U_ZERO_ERROR;
return getECollationStrength(ucol_getAttribute(ucollator, UCOL_STRENGTH,
return getECollationStrength(ucol_getAttribute(ucollator, UCOL_STRENGTH,
&intStatus));
}
@ -603,8 +603,8 @@ void RuleBasedCollator::setStrength(ECollationStrength newStrength)
ucol_setAttribute(ucollator, UCOL_STRENGTH, strength, &intStatus);
}
/**
* Create a hash code for this collation. Just hash the main rule table -- that
/**
* Create a hash code for this collation. Just hash the main rule table -- that
* should be good enough for almost any use.
*/
int32_t RuleBasedCollator::hashCode() const
@ -615,7 +615,7 @@ int32_t RuleBasedCollator::hashCode() const
}
/**
* Set the decomposition mode of the Collator object. success is equal to
* Set the decomposition mode of the Collator object. success is equal to
* U_ILLEGAL_ARGUMENT_ERROR if error occurs.
* @param the new decomposition mode
* @see Collator#getDecomposition
@ -635,7 +635,7 @@ void RuleBasedCollator::setDecomposition(Normalizer::EMode mode)
Normalizer::EMode RuleBasedCollator::getDecomposition(void) const
{
UErrorCode status = U_ZERO_ERROR;
return Normalizer::getNormalizerEMode(ucol_getNormalization(ucollator),
return Normalizer::getNormalizerEMode(ucol_getNormalization(ucollator),
status);
}
@ -645,7 +645,7 @@ RuleBasedCollator::RuleBasedCollator() : dataIsOwned(FALSE), ucollator(0)
{
}
RuleBasedCollator::RuleBasedCollator(UCollator *collator,
RuleBasedCollator::RuleBasedCollator(UCollator *collator,
UnicodeString *rule) : dataIsOwned(FALSE)
{
ucollator = collator;
@ -653,13 +653,13 @@ RuleBasedCollator::RuleBasedCollator(UCollator *collator,
}
RuleBasedCollator::RuleBasedCollator(const Locale& desiredLocale,
UErrorCode& status) :
UErrorCode& status) :
dataIsOwned(FALSE), ucollator(0)
{
if (U_FAILURE(status))
return;
/*
/*
Try to load, in order:
1. The desired locale's collation.
2. A fallback of the desired locale.
@ -677,25 +677,25 @@ RuleBasedCollator::RuleBasedCollator(const Locale& desiredLocale,
language+country
language
Root: (aka DEFAULTRULES)
steps 1-5 are handled by resource bundle fallback mechanism.
steps 1-5 are handled by resource bundle fallback mechanism.
however, in a very unprobable situation that no resource bundle
data exists, step 5 is repeated with hardcoded default rules.
*/
setUCollator(desiredLocale, status);
if (U_FAILURE(status))
if (U_FAILURE(status))
{
status = U_ZERO_ERROR;
setUCollator(ResourceBundle::kDefaultFilename, status);
if (U_FAILURE(status))
if (U_FAILURE(status))
{
status = U_ZERO_ERROR;
if (status == U_ZERO_ERROR)
status = U_USING_DEFAULT_ERROR;
if (status == U_MEMORY_ALLOCATION_ERROR)
return;
}
@ -708,63 +708,63 @@ RuleBasedCollator::RuleBasedCollator(const Locale& desiredLocale,
urulestring = new UnicodeString(r, length);
dataIsOwned = TRUE;
}
return;
}
/* RuleBasedCollator private data members -------------------------------- */
/* need look up in .commit() */
const int32_t RuleBasedCollator::CHARINDEX = 0x70000000;
const int32_t RuleBasedCollator::CHARINDEX = 0x70000000;
/* Expand index follows */
const int32_t RuleBasedCollator::EXPANDCHARINDEX = 0x7E000000;
const int32_t RuleBasedCollator::EXPANDCHARINDEX = 0x7E000000;
/* contract indexes follows */
const int32_t RuleBasedCollator::CONTRACTCHARINDEX = 0x7F000000;
const int32_t RuleBasedCollator::CONTRACTCHARINDEX = 0x7F000000;
/* unmapped character values */
const int32_t RuleBasedCollator::UNMAPPED = 0xFFFFFFFF;
const int32_t RuleBasedCollator::UNMAPPED = 0xFFFFFFFF;
/* primary strength increment */
const int32_t RuleBasedCollator::PRIMARYORDERINCREMENT = 0x00010000;
const int32_t RuleBasedCollator::PRIMARYORDERINCREMENT = 0x00010000;
/* secondary strength increment */
const int32_t RuleBasedCollator::SECONDARYORDERINCREMENT = 0x00000100;
/* tertiary strength increment */
const int32_t RuleBasedCollator::TERTIARYORDERINCREMENT = 0x00000001;
/* mask off anything but primary order */
const int32_t RuleBasedCollator::PRIMARYORDERMASK = 0xffff0000;
const int32_t RuleBasedCollator::PRIMARYORDERMASK = 0xffff0000;
/* mask off anything but secondary order */
const int32_t RuleBasedCollator::SECONDARYORDERMASK = 0x0000ff00;
const int32_t RuleBasedCollator::SECONDARYORDERMASK = 0x0000ff00;
/* mask off anything but tertiary order */
const int32_t RuleBasedCollator::TERTIARYORDERMASK = 0x000000ff;
const int32_t RuleBasedCollator::TERTIARYORDERMASK = 0x000000ff;
/* mask off ignorable char order */
const int32_t RuleBasedCollator::IGNORABLEMASK = 0x0000ffff;
const int32_t RuleBasedCollator::IGNORABLEMASK = 0x0000ffff;
/* use only the primary difference */
const int32_t RuleBasedCollator::PRIMARYDIFFERENCEONLY = 0xffff0000;
const int32_t RuleBasedCollator::PRIMARYDIFFERENCEONLY = 0xffff0000;
/* use only the primary and secondary difference */
const int32_t RuleBasedCollator::SECONDARYDIFFERENCEONLY = 0xffffff00;
const int32_t RuleBasedCollator::SECONDARYDIFFERENCEONLY = 0xffffff00;
/* primary order shift */
const int32_t RuleBasedCollator::PRIMARYORDERSHIFT = 16;
const int32_t RuleBasedCollator::PRIMARYORDERSHIFT = 16;
/* secondary order shift */
const int32_t RuleBasedCollator::SECONDARYORDERSHIFT = 8;
const int32_t RuleBasedCollator::SECONDARYORDERSHIFT = 8;
/* starting value for collation elements */
const int32_t RuleBasedCollator::COLELEMENTSTART = 0x02020202;
const int32_t RuleBasedCollator::COLELEMENTSTART = 0x02020202;
/* testing mask for primary low element */
const int32_t RuleBasedCollator::PRIMARYLOWZEROMASK = 0x00FF0000;
const int32_t RuleBasedCollator::PRIMARYLOWZEROMASK = 0x00FF0000;
/* reseting value for secondaries and tertiaries */
const int32_t RuleBasedCollator::RESETSECONDARYTERTIARY = 0x00000202;
/* reseting value for tertiaries */
const int32_t RuleBasedCollator::RESETTERTIARY = 0x00000002;
const int32_t RuleBasedCollator::RESETTERTIARY = 0x00000002;
const int32_t RuleBasedCollator::PRIMIGNORABLE = 0x0202;
/* unique file id for parity check */
const int16_t RuleBasedCollator::FILEID = 0x5443;
const int16_t RuleBasedCollator::FILEID = 0x5443;
/* binary collation file extension */
const char* RuleBasedCollator::kFilenameSuffix = ".col";
/* class id ? Value is irrelevant */
char RuleBasedCollator::fgClassID = 0;
const char* RuleBasedCollator::kFilenameSuffix = ".col";
/* class id ? Value is irrelevant */
char RuleBasedCollator::fgClassID = 0;
/* other methods not belonging to any classes ------------------------------- */
U_CAPI UChar forwardCharIteratorGlue(void *iterator)
U_CAPI UChar forwardCharIteratorGlue(void *iterator)
{
ForwardCharacterIterator *iter = ((ForwardCharacterIterator *)iterator);
UChar result = iter->nextPostInc();

View file

@ -1,6 +1,6 @@
/*
********************************************************************************
* Copyright © {1997-1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1997-1999}, International Business Machines Corporation and others. All Rights Reserved.
********************************************************************************
*
* File FORMAT.H
@ -16,10 +16,10 @@
// *****************************************************************************
// This file was generated from the java source file Format.java
// *****************************************************************************
#ifndef FORMAT_H
#define FORMAT_H
#include "unicode/utypes.h"
#include "unicode/unistr.h"
@ -27,7 +27,7 @@
#include "unicode/fieldpos.h"
#include "unicode/parsepos.h"
/**
/**
* Base class for all formats. This is an abstract base class which
* specifies the protocol for classes which convert other objects or
* values, such as numeric values and dates, and their string

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1997-1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1997-1999}, International Business Machines Corporation and others. All Rights Reserved.
********************************************************************************
*
* File GREGOCAL.H
@ -11,7 +11,7 @@
* 07/28/98 stephen Sync with JDK 1.2
* 09/04/98 stephen Re-sync with JDK 8/31 putback
* 09/14/98 stephen Changed type of kOneDay, kOneWeek to double.
* Fixed bug in roll()
* Fixed bug in roll()
* 10/15/99 aliu Fixed j31, incorrect WEEK_OF_YEAR computation.
* Added documentation of WEEK_OF_YEAR computation.
* 10/15/99 aliu Fixed j32, cannot set date to Feb 29 2000 AD.
@ -67,22 +67,22 @@
* if (idsCount == 0) {
* return;
* }
*
*
* // begin output
* cout << "Current Time" << endl;
*
*
* // create a Pacific Standard Time time zone
* SimpleTimeZone* pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, *(ids[0]));
*
*
* // set up rules for daylight savings time
* pdt->setStartRule(Calendar::APRIL, 1, Calendar::SUNDAY, 2 * 60 * 60 * 1000);
* pdt->setEndRule(Calendar::OCTOBER, -1, Calendar::SUNDAY, 2 * 60 * 60 * 1000);
*
*
* // create a GregorianCalendar with the Pacific Daylight time zone
* // and the current date and time
* UErrorCode success = U_ZERO_ERROR;
* Calendar* calendar = new GregorianCalendar( pdt, success );
*
*
* // print out a bunch of interesting things
* cout << "ERA: " << calendar->get( Calendar::ERA, success ) << endl;
* cout << "YEAR: " << calendar->get( Calendar::YEAR, success ) << endl;
@ -102,7 +102,7 @@
* cout << "MILLISECOND: " << calendar->get( Calendar::MILLISECOND, success ) << endl;
* cout << "ZONE_OFFSET: " << (calendar->get( Calendar::ZONE_OFFSET, success )/(60*60*1000)) << endl;
* cout << "DST_OFFSET: " << (calendar->get( Calendar::DST_OFFSET, success )/(60*60*1000)) << endl;
*
*
* cout << "Current Time, with hour reset to 3" << endl;
* calendar->clear(Calendar::HOUR_OF_DAY); // so doesn't override
* calendar->set(Calendar::HOUR, 3);
@ -124,7 +124,7 @@
* cout << "MILLISECOND: " << calendar->get( Calendar::MILLISECOND, success ) << endl;
* cout << "ZONE_OFFSET: " << (calendar->get( Calendar::ZONE_OFFSET, success )/(60*60*1000)) << endl; // in hours
* cout << "DST_OFFSET: " << (calendar->get( Calendar::DST_OFFSET, success )/(60*60*1000)) << endl; // in hours
*
*
* delete[] ids;
* delete calendar; // also deletes pdt
* \endcode
@ -467,7 +467,7 @@ protected:
*/
virtual void computeTime(UErrorCode& status);
private:
private:
/**
* Return the ERA. We need a special method for this because the
@ -703,7 +703,7 @@ inline uint8_t GregorianCalendar::julianDayToDayOfWeek(double julian)
// If julian is negative, then julian%7 will be negative, so we adjust
// accordingly. We add 1 because Julian day 0 is Monday.
int8_t dayOfWeek = (int8_t) uprv_fmod(julian + 1, 7);
uint8_t result = (uint8_t)(dayOfWeek + ((dayOfWeek < 0) ? (7 + SUNDAY) : SUNDAY));
return result;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1999}, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 11/17/99 aliu Creation.
@ -22,7 +22,7 @@
* <p>Copyright &copy; IBM Corporation 1999. All rights reserved.
*
* @author Alan Liu
* @version $RCSfile: hextouni.h,v $ $Revision: 1.7 $ $Date: 2000/06/27 19:00:38 $
* @version $RCSfile: hextouni.h,v $ $Revision: 1.8 $ $Date: 2001/03/22 00:09:10 $
* @draft
*/
class U_I18N_API HexToUnicodeTransliterator : public Transliterator {

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1997-2001}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1997-2001}, International Business Machines Corporation and others. All Rights Reserved.
********************************************************************************
*
* File MSGFMT.H
@ -15,10 +15,10 @@
// *****************************************************************************
// This file was generated from the java source file MessageFormat.java
// *****************************************************************************
#ifndef MSGFMT_H
#define MSGFMT_H
#include "unicode/utypes.h"
#include "unicode/format.h"
#include "unicode/locid.h"
@ -42,17 +42,17 @@ class NumberFormat;
* Formattable( (Date) cal.getTime(success), Formattable::kIsDate),
* "a disturbance in the Force"
* };
*
*
* UnicodeString result;
* MessageFormat::format(
* "At {1,time} on {1,date}, there was {2} on planet {0,number}.",
* arguments, 3, result, success );
*
*
* cout << "result: " << result << endl;
* //<output>: At 4:34:20 PM on 23-Mar-98, there was a disturbance
* // in the Force on planet 7.
* \endcode
* </pre>
* </pre>
* Typically, the message format will come from resources, and the
* arguments will be dynamically set at runtime.
* <P>
@ -61,14 +61,14 @@ class NumberFormat;
* \code
* success = U_ZERO_ERROR;
* Formattable testArgs[] = {3L, "MyDisk"};
*
*
* MessageFormat* form = new MessageFormat(
* "The disk \"{1}\" contains {0} file(s).", success );
*
*
* UnicodeString string;
* FieldPosition fpos = 0;
* cout &lt;&lt; "format: " &lt;&lt; form->format(testArgs, 2, string, fpos, success ) &lt;&lt; endl;
*
*
* // output, with different testArgs:
* // output: The disk "MyDisk" contains 0 file(s).
* // output: The disk "MyDisk" contains 1 file(s).
@ -89,25 +89,25 @@ class NumberFormat;
* <pre>
* \code
* messageFormatPattern := string ( "{" messageFormatElement "}" string )*
*
*
* messageFormatElement := argument { "," elementFormat }
*
*
* elementFormat := "time" { "," datetimeStyle }
* | "date" { "," datetimeStyle }
* | "number" { "," numberStyle }
* | "choice" "," choiceStyle
*
*
* datetimeStyle := "short"
* | "medium"
* | "long"
* | "full"
* | dateFormatPattern
*
*
* numberStyle := "currency"
* | "percent"
* | "integer"
* | numberFormatPattern
*
*
* choiceStyle := choiceFormatPattern
* \endcode
* </pre>
@ -145,13 +145,13 @@ class NumberFormat;
* UnicodeString filepart[] = {"no files","one file","{0,number} files"};
* ChoiceFormat* fileform = new ChoiceFormat(filelimits, filepart, 3);
* form->setFormat(1, *fileform); // NOT zero, see below
*
*
* Formattable testArgs[] = {1273L, "MyDisk"};
*
*
* UnicodeString string;
* FieldPosition fpos = 0;
* cout << form->format(testArgs, 2, string, fpos, success) << endl;
*
*
* // output, with different testArgs
* // output: The disk "MyDisk" contains no files.
* // output: The disk "MyDisk" contains one file.
@ -179,7 +179,7 @@ class NumberFormat;
* <pre>
* \code
* For example: with "abc{2}def{3}ghi{0}...",
*
*
* format0 affects the first variable {2}
* format1 affects the second variable {3}
* format2 affects the second variable {0}
@ -340,7 +340,7 @@ public:
static UnicodeString& format( const UnicodeString& pattern,
const Formattable* arguments,
int32_t count,
UnicodeString& result,
UnicodeString& result,
UErrorCode& success);
/**
@ -498,7 +498,7 @@ private:
int32_t fCount;
int32_t *fArgumentNumbers;
int32_t fMaxOffset;
/**
* Internal routine used by format.
* @param recursionProtection Initially zero. Bits 0..9 are used to indicate
@ -510,13 +510,13 @@ private:
static const UnicodeString fgModifierList[];
static const UnicodeString fgDateModifierList[];
/**
/**
* Finds the word s, in the keyword list and returns the located index.
* @param s the keyword to be searched for.
* @param list the list of keywords to be searched with.
* @return the index of the list which matches the keyword s.
*/
static int32_t findKeyword( const UnicodeString& s,
static int32_t findKeyword( const UnicodeString& s,
const UnicodeString* list);
/**
@ -530,24 +530,24 @@ private:
* unused.
* @param success the error code status.
*/
UnicodeString& format( const Formattable* arguments,
int32_t cnt,
UnicodeString& result,
FieldPosition& status,
UnicodeString& format( const Formattable* arguments,
int32_t cnt,
UnicodeString& result,
FieldPosition& status,
int32_t recursionProtection,
UErrorCode& success) const;
/**
* Checks the segments for the closest matched format instance and
* updates the format array with the new format instance.
* @param position the last processed offset in the pattern
* @param position the last processed offset in the pattern
* @param offsetNumber the offset number of the last processed segment
* @param segments the string that contains the parsed pattern segments.
* @param success the error code
*/
void makeFormat( /*int32_t position, */
int32_t offsetNumber,
UnicodeString* segments,
int32_t offsetNumber,
UnicodeString* segments,
UErrorCode& success);
/**
@ -585,11 +585,11 @@ private:
*/
static UnicodeString& itos(int32_t i, UnicodeString& string);
};
inline UClassID
inline UClassID
MessageFormat::getDynamicClassID() const
{
return MessageFormat::getStaticClassID();
{
return MessageFormat::getStaticClassID();
}
inline UnicodeString&

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1997-2001}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1997-2001}, International Business Machines Corporation and others. All Rights Reserved.
********************************************************************************
*
* File NUMFMT.H
@ -15,10 +15,10 @@
* Derecated Java style constants (eg, INTEGER_FIELD)
********************************************************************************
*/
#ifndef NUMFMT_H
#define NUMFMT_H
#include "unicode/utypes.h"
#include "unicode/unistr.h"
@ -54,7 +54,7 @@ class Locale;
* have to fetch the information about the local language and country
* conventions multiple times.
* <pre>
* \code
* \code
* UnicodeString myString;
* UErrorCode success = U_ZERO_ERROR;
* nf = NumberFormat::createInstance( success );
@ -140,7 +140,7 @@ public:
* These constants are provided for backwards compatibility only,
* and are deprecated. Please use the C++ style constants defined above.
* @stable
*/
*/
INTEGER_FIELD = kIntegerField,
FRACTION_FIELD = kFractionField
};
@ -545,9 +545,9 @@ private:
int32_t fMinFractionDigits;
UBool fParseIntegerOnly;
};
// -------------------------------------
inline UBool
NumberFormat::isParseIntegerOnly() const
{
@ -560,6 +560,6 @@ NumberFormat::format(const Formattable& obj,
UErrorCode& status) const {
return Format::format(obj, result, status);
}
#endif // _NUMFMT
//eof

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1997-1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1997-1999}, International Business Machines Corporation and others. All Rights Reserved.
*******************************************************************************
*
* File PARSEPOS.H
@ -17,14 +17,14 @@
#define PARSEPOS_H
#include "unicode/utypes.h"
/**
* <code>ParsePosition</code> is a simple class used by <code>Format</code>
* and its subclasses to keep track of the current position during parsing.
* The <code>parseObject</code> method in the various <code>Format</code>
* classes requires a <code>ParsePosition</code> object as an argument.
*
* <p>
* <p>
* By design, as you parse through a string with different formats,
* you can use the same <code>ParsePosition</code>, since the index parameter
* records the current position.
@ -40,7 +40,7 @@ public:
* Default constructor, the index starts with 0 as default.
* @stable
*/
ParsePosition()
ParsePosition()
{ this->index = 0; this->errorIndex = -1; }
/**
@ -48,15 +48,15 @@ public:
* @param newIndex the new text offset.
* @stable
*/
ParsePosition(UTextOffset newIndex)
{ this->index = newIndex; this->errorIndex = -1; }
ParsePosition(UTextOffset newIndex)
{ this->index = newIndex; this->errorIndex = -1; }
/**
* Copy constructor
* @param copy the object to be copied from.
* @stable
*/
ParsePosition(const ParsePosition& copy)
ParsePosition(const ParsePosition& copy)
{ this->index = copy.index; this->errorIndex = copy.errorIndex; }
/**
@ -71,14 +71,14 @@ public:
*/
ParsePosition& operator=(const ParsePosition& copy);
/**
/**
* Equality operator.
* @return TRUE if the two parse positions are equal, FALSE otherwise.
* @stable
*/
UBool operator==(const ParsePosition& that) const;
/**
/**
* Equality operator.
* @return TRUE if the two parse positions are not equal, FALSE otherwise.
* @stable
@ -105,14 +105,14 @@ public:
* Set the index at which a parse error occurred. Formatters
* should set this before returning an error code from their
* parseObject method. The default value is -1 if this is not
* set.
* set.
* @stable
*/
void setErrorIndex(UTextOffset ei);
/**
* Retrieve the index at which an error occurred, or -1 if the
* error index has not been set.
* error index has not been set.
* @stable
*/
UTextOffset getErrorIndex(void) const;
@ -125,7 +125,7 @@ private:
* with each call setting index up for the next one.
*/
UTextOffset index;
/**
* The index at which a parse error occurred.
*/
@ -143,7 +143,7 @@ ParsePosition::operator=(const ParsePosition& copy)
inline UBool
ParsePosition::operator==(const ParsePosition& copy) const
{
if(index != copy.index || errorIndex != copy.errorIndex)
if(index != copy.index || errorIndex != copy.errorIndex)
return FALSE;
else
return TRUE;

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1999-2001}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1999-2001}, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 10/22/99 alan Creation.
@ -19,10 +19,10 @@ class BreakIterator;
/**
* <p>A subclass of BreakIterator whose behavior is specified using a list of rules.</p>
*
*
* <p>There are two kinds of rules, which are separated by semicolons: <i>substitutions</i>
* and <i>regular expressions.</i></p>
*
*
* <p>A substitution rule defines a name that can be used in place of an expression. It
* consists of a name, which is a string of characters contained in angle brackets, an equals
* sign, and an expression. (There can be no whitespace on either side of the equals sign.)
@ -32,22 +32,22 @@ class BreakIterator;
* long as those substitutions have been defined first. Substitutions are generally used to
* make the regular expressions (which can get quite complex) shorted and easier to read.
* They typically define either character categories or commonly-used subexpressions.</p>
*
*
* <p>There is one special substitution.&nbsp; If the description defines a substitution
* called &quot;&lt;ignore&gt;&quot;, the expression must be a [] expression, and the
* expression defines a set of characters (the &quot;<em>ignore characters</em>&quot;) that
* will be transparent to the BreakIterator.&nbsp; A sequence of characters will break the
* same way it would if any ignore characters it contains are taken out.&nbsp; Break
* positions never occur befoer ignore characters.</p>
*
*
* <p>A regular expression uses a subset of the normal Unix regular-expression syntax, and
* defines a sequence of characters to be kept together. With one significant exception, the
* iterator uses a longest-possible-match algorithm when matching text to regular
* expressions. The iterator also treats descriptions containing multiple regular expressions
* as if they were ORed together (i.e., as if they were separated by |).</p>
*
*
* <p>The special characters recognized by the regular-expression parser are as follows:</p>
*
*
* <blockquote>
* <table border="1" width="100%">
* <tr>
@ -129,10 +129,10 @@ class BreakIterator;
* </tr>
* </table>
* </blockquote>
*
*
* <p>Within a [] expression, a number of other special characters can be used to specify
* groups of characters:</p>
*
*
* <blockquote>
* <table border="1" width="100%">
* <tr>
@ -174,7 +174,7 @@ class BreakIterator;
* </tr>
* </table>
* </blockquote>
*
*
* <p>For a more complete explanation, see <a
* href="http://www.ibm.com/java/education/boundaries/boundaries.html">http://www.ibm.com/java/education/boundaries/boundaries.html</a>.
* &nbsp; For examples, see the resource data (which is annotated).</p>
@ -223,7 +223,7 @@ private:
//=======================================================================
// constructors
//=======================================================================
// This constructor uses the udata interface to create a BreakIterator whose
// internal tables live in a memory-mapped file. "image" is a pointer to the
// beginning of that file.
@ -426,7 +426,7 @@ RuleBasedBreakIterator(UDataMemory* image);
virtual BreakIterator * createBufferClone(void *stackBuffer,
int32_t &BufferSize,
UErrorCode &status);
protected:
//=======================================================================

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1997-1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1997-1999}, International Business Machines Corporation and others. All Rights Reserved.
* *
********************************************************************************
*
@ -109,7 +109,7 @@ public:
/**
* Construct a SimpleTimeZone with the given raw GMT offset, time zone ID,
* and times to start and end daylight savings time. To create a TimeZone that
* doesn't observe daylight savings time, don't use this constructor; use
* doesn't observe daylight savings time, don't use this constructor; use
* SimpleTimeZone(rawOffset, ID) instead. Normally, you should use
* TimeZone.createInstance() to create a TimeZone instead of creating a
* SimpleTimeZone directly with this constructor.
@ -240,10 +240,10 @@ public:
* @param status An UErrorCode
* @stable
*/
void setStartRule(int32_t month, int32_t dayOfMonth, int32_t time,
void setStartRule(int32_t month, int32_t dayOfMonth, int32_t time,
UErrorCode& status);
void setStartRule(int32_t month, int32_t dayOfMonth, int32_t time,
void setStartRule(int32_t month, int32_t dayOfMonth, int32_t time,
TimeMode mode, UErrorCode& status);
/**
@ -264,10 +264,10 @@ public:
* @param status An UErrorCode
* @stable
*/
void setStartRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
void setStartRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
int32_t time, UBool after, UErrorCode& status);
void setStartRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
void setStartRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
int32_t time, TimeMode mode, UBool after, UErrorCode& status);
/**
@ -336,10 +336,10 @@ public:
* @param status An UErrorCode
* @stable
*/
void setEndRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
void setEndRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
int32_t time, UBool after, UErrorCode& status);
void setEndRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
void setEndRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
int32_t time, TimeMode mode, UBool after, UErrorCode& status);
/**
@ -383,11 +383,11 @@ public:
* @stable
*/
virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
uint8_t dayOfWeek, int32_t milliseconds,
uint8_t dayOfWeek, int32_t milliseconds,
int32_t monthLength, UErrorCode& status) const;
virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
uint8_t dayOfWeek, int32_t milliseconds,
uint8_t dayOfWeek, int32_t milliseconds,
int32_t monthLength, int32_t prevMonthLength,
UErrorCode& status) const;
@ -495,7 +495,7 @@ public:
static UClassID getStaticClassID(void) { return (UClassID)&fgClassID; }
private:
/**
/**
* Constants specifying values of startMode and endMode.
*/
enum EMode
@ -542,7 +542,7 @@ private:
/**
* Given a set of encoded rules in startDay and startDayOfMonth, decode
* them and set the startMode appropriately. Do the same for endDay and
* endDayOfMonth.
* endDayOfMonth.
* <P>
* Upon entry, the day of week variables may be zero or
* negative, in order to indicate special modes. The day of month
@ -585,13 +585,13 @@ inline void SimpleTimeZone::setStartRule(int32_t month, int32_t dayOfWeekInMonth
}
inline void SimpleTimeZone::setStartRule(int32_t month, int32_t dayOfMonth,
int32_t time,
int32_t time,
UErrorCode& status) {
setStartRule(month, dayOfMonth, time, WALL_TIME, status);
}
inline void SimpleTimeZone::setStartRule(int32_t month, int32_t dayOfMonth,
int32_t dayOfWeek,
int32_t dayOfWeek,
int32_t time, UBool after, UErrorCode& status) {
setStartRule(month, dayOfMonth, dayOfWeek, time, WALL_TIME, after, status);
}
@ -607,7 +607,7 @@ inline void SimpleTimeZone::setEndRule(int32_t month, int32_t dayOfMonth,
setEndRule(month, dayOfMonth, time, WALL_TIME, status);
}
inline void SimpleTimeZone::setEndRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
inline void SimpleTimeZone::setEndRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
int32_t time, UBool after, UErrorCode& status) {
setEndRule(month, dayOfMonth, dayOfWeek, time, WALL_TIME, after, status);
}

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1997-2001}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1997-2001}, International Business Machines Corporation and others. All Rights Reserved.
*******************************************************************************
*
* File SMPDTFMT.H
@ -117,7 +117,7 @@ class DateFormat;
* SimpleTimeZone* pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, "PST");
* pdt->setStartRule( Calendar::APRIL, 1, Calendar::SUNDAY, 2*60*60*1000);
* pdt->setEndRule( Calendar::OCTOBER, -1, Calendar::SUNDAY, 2*60*60*1000);
*
*
* // Format the current time.
* SimpleDateFormat* formatter
* = new SimpleDateFormat ("yyyy.MM.dd G 'at' hh:mm:ss a zzz", success );
@ -127,7 +127,7 @@ class DateFormat;
* UnicodeString dateString;
* formatter->format( currentTime_1, dateString, fp );
* cout << "result: " << dateString << endl;
*
*
* // Parse the previous string back into a Date.
* ParsePosition pp(0);
* UDate currentTime_2 = formatter->parse(dateString, pp );

View file

@ -1,12 +1,12 @@
/*
* Copyright © {1996-1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1996-1999}, International Business Machines Corporation and others. All Rights Reserved.
*****************************************************************************************
*/
//===============================================================================
//
// File sortkey.h
//
//
//
//
// Created by: Helena Shih
//
@ -16,7 +16,7 @@
//
// 6/20/97 helena Java class name change.
// 8/18/97 helena Added internal API documentation.
// 6/26/98 erm Changed to use byte arrays and memcmp.
// 6/26/98 erm Changed to use byte arrays and memcmp.
//===============================================================================
#ifndef SORTKEY_H
@ -56,7 +56,7 @@ class RuleBasedCollator;
* myCollator->getCollationKey("Tom", keys[0], success );
* myCollator->getCollationKey("Dick", keys[1], success );
* myCollator->getCollationKey("Harry", keys[2], success );
*
*
* // Inside body of sort routine, compare keys this way:
* CollationKey tmp;
* if(keys[0].compareTo( keys[1] ) > 0 ) {
@ -71,8 +71,8 @@ class RuleBasedCollator;
* <p>
* <strong>Note:</strong> <code>Collator</code>s with different Locale,
* CollationStrength and DecompositionMode settings will return different
* CollationKeys for the same set of strings. Locales have specific
* collation rules, and the way in which secondary and tertiary differences
* CollationKeys for the same set of strings. Locales have specific
* collation rules, and the way in which secondary and tertiary differences
* are taken into account, for example, will result in different CollationKeys
* for same strings.
* <p>
@ -86,7 +86,7 @@ class RuleBasedCollator;
class U_I18N_API CollationKey {
public:
/**
* This creates an empty collation key based on the null string. An empty
* This creates an empty collation key based on the null string. An empty
* collation key contains no sorting information. When comparing two empty
* collation keys, the result is Collator::EQUAL. Comparing empty collation key
* with non-empty collation key is always Collator::LESS.
@ -96,7 +96,7 @@ public:
/**
* Creates a collation key based on the collation key values.
* Creates a collation key based on the collation key values.
* @param values the collation key values
* @param count number of collation key values, including trailing nulls.
* @see #createBits
@ -110,7 +110,7 @@ public:
* @deprecated
*/
CollationKey(const CollationKey& other);
/**
/**
* Sort key destructor.
* @deprecated
*/
@ -147,7 +147,7 @@ public:
*/
UBool isBogus(void) const;
/**
/**
* Returns a pointer to the collation key values. The storage is owned
* by the collation key and the pointer will become invalid if the key
* is deleted.
@ -157,7 +157,7 @@ public:
*/
const uint8_t* getByteArray(int32_t& count) const;
/**
/**
* Extracts the collation key values into a new array. The caller owns
* this storage and should free it.
* @param count the output parameter of number of collation key values,
@ -171,7 +171,7 @@ public:
* two collation keys.
* @param sourceKey source collation key
* @param targetKey target collation key
* @return Returns Collator::LESS if sourceKey &lt; targetKey,
* @return Returns Collator::LESS if sourceKey &lt; targetKey,
* Collator::GREATER if sourceKey > targetKey and Collator::EQUAL
* otherwise.
* @deprecated

View file

@ -1,6 +1,6 @@
/*
******************************************************************************
* Copyright © {1996-2001}, International Business Machines Corporation and
* Copyright (C) 1996-2001, International Business Machines Corporation and
* others. All Rights Reserved.
******************************************************************************
*/
@ -31,7 +31,7 @@
* specifying whether or not binary loading is to be
* attempted. This is required for dynamic rule loading.
* 05/07/97 helena Added memory allocation error detection.
* 6/17/97 helena Added IDENTICAL strength for compare, changed getRules to
* 6/17/97 helena Added IDENTICAL strength for compare, changed getRules to
* use MergeCollation::getPattern.
* 6/20/97 helena Java class name change.
* 8/18/97 helena Added internal API documentation.
@ -41,13 +41,13 @@
* 04/23/99 stephen Removed EDecompositionMode, merged with
* Normalizer::EMode
* 06/14/99 stephen Removed kResourceBundleSuffix
* 11/02/99 helena Collator performance enhancements. Eliminates the
* 11/02/99 helena Collator performance enhancements. Eliminates the
* UnicodeString construction and special case for NO_OP.
* 11/23/99 srl More performance enhancements. Updates to NormalizerIterator
* internal state management.
* 12/15/99 aliu Update to support Thai collation. Move NormalizerIterator
* to implementation file.
* 01/29/01 synwee Modified into a C++ wrapper which calls C API
* 01/29/01 synwee Modified into a C++ wrapper which calls C API
* (ucol.h)
*/
@ -61,15 +61,15 @@
class CollationElementIterator;
/**
* The RuleBasedCollator class provides the simple implementation of
* Collator, using data-driven tables. The user can create a customized
* The RuleBasedCollator class provides the simple implementation of
* Collator, using data-driven tables. The user can create a customized
* table-based collation.
* <P>
* RuleBasedCollator maps characters to collation keys.
* <p>
* Table Collation has the following restrictions for efficiency (other
* subclasses may be used for more complex languages) :
* <p>1. If the French secondary ordering is specified in a collation
* <p>1. If the French secondary ordering is specified in a collation
* object, it is applied to the whole object.
* <p>2. All non-mentioned Unicode characters are at the end of the
* collation order.
@ -94,7 +94,7 @@ class CollationElementIterator;
* <LI><strong>Modifier</strong>: There is a single modifier,
* which is used to specify that all secondary differences are
* sorted backwards.
* <p>'@' : Indicates that secondary differences, such as accents, are
* <p>'@' : Indicates that secondary differences, such as accents, are
* sorted backwards, as in French.<P>
* <LI><strong>Relation</strong>: The relations are the following:
* <UL Type=square>
@ -129,29 +129,29 @@ class CollationElementIterator;
* \endcode
* </pre>
* Either the text-argument must already be present in the sequence, or some
* initial substring of the text-argument must be present. (e.g. "a &lt; b &
* ae &lt; e" is valid since "a" is present in the sequence before "ae" is
* reset). In this latter case, "ae" is not entered and treated as a single
* character; instead, "e" is sorted as if it were expanded to two characters:
* initial substring of the text-argument must be present. (e.g. "a &lt; b &
* ae &lt; e" is valid since "a" is present in the sequence before "ae" is
* reset). In this latter case, "ae" is not entered and treated as a single
* character; instead, "e" is sorted as if it were expanded to two characters:
* "a" followed by an "e". This difference appears in natural languages: in
* traditional Spanish "ch" is treated as though it contracts to a single
* character (expressed as "c &lt; ch &lt; d"), while in traditional German
* "ä" (a-umlaut) is treated as though it expands to two characters (expressed
* character (expressed as "c &lt; ch &lt; d"), while in traditional German
* "ä" (a-umlaut) is treated as though it expands to two characters (expressed
* as "a & ae ; ä &lt; b").
* <p><strong>Ignorable Characters</strong>
* <p>For ignorable characters, the first rule must start with a relation (the
* examples we have used above are really fragments; "a &lt; b" really should
* be "&lt; a &lt; b"). If, however, the first relation is not "&lt;", then
* all the text-arguments up to the first "&lt;" are ignorable. For example,
* ", - &lt; a &lt; b" makes "-" an ignorable character, as we saw earlier in
* the word "black-birds". In the samples for different languages, you see
* examples we have used above are really fragments; "a &lt; b" really should
* be "&lt; a &lt; b"). If, however, the first relation is not "&lt;", then
* all the text-arguments up to the first "&lt;" are ignorable. For example,
* ", - &lt; a &lt; b" makes "-" an ignorable character, as we saw earlier in
* the word "black-birds". In the samples for different languages, you see
* that most accents are ignorable.
* <p><strong>Normalization and Accents</strong>
* <p>The Collator object automatically normalizes text internally to
* separate accents from base characters where possible. This is done both
* when processing the rules, and when comparing two strings. Collator also
* uses the Unicode canonical mapping to ensure that combining sequences are
* sorted properly (for more information, see
* <p>The Collator object automatically normalizes text internally to
* separate accents from base characters where possible. This is done both
* when processing the rules, and when comparing two strings. Collator also
* uses the Unicode canonical mapping to ensure that combining sequences are
* sorted properly (for more information, see
* <A HREF="http://www.aw.com/devpress"> The Unicode Standard, Version 2.0</A>
* .)</P>
* <p><strong>Errors</strong>
@ -181,7 +181,7 @@ class CollationElementIterator;
* <pre>
* \code
* UErrorCode status = U_ZERO_ERROR;
* RuleBasedCollator *mySimple =
* RuleBasedCollator *mySimple =
* new RuleBasedCollator(Simple, status);
* \endcode
* </pre>
@ -189,7 +189,7 @@ class CollationElementIterator;
* <pre>
* \code
* UErrorCode status = U_ZERO_ERROR;
* RuleBasedCollator *myNorwegian =
* RuleBasedCollator *myNorwegian =
* new RuleBasedCollator(Norwegian, status);
* \endcode
* </pre>
@ -216,7 +216,7 @@ class CollationElementIterator;
* UErrorCode status = U_ZERO_ERROR;
* UnicodeString rules(DEFAULTRULES);
* rules += "& C &lt; ch, cH, Ch, CH";
* RuleBasedCollator *mySpanish =
* RuleBasedCollator *mySpanish =
* new RuleBasedCollator(rules, status);
* \endcode
* </pre>
@ -226,9 +226,9 @@ class CollationElementIterator;
* \code
* UErrorCode status = U_ZERO_ERROR;
* UnicodeString rules(DEFAULTRULES);
* rules += "& Question-mark ; '?' & Ampersand ; '&' & Dollar-sign ;
* rules += "& Question-mark ; '?' & Ampersand ; '&' & Dollar-sign ;
* '$' ";
* RuleBasedCollator *myTable =
* RuleBasedCollator *myTable =
* new RuleBasedCollator(rules, status);
* \endcode
* </pre>
@ -249,10 +249,10 @@ class CollationElementIterator;
* RuleBasedCollator(" < a < b < d & b < c", status);
* \endcode
* </pre>
* Because " &lt; a &lt; b &lt; c &lt; d" is the same as "a &lt; b &lt; d & b
* Because " &lt; a &lt; b &lt; c &lt; d" is the same as "a &lt; b &lt; d & b
* &lt; c" or "&lt; a &lt; b & b &lt; c & c &lt; d".
*
* <p>To combine collations from two locales, (without error handling for
* <p>To combine collations from two locales, (without error handling for
* clarity)
* <pre>
* \code
@ -260,18 +260,18 @@ class CollationElementIterator;
* Locale locale_en_US("en", "US", "");
* RuleBasedCollator* en_USCollator = (RuleBasedCollator*)
* Collator::createInstance( locale_en_US, success );
*
*
* // Create a da_DK Collator object
* Locale locale_da_DK("da", "DK", "");
* RuleBasedCollator* da_DKCollator = (RuleBasedCollator*)
* Collator::createInstance( locale_da_DK, success );
*
*
* // Combine the two
* // First, get the collation rules from en_USCollator
* UnicodeString rules = en_USCollator->getRules();
* // Second, get the collation rules from da_DKCollator
* rules += da_DKCollator->getRules();
* RuleBasedCollator* newCollator =
* RuleBasedCollator* newCollator =
* new RuleBasedCollator(rules, success);
* // newCollator has the combined rules
* \endcode
@ -285,7 +285,7 @@ class CollationElementIterator;
* // Create a new Collator object with additional rules
* rules = en_USCollator->getRules();
* rules += "& C < ch, cH, Ch, CH";
* RuleBasedCollator* myCollator =
* RuleBasedCollator* myCollator =
* new RuleBasedCollator(rules, success);
* // myCollator contains the new rules
* \endcode
@ -305,14 +305,14 @@ class CollationElementIterator;
* ';', 0x0311, ';', 0x0312, // main accents
* '<', 'a', ',', 'A', ';', 'a', 'e', ',', 'A', 'E',
* ';', 0x00e6, ',', 0x00c6, '<', 'b', ',', 'B',
* '<', 'c', ',', 'C', '<', 'e', ',', 'E', '&',
* '<', 'c', ',', 'C', '<', 'e', ',', 'E', '&',
* 'C', '<', 'd', ',', 'D', 0 };
* UnicodeString oldRules(contents);
* UErrorCode status = U_ZERO_ERROR;
* // change the order of accent characters
* UChar addOn[] = { '&', ',', 0x0300, ';', 0x0308, ';', 0x0302, 0 };
* oldRules += addOn;
* RuleBasedCollator *myCollation =
* RuleBasedCollator *myCollation =
* new RuleBasedCollator(oldRules, status);
* \endcode
* </pre>
@ -324,42 +324,42 @@ class CollationElementIterator;
* \code
* UErrorCode status = U_ZERO_ERROR;
* // get en_US collation rules
* RuleBasedCollator* en_USCollation = (RuleBasedCollator*)
* RuleBasedCollator* en_USCollation = (RuleBasedCollator*)
* Collator::createInstance(Locale::US, status);
* // Always check the error code after each call.
* if (U_FAILURE(status)) return;
* // add a few Japanese character to sort before English characters
* // suppose the last character before the first base letter 'a' in
* // the English collation rule is 0x2212
* UChar jaString[] = {'&', 0x2212, '<', 0x3041, ',', 0x3042, '<',
* UChar jaString[] = {'&', 0x2212, '<', 0x3041, ',', 0x3042, '<',
* 0x3043, ',', 0x3044, 0};
* UnicodeString rules(en_USCollation->getRules());
* rules += jaString;
* RuleBasedCollator *myJapaneseCollation =
* RuleBasedCollator *myJapaneseCollation =
* new RuleBasedCollator(rules, status);
* \endcode
* </pre>
* <p><strong>NOTE</strong>: Typically, a collation object is created with
* Collator::createInstance().
* <p>
* <strong>Note:</strong> <code>RuleBasedCollator</code>s with different
* Locale, CollationStrength and Decomposition mode settings will return
* different sort orders for the same set of strings. Locales have specific
* collation rules, and the way in which secondary and tertiary differences
* are taken into account, for example, will result in a different sorting
* <strong>Note:</strong> <code>RuleBasedCollator</code>s with different
* Locale, CollationStrength and Decomposition mode settings will return
* different sort orders for the same set of strings. Locales have specific
* collation rules, and the way in which secondary and tertiary differences
* are taken into account, for example, will result in a different sorting
* order for same strings.
* <p>
* @see Collator
* @version 1.8 Jan 8 2001
*/
class U_I18N_API RuleBasedCollator : public Collator
class U_I18N_API RuleBasedCollator : public Collator
{
public:
public:
// constructor -------------------------------------------------------------
/**
* RuleBasedCollator constructor. This takes the table rules and builds a
* RuleBasedCollator constructor. This takes the table rules and builds a
* collation table out of them. Please see RuleBasedCollator class
* description for more details on the collation rule syntax.
* @param rules the collation rules to build the collation table from.
@ -369,7 +369,7 @@ public:
RuleBasedCollator(const UnicodeString& rules, UErrorCode& status);
/**
* RuleBasedCollator constructor. This takes the table rules and builds a
* RuleBasedCollator constructor. This takes the table rules and builds a
* collation table out of them. Please see RuleBasedCollator class
* description for more details on the collation rule syntax.
* @param rules the collation rules to build the collation table from.
@ -377,12 +377,12 @@ public:
* @param status reporting a success or an error.
* @see Locale
*/
RuleBasedCollator(const UnicodeString& rules,
ECollationStrength collationStrength,
RuleBasedCollator(const UnicodeString& rules,
ECollationStrength collationStrength,
UErrorCode& status);
/**
* RuleBasedCollator constructor. This takes the table rules and builds a
* RuleBasedCollator constructor. This takes the table rules and builds a
* collation table out of them. Please see RuleBasedCollator class
* description for more details on the collation rule syntax.
* @param rules the collation rules to build the collation table from.
@ -391,11 +391,11 @@ public:
* @see Locale
*/
RuleBasedCollator(const UnicodeString& rules,
Normalizer::EMode decompositionMode,
Normalizer::EMode decompositionMode,
UErrorCode& status);
/**
* RuleBasedCollator constructor. This takes the table rules and builds a
* RuleBasedCollator constructor. This takes the table rules and builds a
* collation table out of them. Please see RuleBasedCollator class
* description for more details on the collation rule syntax.
* @param rules the collation rules to build the collation table from.
@ -404,12 +404,12 @@ public:
* @param status reporting a success or an error.
* @see Locale
*/
RuleBasedCollator(const UnicodeString& rules,
RuleBasedCollator(const UnicodeString& rules,
ECollationStrength collationStrength,
Normalizer::EMode decompositionMode,
UErrorCode& status);
/**
/**
* Copy constructor.
* @param the RuleBasedCollator object to be copied
* @see Locale
@ -418,7 +418,7 @@ public:
// destructor --------------------------------------------------------------
/**
/**
* Destructor.
*/
virtual ~RuleBasedCollator();
@ -430,7 +430,7 @@ public:
* @param other other RuleBasedCollator object to compare with.
*/
RuleBasedCollator& operator=(const RuleBasedCollator& other);
/**
* Returns true if argument is the same as this object.
* @param other Collator object to be compared.
@ -446,17 +446,17 @@ public:
virtual UBool operator!=(const Collator& other) const;
/**
* Makes a deep copy of the object.
* Makes a deep copy of the object.
* The caller owns the returned object.
* @return the cloned object.
*/
virtual Collator* clone(void) const;
/**
* Creates a collation element iterator for the source string. The caller of
* this method is responsible for the memory management of the return
* Creates a collation element iterator for the source string. The caller of
* this method is responsible for the memory management of the return
* pointer.
* @param source the string over which the CollationElementIterator will
* @param source the string over which the CollationElementIterator will
* iterate.
* @return the collation element iterator of the source string using this as
* the based Collator.
@ -465,66 +465,66 @@ public:
const UnicodeString& source) const;
/**
* Creates a collation element iterator for the source. The caller of this
* Creates a collation element iterator for the source. The caller of this
* method is responsible for the memory management of the returned pointer.
* @param source the CharacterIterator which produces the characters over
* @param source the CharacterIterator which produces the characters over
* which the CollationElementItgerator will iterate.
* @return the collation element iterator of the source using this as the
* @return the collation element iterator of the source using this as the
* based Collator.
*/
virtual CollationElementIterator* createCollationElementIterator(
const CharacterIterator& source) const;
/**
* Compares a range of character data stored in two different strings based
* on the collation rules. Returns information about whether a string is
* Compares a range of character data stored in two different strings based
* on the collation rules. Returns information about whether a string is
* less than, greater than or equal to another string in a language.
* This can be overriden in a subclass.
* @param source the source string.
* @param target the target string to be compared with the source string.
* @return the comparison result. GREATER if the source string is greater
* than the target string, LESS if the source is less than the
* than the target string, LESS if the source is less than the
* target. Otherwise, returns EQUAL.
*/
virtual EComparisonResult compare(const UnicodeString& source,
virtual EComparisonResult compare(const UnicodeString& source,
const UnicodeString& target) const;
/**
* Compares a range of character data stored in two different strings based
* on the collation rules up to the specified length. Returns information
* about whether a string is less than, greater than or equal to another
* Compares a range of character data stored in two different strings based
* on the collation rules up to the specified length. Returns information
* about whether a string is less than, greater than or equal to another
* string in a language. This can be overriden in a subclass.
* @param source the source string.
* @param target the target string to be compared with the source string.
* @param length compares up to the specified length
* @return the comparison result. GREATER if the source string is greater
* than the target string, LESS if the source is less than the
* than the target string, LESS if the source is less than the
* target. Otherwise, returns EQUAL.
*/
virtual EComparisonResult compare(const UnicodeString& source,
*/
virtual EComparisonResult compare(const UnicodeString& source,
const UnicodeString& target,
int32_t length) const;
/**
* The comparison function compares the character data stored in two
* different string arrays. Returns information about whether a string array
* different string arrays. Returns information about whether a string array
* is less than, greater than or equal to another string array.
* <p>Example of use:
* <pre>
* . UErrorCode status = U_ZERO_ERROR;
* . Collator *myCollation =
* . Collator *myCollation =
* . Collator::createInstance(Locale::US, status);
* . if (U_FAILURE(status)) return;
* . myCollation->setStrength(Collator::PRIMARY);
* . // result would be Collator::EQUAL ("abc" == "ABC")
* . // (no primary difference between "abc" and "ABC")
* . Collator::UCollationResult result =
* . Collator::UCollationResult result =
* . myCollation->compare(L"abc", 3, L"ABC", 3);
* . myCollation->setStrength(Collator::TERTIARY);
* . // result would be Collator::LESS (abc" &lt;&lt;&lt; "ABC")
* . // (with tertiary difference between "abc" and "ABC")
* . Collator::UCollationResult result =
* . Collator::UCollationResult result =
* . myCollation->compare(L"abc", 3, L"ABC", 3);
* </pre>
* @param source the source string array to be compared with.
@ -533,18 +533,18 @@ public:
* @param target the string that is to be compared with the source string.
* @param targetLength the length of the target string array. If this value
* is equal to -1, the string array is null-terminated.
* @return Returns a byte value. GREATER if source is greater than target;
* EQUAL if source is equal to target; LESS if source is less than
* @return Returns a byte value. GREATER if source is greater than target;
* EQUAL if source is equal to target; LESS if source is less than
* target
*/
virtual EComparisonResult compare(const UChar* source, int32_t sourceLength,
const UChar* target, int32_t targetLength)
const UChar* target, int32_t targetLength)
const;
/**
/**
* Transforms a specified region of the string into a series of characters
* that can be compared with CollationKey.compare. Use a CollationKey when
* you need to do repeated comparisions on the same string. For a single
* that can be compared with CollationKey.compare. Use a CollationKey when
* you need to do repeated comparisions on the same string. For a single
* comparison the compare method will be faster.
* @param source the source string.
* @param key the transformed key of the source string.
@ -556,10 +556,10 @@ public:
CollationKey& key,
UErrorCode& status) const;
/**
/**
* Transforms a specified region of the string into a series of characters
* that can be compared with CollationKey.compare. Use a CollationKey when
* you need to do repeated comparisions on the same string. For a single
* you need to do repeated comparisions on the same string. For a single
* comparison the compare method will be faster.
* @param source the source string.
* @param key the transformed key of the source string.
@ -567,9 +567,9 @@ public:
* @return the transformed key.
* @see CollationKey
*/
virtual CollationKey& getCollationKey(const UChar *source,
int32_t sourceLength,
CollationKey& key,
virtual CollationKey& getCollationKey(const UChar *source,
int32_t sourceLength,
CollationKey& key,
UErrorCode& status) const;
/**
@ -580,54 +580,54 @@ public:
/**
* Gets the table-based rules for the collation object.
* @return returns the collation rules that the table collation object was
* @return returns the collation rules that the table collation object was
* created from.
*/
const UnicodeString& getRules(void) const;
/**
* Return the maximum length of any expansion sequences that end with the
* Return the maximum length of any expansion sequences that end with the
* specified comparison order.
* @param order a collation order returned by previous or next.
* @return maximum size of the expansion sequences ending with the collation
* element or 1 if collation element does not occur at the end of
* @return maximum size of the expansion sequences ending with the collation
* element or 1 if collation element does not occur at the end of
* any expansion sequence
* @see CollationElementIterator#getMaxExpansion
*/
int32_t getMaxExpansion(int32_t order) const;
/**
* Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
* method is to implement a simple version of RTTI, since not all C++
* compilers support genuine RTTI. Polymorphic operator==() and clone()
* Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
* method is to implement a simple version of RTTI, since not all C++
* compilers support genuine RTTI. Polymorphic operator==() and clone()
* methods call this method.
* @return The class ID for this object. All objects of a given class have
* the same class ID. Objects of other classes have different class
* @return The class ID for this object. All objects of a given class have
* the same class ID. Objects of other classes have different class
* IDs.
*/
virtual UClassID getDynamicClassID(void) const
{
return RuleBasedCollator::getStaticClassID();
{
return RuleBasedCollator::getStaticClassID();
}
/**
* Returns the class ID for this class. This is useful only for comparing to
* Returns the class ID for this class. This is useful only for comparing to
* a return value from getDynamicClassID(). For example:
* <pre>
* Base* polymorphic_pointer = createPolymorphicObject();
* if (polymorphic_pointer->getDynamicClassID() ==
* if (polymorphic_pointer->getDynamicClassID() ==
* Derived::getStaticClassID()) ...
* </pre>
* @return The class ID for all objects of this class.
*/
static UClassID getStaticClassID(void)
{
return (UClassID)&fgClassID;
static UClassID getStaticClassID(void)
{
return (UClassID)&fgClassID;
}
/**
* Returns the binary format of the class's rules. The format is that of
* .col files.
* Returns the binary format of the class's rules. The format is that of
* .col files.
* @param length Returns the length of the data, in bytes
* @param status the error code status.
* @return memory, owned by the caller, of size 'length' bytes.
@ -635,20 +635,20 @@ public:
uint8_t *cloneRuleData(int32_t &length, UErrorCode &status);
/**
* Returns current rules. Delta defines whether full rules are returned or
* just the tailoring.
* @param delta one of UCOL_TAILORING_ONLY, UCOL_FULL_RULES.
* Returns current rules. Delta defines whether full rules are returned or
* just the tailoring.
* @param delta one of UCOL_TAILORING_ONLY, UCOL_FULL_RULES.
* @return UnicodeString with rules
*/
UnicodeString getRules(UColRuleOption delta);
/**
* Universal attribute setter
* @param attr attribute type
* @param attr attribute type
* @param value attribute value
* @param status to indicate whether the operation went on smoothly or there were errors
*/
virtual void setAttribute(UColAttribute attr, UColAttributeValue value,
virtual void setAttribute(UColAttribute attr, UColAttributeValue value,
UErrorCode &status);
/**
@ -657,7 +657,7 @@ public:
* @param status to indicate whether the operation went on smoothly or there were errors
* @return attribute value
*/
virtual UColAttributeValue getAttribute(UColAttribute attr,
virtual UColAttributeValue getAttribute(UColAttribute attr,
UErrorCode &status);
/**
@ -667,9 +667,9 @@ public:
virtual Collator* safeClone(void);
/**
* String compare that uses user supplied character iteration. The idea is
* to prevent users from having to convert the whole string into UChar's
* before comparing since sometimes strings differ on first couple of
* String compare that uses user supplied character iteration. The idea is
* to prevent users from having to convert the whole string into UChar's
* before comparing since sometimes strings differ on first couple of
* characters.
* @param coll Collator to be used for comparing
* @param source pointer to function for iterating over the first string
@ -683,10 +683,10 @@ public:
/**
* Get the sort key as an array of bytes from an UnicodeString.
* @param source string to be processed.
* @param result buffer to store result in. If NULL, number of bytes needed
* @param result buffer to store result in. If NULL, number of bytes needed
* will be returned.
* @param resultLength length of the result buffer. If if not enough the
* buffer will be filled to capacity.
* @param resultLength length of the result buffer. If if not enough the
* buffer will be filled to capacity.
* @return Number of bytes needed for storing the sort key
*/
virtual int32_t getSortKey(const UnicodeString& source, uint8_t *result,
@ -695,12 +695,12 @@ public:
/**
* Get the sort key as an array of bytes from an UChar buffer.
* @param source string to be processed.
* @param sourceLength length of string to be processed. If -1, the string
* @param sourceLength length of string to be processed. If -1, the string
* is 0 terminated and length will be decided by the function.
* @param result buffer to store result in. If NULL, number of bytes needed
* @param result buffer to store result in. If NULL, number of bytes needed
* will be returned.
* @param resultLength length of the result buffer. If if not enough the
* buffer will be filled to capacity.
* @param resultLength length of the result buffer. If if not enough the
* buffer will be filled to capacity.
* @return Number of bytes needed for storing the sort key
*/
virtual int32_t getSortKey(const UChar *source, int32_t sourceLength,
@ -716,19 +716,19 @@ public:
* @see RuleBasedCollator#setStrength
*/
virtual ECollationStrength getStrength(void) const;
/**
* Sets the minimum strength to be used in comparison or transformation.
* <p>Example of use:
* <pre>
* . UErrorCode status = U_ZERO_ERROR;
* . Collator*myCollation = Collator::createInstance(Locale::US,
* . Collator*myCollation = Collator::createInstance(Locale::US,
* status);
* . if (U_FAILURE(status)) return;
* . myCollation->setStrength(Collator::PRIMARY);
* . // result will be "abc" == "ABC"
* . // tertiary differences will be ignored
* . Collator::ComparisonResult result = myCollation->compare("abc",
* . Collator::ComparisonResult result = myCollation->compare("abc",
* "ABC");
* </pre>
* @see RuleBasedCollator#getStrength
@ -738,7 +738,7 @@ public:
virtual void setStrength(ECollationStrength newStrength);
/**
* Set the decomposition mode of the Collator object. success is equal to
* Set the decomposition mode of the Collator object. success is equal to
* U_ILLEGAL_ARGUMENT_ERROR if error occurs.
* @param the new decomposition mode
* @see Collator#getDecomposition
@ -753,7 +753,7 @@ public:
virtual Normalizer::EMode getDecomposition(void) const;
private:
// private static constants -----------------------------------------------
static const int32_t UNMAPPED;
@ -772,14 +772,14 @@ private:
static const int32_t SECONDARYDIFFERENCEONLY;
static const int32_t PRIMARYORDERSHIFT;
static const int32_t SECONDARYORDERSHIFT;
static const int32_t COLELEMENTSTART;
static const int32_t PRIMARYLOWZEROMASK;
static const int32_t RESETSECONDARYTERTIARY;
static const int32_t RESETTERTIARY;
static const int32_t PRIMIGNORABLE;
static const int16_t FILEID;
static const char *kFilenameSuffix;
@ -793,7 +793,7 @@ private:
// private data members ---------------------------------------------------
UBool dataIsOwned;
/**
* c struct for collation. All initialisation for it has to be done through
* setUCollator().
@ -807,7 +807,7 @@ private:
// friend classes --------------------------------------------------------
/**
/**
* Streamer used to read/write binary collation data files.
*/
friend class RuleBasedCollatorStreamer;
@ -816,16 +816,16 @@ private:
* Used to iterate over collation elements in a character source.
*/
friend class CollationElementIterator;
/**
* Collator ONLY needs access to RuleBasedCollator(const Locale&,
* Collator ONLY needs access to RuleBasedCollator(const Locale&,
* UErrorCode&)
*/
friend class Collator;
// private constructors --------------------------------------------------
/**
/**
* Default constructor
*/
RuleBasedCollator();
@ -837,11 +837,11 @@ private:
RuleBasedCollator(UCollator *collator, UnicodeString *rule);
/**
* RuleBasedCollator constructor. This constructor takes a locale. The
* only caller of this class should be Collator::createInstance(). If
* createInstance() happens to know that the requested locale's collation is
* implemented as a RuleBasedCollator, it can then call this constructor.
* OTHERWISE IT SHOULDN'T, since this constructor ALWAYS RETURNS A VALID
* RuleBasedCollator constructor. This constructor takes a locale. The
* only caller of this class should be Collator::createInstance(). If
* createInstance() happens to know that the requested locale's collation is
* implemented as a RuleBasedCollator, it can then call this constructor.
* OTHERWISE IT SHOULDN'T, since this constructor ALWAYS RETURNS A VALID
* COLLATION TABLE. It does this by falling back to defaults.
* @param desiredLocale locale used
* @param status error code status
@ -903,7 +903,7 @@ inline UBool RuleBasedCollator::operator!=(const Collator& other) const
return !(*this == other);
}
inline void RuleBasedCollator::setUCollator(const char *locale,
inline void RuleBasedCollator::setUCollator(const char *locale,
UErrorCode &status)
{
if (U_FAILURE(status))
@ -913,7 +913,7 @@ inline void RuleBasedCollator::setUCollator(const char *locale,
ucollator = ucol_open(locale, &status);
}
inline void RuleBasedCollator::setUCollator(const Locale &locale,
inline void RuleBasedCollator::setUCollator(const Locale &locale,
UErrorCode &status)
{
setUCollator(locale.getName(), status);
@ -934,7 +934,7 @@ inline Collator::EComparisonResult RuleBasedCollator::getEComparisonResult(
case UCOL_LESS :
return Collator::LESS;
case UCOL_EQUAL :
return Collator::EQUAL;
return Collator::EQUAL;
default :
return Collator::GREATER;
}
@ -942,14 +942,14 @@ inline Collator::EComparisonResult RuleBasedCollator::getEComparisonResult(
inline Collator::ECollationStrength RuleBasedCollator::getECollationStrength(
const UCollationStrength &strength) const
{
{
switch (strength)
{
case UCOL_PRIMARY :
return Collator::PRIMARY;
case UCOL_SECONDARY :
return Collator::SECONDARY;
case UCOL_TERTIARY :
case UCOL_TERTIARY :
return Collator::TERTIARY;
default :
return Collator::IDENTICAL;
@ -958,14 +958,14 @@ inline Collator::ECollationStrength RuleBasedCollator::getECollationStrength(
inline UCollationStrength RuleBasedCollator::getUCollationStrength(
const Collator::ECollationStrength &strength) const
{
{
switch (strength)
{
case Collator::PRIMARY :
return UCOL_PRIMARY;
case Collator::SECONDARY :
return UCOL_SECONDARY;
case Collator::TERTIARY :
case Collator::TERTIARY :
return UCOL_TERTIARY;
default :
return UCOL_IDENTICAL;

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1997-2001}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1997-2001}, International Business Machines Corporation and others. All Rights Reserved.
********************************************************************************
*
* File TIMEZONE.H
@ -36,7 +36,7 @@ struct TZHeader;
struct OffsetIndex;
struct CountryIndex;
struct TZEquivalencyGroup;
/**
* <code>TimeZone</code> represents a time zone offset, and also figures out daylight
* savings.
@ -76,7 +76,7 @@ struct TZEquivalencyGroup;
* daylight savings time.
*
* TimeZone is an abstract class representing a time zone. A TimeZone is needed for
* Calendar to produce local time for a particular time zone. A TimeZone comprises
* three basic pieces of information:<ul>
@ -106,7 +106,7 @@ struct TZEquivalencyGroup;
* obtain a list of all the time zone IDs recognized by createTimeZone().
* <P>
* You can also use TimeZone::createDefault() to create a TimeZone. This function uses
* platform-specific APIs to produce a TimeZone for the time zone corresponding to
* platform-specific APIs to produce a TimeZone for the time zone corresponding to
* the client's computer's physical location. For example, if you're in Japan (assuming
* your machine is set up correctly), TimeZone::createDefault() will return a TimeZone
* for Japanese Standard Time ("Asia/Tokyo").
@ -330,7 +330,7 @@ public:
* @stable
*/
virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
uint8_t dayOfWeek, int32_t milliseconds,
uint8_t dayOfWeek, int32_t milliseconds,
int32_t monthLength, UErrorCode& status) const = 0;
/**
@ -379,9 +379,9 @@ public:
* Enum for use with getDisplayName
*/
enum EDisplayType {
enum EDisplayType {
SHORT = 1,
LONG
LONG
};
/**
@ -592,7 +592,7 @@ private:
* INDEX_BY_ID, INDEX_BY_OFFSET, and ZONE_IDS. Also used to
* control read/write access to fgDefaultZone.
*/
static UMTX LOCK;
static UMTX LOCK;
/**
* Responsible for setting up fgDefaultZone. Uses routines in TPlatformUtilities

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1999-2001}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) 1999-2001, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 11/17/99 aliu Creation.
@ -231,7 +231,7 @@ private:
*/
UnicodeString ID;
/**
/**
* This transliterator's filter. Any character for which
* <tt>filter.contains()</tt> returns <tt>false</tt> will not be
* altered by this transliterator. If <tt>filter</tt> is
@ -446,7 +446,7 @@ public:
* pending transliterations, clients should call {@link
* #finishTransliteration} after the last call to this
* method has been made.
*
*
* @param text the buffer holding transliterated and untransliterated text
* @param index an array of three integers.
*
@ -496,7 +496,7 @@ public:
virtual void transliterate(Replaceable& text, UTransPosition& index,
UChar insertion,
UErrorCode& status) const;
/**
* Transliterates the portion of the text buffer that can be
* transliterated unambiguosly. This is a convenience method; see
@ -759,7 +759,7 @@ public:
/**
* Unregisters a transliterator or class. This may be either
* a system transliterator or a user transliterator or class.
*
*
* @param ID the ID of the transliterator or class
* @return the <code>Object</code> that was registered with
* <code>ID</code>, or <code>null</code> if none was

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1996-2001}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) 1996-2001, International Business Machines Corporation and others. All Rights Reserved.
*****************************************************************************************
*/
@ -9,13 +9,13 @@
#include "unicode/utypes.h"
/**
* \file
* \brief C API: BreakIterator
* \brief C API: BreakIterator
*
* <h2> BreakIterator C API </h2>
*
* The BreakIterator C API defines methods for finding the location
* of boundaries in text. Pointer to a UBreakIterator maintain a
* current position and scan over text returning the index of characters
* of boundaries in text. Pointer to a UBreakIterator maintain a
* current position and scan over text returning the index of characters
* where boundaries occur.
* <P>
* Line boundary analysis determines where a text string can be broken
@ -58,7 +58,7 @@
* u_strncpy(result, temp, end-start);
* res=(char*)malloc(sizeof(char) * (u_strlen(result)+1));
* u_austrcpy(res, result);
* printf("%s\n", res);
* printf("%s\n", res);
* }
* \endcode
* </pre>
@ -128,18 +128,18 @@
* stringToExamine=(UChar*)malloc(sizeof(UChar) * (strlen("Aaa bbb ccc. Ddd eee fff.")+1) );
* u_uastrcpy(stringToExamine, "Aaa bbb ccc. Ddd eee fff.");
* printf("Examining: "Aaa bbb ccc. Ddd eee fff.");
*
*
* //print each sentence in forward and reverse order
* boundary = ubrk_open(UBRK_SENTENCE, "en_us", stringToExamine, u_strlen(stringToExamine), &status);
* printf("----- forward: -----------\n");
* printf("----- forward: -----------\n");
* printEachForward(boundary, stringToExamine);
* printf("----- backward: ----------\n");
* printEachBackward(boundary, stringToExamine);
* ubrk_close(boundary);
*
*
* //print each word in order
* boundary = ubrk_open(UBRK_WORD, "en_us", stringToExamine, u_strlen(stringToExamine), &status);
* printf("----- forward: -----------\n");
* printf("----- forward: -----------\n");
* printEachForward(boundary, stringToExamine);
* printf("----- backward: ----------\n");
* printEachBackward(boundary, stringToExamine);
@ -152,14 +152,14 @@
* //print word at charpos 10
* printf("----- at pos 10: ---------\n");
* printAt(boundary, 10 , stringToExamine);
*
*
* ubrk_close(boundary);
* }
* \endcode
* </pre>
*/
/**
/**
* A text-break iterator.
* For usage in C programs.
*/
@ -178,14 +178,14 @@ enum UBreakIteratorType {
};
typedef enum UBreakIteratorType UBreakIteratorType;
/** Value indicating all text boundaries have been returned.
/** Value indicating all text boundaries have been returned.
*
*/
#define UBRK_DONE ((UTextOffset) -1)
/**
* Open a new UBreakIterator for locating text boundaries for a specified locale.
* A UBreakIterator may be used for detecting character, line, word,
* A UBreakIterator may be used for detecting character, line, word,
* and sentence breaks in text.
* @param type The type of UBreakIterator to open: one of UBRK_CHARACTER, UBRK_WORD,
* UBRK_LINE, UBRK_SENTENCE
@ -226,13 +226,13 @@ ubrk_openRules(const UChar *rules,
/**
* Thread safe cloning operation
* @param bi iterator to be cloned
* @param stackBuffer user allocated space for the new clone. If NULL new memory will be allocated.
* @param stackBuffer user allocated space for the new clone. If NULL new memory will be allocated.
If buffer is not large enough, new memory will be allocated.
Clients can use the U_BRK_SAFECLONE_BUFFERSIZE. This will probably be enough to avoid memory allocations.
* @param pBufferSize pointer to size of allocated space.
If *pBufferSize == 0, a sufficient size for use in cloning will
* @param pBufferSize pointer to size of allocated space.
If *pBufferSize == 0, a sufficient size for use in cloning will
be returned ('pre-flighting')
If *pBufferSize is not enough for a stack-based safe clone,
If *pBufferSize is not enough for a stack-based safe clone,
new memory will be allocated.
* @param status to indicate whether the operation went on smoothly or there were errors
An informational status value, U_SAFECLONE_ALLOCATED_ERROR, is used if any allocations were necessary.
@ -271,9 +271,9 @@ ubrk_setText(UBreakIterator* bi,
/**
* Determine the most recently-returned text boundary.
*
*
* @param bi The break iterator to use.
* @return The character index most recently returned by \Ref{ubrk_next}, \Ref{ubrk_previous},
* @return The character index most recently returned by \Ref{ubrk_next}, \Ref{ubrk_previous},
* \Ref{ubrk_first}, or \Ref{ubrk_last}.
* @stable
*/
@ -282,7 +282,7 @@ ubrk_current(const UBreakIterator *bi);
/**
* Determine the text boundary following the current text boundary.
*
*
* @param bi The break iterator to use.
* @return The character index of the next text boundary, or UBRK_DONE
* if all text boundaries have been returned.

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1996-1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) 1996-1999, International Business Machines Corporation and others. All Rights Reserved.
*******************************************************************************
*/
@ -9,12 +9,12 @@
#include "unicode/utypes.h"
/**
* \file
* \brief C API: Calendar
* \brief C API: Calendar
*
* <h2>Calendar C API</h2>
*
* UCalendar C API is used for converting between a <code>UDate</code> object
* and a set of integer fields such as <code>UCAL_YEAR</code>, <code>UCAL_MONTH</code>,
* and a set of integer fields such as <code>UCAL_YEAR</code>, <code>UCAL_MONTH</code>,
* <code>UCAL_DAY</code>, <code>UCAL_HOUR</code>, and so on.
* (A <code>UDate</code> object represents a specific instant in
* time with millisecond precision. See
@ -24,14 +24,14 @@
* <p>
* Types of <code>UCalendar</code> interpret a <code>UDate</code>
* according to the rules of a specific calendar system. The U_CAPI
* provides the enum UCalendarType with UCAL_TRADITIONAL and
* provides the enum UCalendarType with UCAL_TRADITIONAL and
* UCAL_GREGORIAN.
* <p>
* Like other locale-sensitive C API, calendar API provides a
* function, <code>ucal_open()</code>, which returns a pointer to
* <code>UCalendar</code> whose time fields have been initialized
* <code>UCalendar</code> whose time fields have been initialized
* with the current date and time. We need to specify the type of
* calendar to be opened and the timezoneId.
* calendar to be opened and the timezoneId.
* <blockquote>
* <pre>
* \code
@ -145,7 +145,7 @@ enum UCalendarType {
UCAL_GREGORIAN
};
typedef enum UCalendarType UCalendarType;
/** Possible fields in a UCalendar */
enum UCalendarDateFields {
/** Era field */
@ -287,12 +287,12 @@ ucal_countAvailableTZIDs(int32_t rawOffset);
* @return The current date and time.
* @stable
*/
U_CAPI UDate
U_CAPI UDate
ucal_getNow(void);
/**
* Open a UCalendar.
* A UCalendar may be used to convert a millisecond value to a year,
* A UCalendar may be used to convert a millisecond value to a year,
* month, and day.
* @param zoneID The desired TimeZone ID. If 0, use the default time zone.
* @param len The length of zoneID, or -1 if null-terminated.
@ -302,7 +302,7 @@ ucal_getNow(void);
* @return A pointer to a UCalendar, or 0 if an error occurred.
* @stable
*/
U_CAPI UCalendar*
U_CAPI UCalendar*
ucal_open( const UChar* zoneID,
int32_t len,
const char* locale,
@ -327,7 +327,7 @@ ucal_close(UCalendar *cal);
* @param status A pointer to an UErrorCode to receive any errors.
* @stable
*/
U_CAPI void
U_CAPI void
ucal_setTimeZone( UCalendar* cal,
const UChar* zoneID,
int32_t len,
@ -350,7 +350,7 @@ typedef enum UCalendarDisplayNameType UCalendarDisplayNameType;
* Get the display name for a UCalendar's TimeZone.
* A display name is suitable for presentation to a user.
* @param cal The UCalendar to query.
* @param type The desired display name format; one of UCAL_STANDARD, UCAL_SHORT_STANDARD,
* @param type The desired display name format; one of UCAL_STANDARD, UCAL_SHORT_STANDARD,
* UCAL_DST, UCAL_SHORT_DST
* @param locale The desired locale for the display name.
* @param status A pointer to an UErrorCode to receive any errors
@ -377,8 +377,8 @@ ucal_getTimeZoneDisplayName( const UCalendar* cal,
* @return TRUE if cal is currently in daylight savings time, FALSE otherwise
* @stable
*/
U_CAPI UBool
ucal_inDaylightTime( const UCalendar* cal,
U_CAPI UBool
ucal_inDaylightTime( const UCalendar* cal,
UErrorCode* status );
/** Types of UCalendar attributes */
@ -388,16 +388,16 @@ enum UCalendarAttribute {
/** First day of week */
UCAL_FIRST_DAY_OF_WEEK,
/** Minimum number of days in first week */
UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
};
typedef enum UCalendarAttribute UCalendarAttribute;
/**
/**
* Get a numeric attribute associated with a UCalendar.
* Numeric attributes include the first day of the week, or the minimal numbers
* of days in the first week of the month.
* @param cal The UCalendar to query.
* @param attr The desired attribute; one of UCAL_LENIENT, UCAL_FIRST_DAY_OF_WEEK,
* @param attr The desired attribute; one of UCAL_LENIENT, UCAL_FIRST_DAY_OF_WEEK,
* or UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
* @return The value of attr.
* @see ucal_setAttribute
@ -407,12 +407,12 @@ U_CAPI int32_t
ucal_getAttribute( const UCalendar* cal,
UCalendarAttribute attr);
/**
/**
* Set a numeric attribute associated with a UCalendar.
* Numeric attributes include the first day of the week, or the minimal numbers
* of days in the first week of the month.
* @param cal The UCalendar to set.
* @param attr The desired attribute; one of UCAL_LENIENT, UCAL_FIRST_DAY_OF_WEEK,
* @param attr The desired attribute; one of UCAL_LENIENT, UCAL_FIRST_DAY_OF_WEEK,
* or UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
* @param newValue The new value of attr.
* @see ucal_getAttribute
@ -457,7 +457,7 @@ ucal_countAvailable(void);
* @see ucal_setDateTime
* @stable
*/
U_CAPI UDate
U_CAPI UDate
ucal_getMillis( const UCalendar* cal,
UErrorCode* status);
@ -472,7 +472,7 @@ ucal_getMillis( const UCalendar* cal,
* @see ucal_setDateTime
* @stable
*/
U_CAPI void
U_CAPI void
ucal_setMillis( UCalendar* cal,
UDate dateTime,
UErrorCode* status );
@ -482,7 +482,7 @@ ucal_setMillis( UCalendar* cal,
* The date is represented as a series of 32-bit integers.
* @param cal The UCalendar to set.
* @param year The desired year.
* @param month The desired month; one of UCAL_JANUARY, UCAL_FEBRUARY, UCAL_MARCH, UCAL_APRIL, UCAL_MAY,
* @param month The desired month; one of UCAL_JANUARY, UCAL_FEBRUARY, UCAL_MARCH, UCAL_APRIL, UCAL_MAY,
* UCAL_JUNE, UCAL_JULY, UCAL_AUGUST, UCAL_SEPTEMBER, UCAL_OCTOBER, UCAL_NOVEMBER, UCAL_DECEMBER, UCAL_UNDECIMBER
* @param date The desired day of the month.
* @param status A pointer to an UErrorCode to receive any errors
@ -491,7 +491,7 @@ ucal_setMillis( UCalendar* cal,
* @see ucal_setDateTime
* @stable
*/
U_CAPI void
U_CAPI void
ucal_setDate( UCalendar* cal,
int32_t year,
int32_t month,
@ -503,7 +503,7 @@ ucal_setDate( UCalendar* cal,
* The date is represented as a series of 32-bit integers.
* @param cal The UCalendar to set.
* @param year The desired year.
* @param month The desired month; one of UCAL_JANUARY, UCAL_FEBRUARY, UCAL_MARCH, UCAL_APRIL, UCAL_MAY,
* @param month The desired month; one of UCAL_JANUARY, UCAL_FEBRUARY, UCAL_MARCH, UCAL_APRIL, UCAL_MAY,
* UCAL_JUNE, UCAL_JULY, UCAL_AUGUST, UCAL_SEPTEMBER, UCAL_OCTOBER, UCAL_NOVEMBER, UCAL_DECEMBER, UCAL_UNDECIMBER
* @param date The desired day of the month.
* @param hour The desired hour of day.
@ -515,7 +515,7 @@ ucal_setDate( UCalendar* cal,
* @see ucal_setDate
* @stable
*/
U_CAPI void
U_CAPI void
ucal_setDateTime( UCalendar* cal,
int32_t year,
int32_t month,
@ -534,7 +534,7 @@ ucal_setDateTime( UCalendar* cal,
* @return TRUE if cal1 and cal2 represent the same date, FALSE otherwise.
* @stable
*/
U_CAPI UBool
U_CAPI UBool
ucal_equivalentTo( const UCalendar* cal1,
const UCalendar* cal2);
@ -542,9 +542,9 @@ ucal_equivalentTo( const UCalendar* cal1,
* Add a specified signed amount to a particular field in a UCalendar.
* This can modify more significant fields in the calendar.
* @param cal The UCalendar to which to add.
* @param field The field to which to add the signed value; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* @param field The field to which to add the signed value; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
* @param amount The signed amount to add to field. If the amount causes the value
* to exceed to maximum or minimum values for that field, other fields are modified
@ -553,7 +553,7 @@ ucal_equivalentTo( const UCalendar* cal1,
* @see ucal_roll
* @stable
*/
U_CAPI void
U_CAPI void
ucal_add( UCalendar* cal,
UCalendarDateFields field,
int32_t amount,
@ -563,9 +563,9 @@ ucal_add( UCalendar* cal,
* Add a specified signed amount to a particular field in a UCalendar.
* This will not modify more significant fields in the calendar.
* @param cal The UCalendar to which to add.
* @param field The field to which to add the signed value; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* @param field The field to which to add the signed value; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
* @param amount The signed amount to add to field. If the amount causes the value
* to exceed to maximum or minimum values for that field, the field is pinned to a permissible
@ -574,7 +574,7 @@ ucal_add( UCalendar* cal,
* @see ucal_add
* @stable
*/
U_CAPI void
U_CAPI void
ucal_roll( UCalendar* cal,
UCalendarDateFields field,
int32_t amount,
@ -584,9 +584,9 @@ ucal_roll( UCalendar* cal,
* Get the current value of a field from a UCalendar.
* All fields are represented as 32-bit integers.
* @param cal The UCalendar to query.
* @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
* @param status A pointer to an UErrorCode to receive any errors
* @return The value of the desired field.
@ -596,7 +596,7 @@ ucal_roll( UCalendar* cal,
* @see ucal_clear
* @stable
*/
U_CAPI int32_t
U_CAPI int32_t
ucal_get( const UCalendar* cal,
UCalendarDateFields field,
UErrorCode* status );
@ -605,9 +605,9 @@ ucal_get( const UCalendar* cal,
* Set the value of a field in a UCalendar.
* All fields are represented as 32-bit integers.
* @param cal The UCalendar to set.
* @param field The field to set; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* @param field The field to set; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
* @param value The desired value of field.
* @see ucal_get
@ -616,7 +616,7 @@ ucal_get( const UCalendar* cal,
* @see ucal_clear
* @stable
*/
U_CAPI void
U_CAPI void
ucal_set( UCalendar* cal,
UCalendarDateFields field,
int32_t value);
@ -625,9 +625,9 @@ ucal_set( UCalendar* cal,
* Determine if a field in a UCalendar is set.
* All fields are represented as 32-bit integers.
* @param cal The UCalendar to query.
* @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
* @param return TRUE if field is set, FALSE otherwise.
* @see ucal_get
@ -636,7 +636,7 @@ ucal_set( UCalendar* cal,
* @see ucal_clear
* @stable
*/
U_CAPI UBool
U_CAPI UBool
ucal_isSet( const UCalendar* cal,
UCalendarDateFields field);
@ -644,9 +644,9 @@ ucal_isSet( const UCalendar* cal,
* Clear a field in a UCalendar.
* All fields are represented as 32-bit integers.
* @param cal The UCalendar containing the field to clear.
* @param field The field to clear; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* @param field The field to clear; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
* @see ucal_get
* @see ucal_set
@ -654,7 +654,7 @@ ucal_isSet( const UCalendar* cal,
* @see ucal_clear
* @stable
*/
U_CAPI void
U_CAPI void
ucal_clearField( UCalendar* cal,
UCalendarDateFields field);
@ -668,7 +668,7 @@ ucal_clearField( UCalendar* cal,
* @see ucal_clearField
* @stable
*/
U_CAPI void
U_CAPI void
ucal_clear(UCalendar* calendar);
/** Possible limit values for a UCalendar */
@ -692,17 +692,17 @@ typedef enum UCalendarLimitType UCalendarLimitType;
* Determine a limit for a field in a UCalendar.
* A limit is a maximum or minimum value for a field.
* @param cal The UCalendar to query.
* @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
* UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
* UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
* UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
* @param type The desired critical point; one of UCAL_MINIMUM, UCAL_MAXIMUM, UCAL_GREATEST_MINIMUM,
* @param type The desired critical point; one of UCAL_MINIMUM, UCAL_MAXIMUM, UCAL_GREATEST_MINIMUM,
* UCAL_LEAST_MAXIMUM, UCAL_ACTUAL_MINIMUM, UCAL_ACTUAL_MAXIMUM
* @param status A pointer to an UErrorCode to receive any errors.
* @return The requested value.
* @stable
*/
U_CAPI int32_t
U_CAPI int32_t
ucal_getLimit( const UCalendar* cal,
UCalendarDateFields field,
UCalendarLimitType type,

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright © {1996-2001}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) 1996-2001, International Business Machines Corporation and others. All Rights Reserved.
*******************************************************************************
*/
@ -12,7 +12,7 @@
#include "unicode/unum.h"
/**
* \file
* \brief C API: DateFormat
* \brief C API: DateFormat
*
* <h2> Date Format C API</h2>
*
@ -28,7 +28,7 @@
* be completely independent of the locale conventions for months, days of the
* week, or even the calendar format: lunar vs. solar.
* <P>
* To format a date for the current Locale with default time and date style,
* To format a date for the current Locale with default time and date style,
* use one of the static factory methods:
* <pre>
* \code
@ -76,12 +76,12 @@
* <pre>
* \code
* UErrorCode status = U_ZERO_ERROR;
* int32_t parsepos=0;
* int32_t parsepos=0;
* UDate myDate = udat_parse(df, myString, u_strlen(myString), &parsepos, &status);
* \endcode
* </pre>
* You can pass in different options for the arguments for date and time style
* to control the length of the result; from SHORT to MEDIUM to LONG to FULL.
* You can pass in different options for the arguments for date and time style
* to control the length of the result; from SHORT to MEDIUM to LONG to FULL.
* The exact result depends on the locale, but generally:
* see UDateFormatStyle for more details
* <ul type=round>
@ -91,7 +91,7 @@
* <li> UDAT_FULL is pretty completely specified, such as
* Tuesday, April 12, 1952 AD or 3:30:42pm PST.
* </ul>
* You can also set the time zone on the format if you wish.
* You can also set the time zone on the format if you wish.
* <P>
* You can also use forms of the parse and format methods with Parse Position and
* UFieldPosition to allow you to
@ -128,9 +128,9 @@ typedef enum UDateFormatStyle UDateFormatStyle;
* Open a new UDateFormat for formatting and parsing dates and times.
* A UDateFormat may be used to format dates in calls to \Ref{udat_format},
* and to parse dates in calls to \Ref{udat_parse}.
* @param timeStyle The style used to format times; one of UDAT_FULL_STYLE, UDAT_LONG_STYLE,
* @param timeStyle The style used to format times; one of UDAT_FULL_STYLE, UDAT_LONG_STYLE,
* UDAT_MEDIUM_STYLE, UDAT_SHORT_STYLE, or UDAT_DEFAULT_STYLE
* @param dateStyle The style used to format dates; one of UDAT_FULL_STYLE, UDAT_LONG_STYLE,
* @param dateStyle The style used to format dates; one of UDAT_FULL_STYLE, UDAT_LONG_STYLE,
* UDAT_MEDIUM_STYLE, UDAT_SHORT_STYLE, or UDAT_DEFAULT_STYLE
* @param locale The locale specifying the formatting conventions
* @param tzID A timezone ID specifying the timezone to use. If 0, use
@ -143,7 +143,7 @@ typedef enum UDateFormatStyle UDateFormatStyle;
* @draft
*/
U_CAPI UDateFormat*
udat_open(UDateFormatStyle timeStyle,
udat_open(UDateFormatStyle timeStyle,
UDateFormatStyle dateStyle,
const char *locale,
const UChar *tzID,
@ -164,7 +164,7 @@ udat_open(UDateFormatStyle timeStyle,
* @draft
*/
U_CAPI UDateFormat*
udat_openPattern( const UChar *pattern,
udat_openPattern( const UChar *pattern,
int32_t patternLength,
const char *locale,
UErrorCode *status);
@ -240,8 +240,8 @@ udat_parse( const UDateFormat* format,
/**
* Determine if an UDateFormat will perform lenient parsing.
* With lenient parsing, the parser may use heuristics to interpret inputs that do not
* precisely match the pattern. With strict parsing, inputs must match the pattern.
* With lenient parsing, the parser may use heuristics to interpret inputs that do not
* precisely match the pattern. With strict parsing, inputs must match the pattern.
* @param fmt The formatter to query
* @return TRUE if fmt is set to perform lenient parsing, FALSE otherwise.
* @see udat_setLenient
@ -252,8 +252,8 @@ udat_isLenient(const UDateFormat* fmt);
/**
* Specify whether an UDateFormat will perform lenient parsing.
* With lenient parsing, the parser may use heuristics to interpret inputs that do not
* precisely match the pattern. With strict parsing, inputs must match the pattern.
* With lenient parsing, the parser may use heuristics to interpret inputs that do not
* precisely match the pattern. With strict parsing, inputs must match the pattern.
* @param fmt The formatter to set
* @param isLenient TRUE if fmt should perform lenient parsing, FALSE otherwise.
* @see dat_isLenient
@ -419,7 +419,7 @@ enum UDateFormatSymbolType {
};
typedef enum UDateFormatSymbolType UDateFormatSymbolType;
/** Date format symbols.
/** Date format symbols.
* For usage in C programs.
*/
struct UDateFormatSymbols;
@ -430,7 +430,7 @@ typedef struct UDateFormatSymbols UDateFormatSymbols;
* The symbols are what a UDateFormat uses to represent locale-specific data,
* for example month or day names.
* @param fmt The formatter to query.
* @param type The type of symbols to get. One of UDAT_ERAS, UDAT_MONTHS, UDAT_SHORT_MONTHS,
* @param type The type of symbols to get. One of UDAT_ERAS, UDAT_MONTHS, UDAT_SHORT_MONTHS,
* UDAT_WEEKDAYS, UDAT_SHORT_WEEKDAYS, UDAT_AM_PMS, or UDAT_LOCALIZED_CHARS
* @param index The desired symbol of type type.
* @param result A pointer to a buffer to receive the pattern.
@ -454,7 +454,7 @@ udat_getSymbols(const UDateFormat *fmt,
* This function is most useful as for detemining the loop termination condition
* for calls to \Ref{udat_getSymbols}.
* @param fmt The formatter to query.
* @param type The type of symbols to count. One of UDAT_ERAS, UDAT_MONTHS, UDAT_SHORT_MONTHS,
* @param type The type of symbols to count. One of UDAT_ERAS, UDAT_MONTHS, UDAT_SHORT_MONTHS,
* UDAT_WEEKDAYS, UDAT_SHORT_WEEKDAYS, UDAT_AM_PMS, or UDAT_LOCALIZED_CHARS
* @return The number of symbols of type type.
* @see udat_getSymbols
@ -470,7 +470,7 @@ udat_countSymbols( const UDateFormat *fmt,
* The symbols are what a UDateFormat uses to represent locale-specific data,
* for example month or day names.
* @param fmt The formatter to set
* @param type The type of symbols to set. One of UDAT_ERAS, UDAT_MONTHS, UDAT_SHORT_MONTHS,
* @param type The type of symbols to set. One of UDAT_ERAS, UDAT_MONTHS, UDAT_SHORT_MONTHS,
* UDAT_WEEKDAYS, UDAT_SHORT_WEEKDAYS, UDAT_AM_PMS, or UDAT_LOCALIZED_CHARS
* @param index The index of the symbol to set of type type.
* @param value The new value

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright © {1996-2001}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) 1996-2001, International Business Machines Corporation and others. All Rights Reserved.
*******************************************************************************
*/
@ -11,7 +11,7 @@
#include <stdarg.h>
/**
* \file
* \brief C API: MessageFormat
* \brief C API: MessageFormat
*
* <h2>Message Format C API </h2>
*
@ -52,7 +52,7 @@
* printf("%s\n", austrdup(result) );//austrdup( a function used to convert UChar* to char*)
* //output>: "On March 18, 1999, there was a disturbance in force on planet 7
* \endcode
* </pre>
* </pre>
* Typically, the message format will come from resources, and the
* arguments will be dynamically set at runtime.
* <P>
@ -100,25 +100,25 @@
* <pre>
* \code
* messageFormatPattern := string ( "{" messageFormatElement "}" string )*
*
*
* messageFormatElement := argument { "," elementFormat }
*
*
* elementFormat := "time" { "," datetimeStyle }
* | "date" { "," datetimeStyle }
* | "number" { "," numberStyle }
* | "choice" "," choiceStyle
*
*
* datetimeStyle := "short"
* | "medium"
* | "long"
* | "full"
* | dateFormatPattern
*
*
* numberStyle := "currency"
* | "percent"
* | "integer"
* | numberFormatPattern
*
*
* choiceStyle := choiceFormatPattern
* \endcode
* </pre>
@ -146,18 +146,18 @@
* arguments or arguments that are not of the right class for the
* specified format, a failing UErrorCode result is set.
* <P>
* <P>
* [Note:] As we see above, the string produced by a choice Format in
* MessageFormat is treated specially; occurances of '{' are used to
* indicated subformats.
* indicated subformats.
* <P>
* [Note:] Formats are numbered by order of variable in the string.
* This is [not] the same as the argument numbering!
* <pre>
* \code
* For example: with "abc{2}def{3}ghi{0}...",
*
*
* format0 affects the first variable {2}
* format1 affects the second variable {3}
* format2 affects the second variable {0}
@ -179,7 +179,7 @@
* @param status A pointer to an UErrorCode to receive any errors
* @param ... A variable-length argument list containing the arguments specified
* in pattern.
* @return The total buffer size needed; if greater than resultLength, the
* @return The total buffer size needed; if greater than resultLength, the
* output was truncated.
* @see u_parseMessage
* @draft should this just be usprintf?
@ -192,7 +192,7 @@ u_formatMessage( const char *locale,
int32_t resultLength,
UErrorCode *status,
...);
/**
* Format a message for a locale.
* This function may perform re-ordering of the arguments depending on the
@ -206,7 +206,7 @@ u_formatMessage( const char *locale,
* @param ap A variable-length argument list containing the arguments specified
* @param status A pointer to an UErrorCode to receive any errors
* in pattern.
* @return The total buffer size needed; if greater than resultLength, the
* @return The total buffer size needed; if greater than resultLength, the
* output was truncated.
* @see u_parseMessage
*/
@ -221,7 +221,7 @@ u_vformatMessage( const char *locale,
/**
* Parse a message.
* For numeric arguments, this function will always use doubles. Integer types
* should not be passed.
* should not be passed.
* This function is not able to parse all output from \Ref{u_formatMessage}.
* @param locale The locale for which the message is formatted
* @param pattern The pattern specifying the message's format
@ -234,7 +234,7 @@ u_vformatMessage( const char *locale,
* @see u_formatMessage
* @draft
*/
U_CAPI void
U_CAPI void
u_parseMessage( const char *locale,
const UChar *pattern,
int32_t patternLength,
@ -246,7 +246,7 @@ u_parseMessage( const char *locale,
/**
* Parse a message.
* For numeric arguments, this function will always use doubles. Integer types
* should not be passed.
* should not be passed.
* This function is not able to parse all output from \Ref{u_formatMessage}.
* @param locale The locale for which the message is formatted
* @param pattern The pattern specifying the message's format
@ -258,7 +258,7 @@ u_parseMessage( const char *locale,
* specified in pattern.
* @see u_formatMessage
*/
U_CAPI void
U_CAPI void
u_vparseMessage( const char *locale,
const UChar *pattern,
int32_t patternLength,

View file

@ -1,5 +1,5 @@
/*
* Copyright © {1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) 1999, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 11/17/99 aliu Creation.
@ -24,7 +24,7 @@ class U_I18N_API UnicodeFilter {
public:
/**
* Destructor
* Destructor
* @draft */
virtual ~UnicodeFilter();

View file

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright © {1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) 1999, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 11/17/99 aliu Creation.

View file

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright © {1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) 1999, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 10/20/99 alan Creation.
@ -207,28 +207,28 @@ class TransliterationRule;
* Mn = Mark, Non-Spacing
* Mc = Mark, Spacing Combining
* Me = Mark, Enclosing
*
*
* Nd = Number, Decimal Digit
* Nl = Number, Letter
* No = Number, Other
*
*
* Zs = Separator, Space
* Zl = Separator, Line
* Zp = Separator, Paragraph
*
*
* Cc = Other, Control
* Cf = Other, Format
* Cs = Other, Surrogate
* Co = Other, Private Use
* Cn = Other, Not Assigned
*
*
* Informative
* Lu = Letter, Uppercase
* Ll = Letter, Lowercase
* Lt = Letter, Titlecase
* Lm = Letter, Modifier
* Lo = Letter, Other
*
*
* Pc = Punctuation, Connector
* Pd = Punctuation, Dash
* Ps = Punctuation, Open
@ -236,7 +236,7 @@ class TransliterationRule;
* Pi = Punctuation, Initial quote
* Pf = Punctuation, Final quote
* Po = Punctuation, Other
*
*
* Sm = Symbol, Math
* Sc = Symbol, Currency
* Sk = Symbol, Modifier
@ -276,7 +276,7 @@ class U_I18N_API UnicodeSet : public UnicodeFilter {
* ":]". Example: "[:Lu:]".
*/
static const UnicodeString CATEGORY_CLOSE;
// More special characters...
static const UChar SET_OPEN;
static const UChar SET_CLOSE;
@ -286,7 +286,7 @@ class U_I18N_API UnicodeSet : public UnicodeFilter {
static const UChar BACKSLASH;
static const UChar INTERSECTION;
static const UChar UPPER_U;
public:
/**
@ -521,7 +521,7 @@ public:
* The set will not contain the specified range once the call
* returns. If <code>end > start</code> then an empty range is
* removed, leaving the set unchanged.
*
*
* @param start first character, inclusive, of range to be removed
* from this set.
* @param end last character, inclusive, of range to be removed
@ -775,13 +775,13 @@ private:
static UChar charAfter(const UnicodeString& str, int32_t i);
void ensureCapacity(int32_t newLen);
void ensureBufferCapacity(int32_t newLen);
void swapBuffers(void);
static const UChar HEX[16];
static void _toPat(UnicodeString& buf, UChar32 c);
//----------------------------------------------------------------
@ -789,9 +789,9 @@ private:
//----------------------------------------------------------------
void exclusiveOr(const UChar32* other, int32_t otherLen, int8_t polarity);
void add(const UChar32* other, int32_t otherLen, int8_t polarity);
void retain(const UChar32* other, int32_t otherLen, int8_t polarity);
};

View file

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright © {1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) 1999, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 11/17/99 aliu Creation.
@ -15,7 +15,7 @@
class UnicodeFilter;
/**
* A transliterator that converts from Unicode characters to
* A transliterator that converts from Unicode characters to
* hexadecimal Unicode escape sequences. It outputs a
* prefix specified in the constructor and optionally converts the hex
* digits to uppercase.

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright © {1997-2001}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) 1997-2001, International Business Machines Corporation and others. All Rights Reserved.
* Modification History:
*
* Date Name Description
@ -30,7 +30,7 @@
* for decimal points, thousands-separators, or even the particular
* decimal digits used, or whether the number format is even decimal.
* There are different number format styles like decimal, currency,
* percent and spellout.
* percent and spellout.
* <P>
* To format a number for the current Locale, use one of the static
* factory methods:
@ -104,11 +104,11 @@
* </ul>
* <p>
* It is also possible to change or set the symbols used for a particular
* locale like the currency symbol, the grouping seperator , monetary seperator
* locale like the currency symbol, the grouping seperator , monetary seperator
* etc by making use of functions unum_setSymbols() and unum_getSymbols().
*/
/** A number formatter.
/** A number formatter.
* For usage in C programs.
*/
typedef void* UNumberFormat;
@ -342,7 +342,7 @@ U_CAPI int32_t
unum_countAvailable(void);
/** The possible UNumberFormat numeric attributes */
enum UNumberFormatAttribute {
enum UNumberFormatAttribute {
/** Parse integers only */
UNUM_PARSE_INT_ONLY,
/** Use grouping separator */
@ -382,8 +382,8 @@ typedef enum UNumberFormatAttribute UNumberFormatAttribute;
======================================================
---> Add to UErrorCode !!!! --->
typedef enum {
AttributeNotSupported,
PropertyNotSupported
AttributeNotSupported,
PropertyNotSupported
} UErrorCode;
---> Add to UErrorCode !!!! --->
======================================================
@ -393,9 +393,9 @@ typedef enum {
* Get a numeric attribute associated with a UNumberFormat.
* An example of a numeric attribute is the number of integer digits a formatter will produce.
* @param fmt The formatter to query.
* @param attr The attribute to query; one of UNUM_PARSE_INT_ONLY, UNUM_GROUPING_USED,
* @param attr The attribute to query; one of UNUM_PARSE_INT_ONLY, UNUM_GROUPING_USED,
* UNUM_DECIMAL_ALWAYS_SHOWN, UNUM_MAX_INTEGER_DIGITS, UNUM_MIN_INTEGER_DIGITS, UNUM_INTEGER_DIGITS,
* UNUM_MAX_FRACTION_DIGITS, UNUM_MIN_FRACTION_DIGITS, UNUM_FRACTION_DIGITS, UNUM_MULTIPLIER,
* UNUM_MAX_FRACTION_DIGITS, UNUM_MIN_FRACTION_DIGITS, UNUM_FRACTION_DIGITS, UNUM_MULTIPLIER,
* UNUM_GROUPING_SIZE, UNUM_ROUNDING_MODE, UNUM_FORMAT_WIDTH, UNUM_PADDING_POSITION, UNUM_SECONDARY_GROUPING_SIZE.
* @return The value of attr.
* @see unum_setAttribute
@ -413,9 +413,9 @@ unum_getAttribute(const UNumberFormat* fmt,
* Set a numeric attribute associated with a UNumberFormat.
* An example of a numeric attribute is the number of integer digits a formatter will produce.
* @param fmt The formatter to set.
* @param attr The attribute to set; one of UNUM_PARSE_INT_ONLY, UNUM_GROUPING_USED,
* @param attr The attribute to set; one of UNUM_PARSE_INT_ONLY, UNUM_GROUPING_USED,
* UNUM_DECIMAL_ALWAYS_SHOWN, UNUM_MAX_INTEGER_DIGITS, UNUM_MIN_INTEGER_DIGITS, UNUM_INTEGER_DIGITS,
* UNUM_MAX_FRACTION_DIGITS, UNUM_MIN_FRACTION_DIGITS, UNUM_FRACTION_DIGITS, UNUM_MULTIPLIER,
* UNUM_MAX_FRACTION_DIGITS, UNUM_MIN_FRACTION_DIGITS, UNUM_FRACTION_DIGITS, UNUM_MULTIPLIER,
* UNUM_GROUPING_SIZE, UNUM_ROUNDING_MODE, UNUM_FORMAT_WIDTH, UNUM_PADDING_POSITION, UNUM_SECONDARY_GROUPING_SIZE.
* @param newValue The new value of attr.
* @see unum_getAttribute
@ -485,7 +485,7 @@ typedef enum UNumberFormatTextAttribute UNumberFormatTextAttribute;
* Get a text attribute associated with a UNumberFormat.
* An example of a text attribute is the suffix for positive numbers.
* @param fmt The formatter to query.
* @param attr The attribute to query; one of UNUM_POSITIVE_PREFIX, UNUM_POSITIVE_SUFFIX,
* @param attr The attribute to query; one of UNUM_POSITIVE_PREFIX, UNUM_POSITIVE_SUFFIX,
* UNUM_NEGATIVE_PREFIX, UNUM_NEGATIVE_SUFFIX
* @param result A pointer to a buffer to receive the attribute.
* @param resultLength The maximum size of result.
@ -507,7 +507,7 @@ unum_getTextAttribute( const UNumberFormat* fmt,
* Set a text attribute associated with a UNumberFormat.
* An example of a text attribute is the suffix for positive numbers.
* @param fmt The formatter to set.
* @param attr The attribute to set; one of UNUM_POSITIVE_PREFIX, UNUM_POSITIVE_SUFFIX,
* @param attr The attribute to set; one of UNUM_POSITIVE_PREFIX, UNUM_POSITIVE_SUFFIX,
* UNUM_NEGATIVE_PREFIX, UNUM_NEGATIVE_SUFFIX
* @param newValue The new value of attr.
* @param newValueLength The length of newValue, or -1 if null-terminated.
@ -545,7 +545,7 @@ unum_toPattern( const UNumberFormat* fmt,
/* The maximum size for a textual number format symbol. */
#define UNFSYMBOLSMAXSIZE 10
/** The UNumberFormatSymbols struct
/** The UNumberFormatSymbols struct
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
*/
struct UNumberFormatSymbols{
@ -572,7 +572,7 @@ struct UNumberFormatSymbols{
/** The monetary separator */
UChar monetarySeparator;
/** The exponential symbol */
UChar exponential;
UChar exponential;
/** Per mill symbol */
UChar perMill;
/** Escape padding character */
@ -580,13 +580,13 @@ struct UNumberFormatSymbols{
/** Infinity symbol */
UChar infinity [UNFSYMBOLSMAXSIZE];
/** Nan symbol */
UChar naN [UNFSYMBOLSMAXSIZE];
UChar naN [UNFSYMBOLSMAXSIZE];
};
typedef struct UNumberFormatSymbols UNumberFormatSymbols;
/**
* Get the symbols associated with a UNumberFormat.
* A UNumberFormat uses symbols to represent the special locale-dependent
* A UNumberFormat uses symbols to represent the special locale-dependent
* characters in a number, for example the percent sign.
* @param fmt The formatter to query.
* @param syms A pointer to a UNumberFormatSymbols to receive the symbols associated with fmt.
@ -599,7 +599,7 @@ unum_getSymbols( const UNumberFormat *fmt,
/**
* Set the symbols associated with a UNumberFormat.
* A UNumberFormat uses symbols to represent the special locale-dependent
* A UNumberFormat uses symbols to represent the special locale-dependent
* characters in a number, for example the percent sign.
* @param fmt The formatter to set.
* @param symbolsToSet The UNumberFormatSymbols to associate with fmt.
@ -656,7 +656,7 @@ typedef enum UNumberFormatSymbol UNumberFormatSymbol;
/**
* Get a symbol associated with a UNumberFormat.
* A UNumberFormat uses symbols to represent the special locale-dependent
* A UNumberFormat uses symbols to represent the special locale-dependent
* characters in a number, for example the percent sign.
* @param fmt The formatter to query.
* @param symbol The UNumberFormatSymbol constant for the symbol to get
@ -677,7 +677,7 @@ unum_getSymbol(UNumberFormat *fmt,
/**
* Set a symbol associated with a UNumberFormat.
* A UNumberFormat uses symbols to represent the special locale-dependent
* A UNumberFormat uses symbols to represent the special locale-dependent
* characters in a number, for example the percent sign.
* @param fmt The formatter to set.
* @param symbol The UNumberFormatSymbol constant for the symbol to set

View file

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright © {1999}, International Business Machines Corporation and others. All Rights Reserved.
* Copyright (C) {1999}, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 11/17/99 aliu Creation.