ICU-6 change enum constants that do not conform to our naming conventions
X-SVN-Rev: 18
This commit is contained in:
parent
80a098923f
commit
b942cae860
@ -146,7 +146,7 @@ inline BiDi::BiDi(UErrorCode &rErrorCode) {
|
||||
if(SUCCESS(rErrorCode)) {
|
||||
pBiDi=ubidi_open();
|
||||
if(pBiDi==0) {
|
||||
rErrorCode=MEMORY_ALLOCATION_ERROR;
|
||||
rErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
} else {
|
||||
pBiDi=0;
|
||||
|
@ -29,7 +29,7 @@ extern "C" {
|
||||
|
||||
UnicodeConverterCPP::UnicodeConverterCPP()
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
myUnicodeConverter = ucnv_open(NULL, &err);
|
||||
}
|
||||
UnicodeConverterCPP::UnicodeConverterCPP(const char* name, UErrorCode& err)
|
||||
@ -126,7 +126,7 @@ UnicodeConverterCPP::fromUnicodeString(char* target,
|
||||
|
||||
if ((myUnicodeConverter == NULL) || source.isBogus() || (targetSize <= 0))
|
||||
{
|
||||
err = ILLEGAL_ARGUMENT_ERROR;
|
||||
err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ UnicodeConverterCPP::toUnicodeString(UnicodeString& target,
|
||||
if (FAILURE(err)) return;
|
||||
if ((myUnicodeConverter == NULL) || target.isBogus() || (sourceSize <= 0))
|
||||
{
|
||||
err = ILLEGAL_ARGUMENT_ERROR;
|
||||
err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ UnicodeConverterCPP::toUnicodeString(UnicodeString& target,
|
||||
|
||||
if (myTargetUChars == NULL)
|
||||
{
|
||||
err = MEMORY_ALLOCATION_ERROR;
|
||||
err = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
/*renders the target clean*/
|
||||
@ -197,7 +197,7 @@ UnicodeConverterCPP::toUnicodeString(UnicodeString& target,
|
||||
*/
|
||||
do
|
||||
{
|
||||
err = ZERO_ERROR;
|
||||
err = U_ZERO_ERROR;
|
||||
myTargetUCharsAlias = myTargetUChars;
|
||||
ucnv_toUnicode(&myConverter,
|
||||
&myTargetUCharsAlias,
|
||||
@ -214,8 +214,8 @@ UnicodeConverterCPP::toUnicodeString(UnicodeString& target,
|
||||
myTargetUChars,
|
||||
myTargetUCharsAlias - myTargetUChars);
|
||||
/*Checks for the integrity of target (UnicodeString) as it adds data to it*/
|
||||
if (target.isBogus()) err = MEMORY_ALLOCATION_ERROR;
|
||||
} while (err == INDEX_OUTOFBOUNDS_ERROR);
|
||||
if (target.isBogus()) err = U_MEMORY_ALLOCATION_ERROR;
|
||||
} while (err == U_INDEX_OUTOFBOUNDS_ERROR);
|
||||
|
||||
|
||||
icu_free(myTargetUChars);
|
||||
@ -352,7 +352,7 @@ UnicodeConverterCPP::getDisplayName(const Locale& displayLocale,
|
||||
UnicodeString& displayName) const
|
||||
{
|
||||
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
ResourceBundle rb("", displayLocale, err);
|
||||
char tablename[MAX_CONVERTER_NAME_LENGTH];
|
||||
|
||||
@ -406,6 +406,3 @@ int32_t UnicodeConverterCPP::flushCache()
|
||||
{
|
||||
return ucnv_flushCache();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@ class U_COMMON_API UnicodeConverterCPP
|
||||
* @param code_set the pointer to a char[] object containing a codepage name. (I)
|
||||
* @param UErrorCode Error status (I/O) IILLEGAL_ARGUMENT_ERROR will be returned if the string is empty.
|
||||
* If the internal program does not work correctly, for example, if there's no such codepage,
|
||||
* INTERNAL_PROGRAM_ERROR will be returned.
|
||||
* U_INTERNAL_PROGRAM_ERROR will be returned.
|
||||
* @return An object Handle if successful or a NULL if the creation failed
|
||||
*/
|
||||
UnicodeConverterCPP(const char* name,
|
||||
@ -51,7 +51,7 @@ class U_COMMON_API UnicodeConverterCPP
|
||||
*search.
|
||||
*@param code_set name of the uconv table in Unicode string (I)
|
||||
*@param err error status (I/O) IILLEGAL_ARGUMENT_ERROR will be returned if the string is empty. If the internal
|
||||
*program does not work correctly, for example, if there's no such codepage, INTERNAL_PROGRAM_ERROR will be
|
||||
*program does not work correctly, for example, if there's no such codepage, U_INTERNAL_PROGRAM_ERROR will be
|
||||
*returned.
|
||||
*@return the created Unicode converter object
|
||||
*/
|
||||
@ -63,7 +63,7 @@ class U_COMMON_API UnicodeConverterCPP
|
||||
* @param code_set a codepage # (I)
|
||||
* @UErrorCode Error status (I/O) IILLEGAL_ARGUMENT_ERROR will be returned if the string is empty.
|
||||
* If the internal program does not work correctly, for example, if there's no such codepage,
|
||||
* INTERNAL_PROGRAM_ERROR will be returned.
|
||||
* U_INTERNAL_PROGRAM_ERROR will be returned.
|
||||
* @return An object Handle if successful or a NULL if failed
|
||||
*
|
||||
*/
|
||||
@ -83,8 +83,8 @@ class U_COMMON_API UnicodeConverterCPP
|
||||
* @param source the source Unicode string
|
||||
* @param target the target string in codepage encoding
|
||||
* @param targetSize Input the number of bytes available in the "target" buffer, Output the number of bytes copied to it
|
||||
* @param err the error status code. MEMORY_ALLOCATION_ERROR will be returned if the
|
||||
* the internal process buffer cannot be allocated for transcoding. ILLEGAL_ARGUMENT_ERROR
|
||||
* @param err the error status code. U_MEMORY_ALLOCATION_ERROR will be returned if the
|
||||
* the internal process buffer cannot be allocated for transcoding. U_ILLEGAL_ARGUMENT_ERROR
|
||||
* is returned if the converter is null or the source or target string is empty.
|
||||
*/
|
||||
void fromUnicodeString(char* target,
|
||||
@ -100,8 +100,8 @@ void fromUnicodeString(char* target,
|
||||
* @param source the source string in codepage encoding
|
||||
* @param target the target string in Unicode encoding
|
||||
* @param targetSize : I/O parameter, Input size buffer, Output # of bytes copied to it
|
||||
* @param err the error status code MEMORY_ALLOCATION_ERROR will be returned if the
|
||||
* the internal process buffer cannot be allocated for transcoding. ILLEGAL_ARGUMENT_ERROR
|
||||
* @param err the error status code U_MEMORY_ALLOCATION_ERROR will be returned if the
|
||||
* the internal process buffer cannot be allocated for transcoding. U_ILLEGAL_ARGUMENT_ERROR
|
||||
* is returned if the converter is null or the source or target string is empty.
|
||||
*/
|
||||
void toUnicodeString(UnicodeString& target,
|
||||
@ -125,7 +125,7 @@ void toUnicodeString(UnicodeString& target,
|
||||
* @param sourceLimit the pointer to the end of the source array
|
||||
* @param flush TRUE if the buffer is the last buffer and the conversion will finish
|
||||
* in this call, FALSE otherwise. (future feature pending)
|
||||
* @param UErrorCode the error status. ILLEGAL_ARGUMENT_ERROR will be returned if the
|
||||
* @param UErrorCode the error status. U_ILLEGAL_ARGUMENT_ERROR will be returned if the
|
||||
* converter is null.
|
||||
*/
|
||||
void fromUnicode(char*& target,
|
||||
@ -152,7 +152,7 @@ void fromUnicode(char*& target,
|
||||
* @param sourceLimit the pointer to the end of the source array
|
||||
* @param flush TRUE if the buffer is the last buffer and the conversion will finish
|
||||
* in this call, FALSE otherwise. (future feature pending)
|
||||
* @param err the error code status ILLEGAL_ARGUMENT_ERROR will be returned if the
|
||||
* @param err the error code status U_ILLEGAL_ARGUMENT_ERROR will be returned if the
|
||||
* converter is null, targetLimit < target, sourceLimit < source
|
||||
*/
|
||||
void toUnicode(UChar*& target,
|
||||
@ -186,7 +186,7 @@ UCNV_TYPE getType(void) const;
|
||||
|
||||
/**
|
||||
*Gets the "starter" bytes for the converters of type MBCS
|
||||
*will fill in an <TT>ILLEGAL_ARGUMENT_ERROR</TT> if converter passed in
|
||||
*will fill in an <TT>U_ILLEGAL_ARGUMENT_ERROR</TT> if converter passed in
|
||||
*is not MBCS.
|
||||
*fills in an array of boolean, with the value of the byte as offset to the array.
|
||||
*At return, if TRUE is found in at offset 0x20, it means that the byte 0x20 is a starter byte
|
||||
@ -202,9 +202,9 @@ UCNV_TYPE getType(void) const;
|
||||
* as multiple bytes.
|
||||
* @param subChars the subsitution characters
|
||||
* @param len the number of bytes of the substitution character array
|
||||
* @param err the error status code. ILLEGAL_ARGUMENT_ERROR will be returned if
|
||||
* @param err the error status code. U_ILLEGAL_ARGUMENT_ERROR will be returned if
|
||||
* the converter is null. If the substitution character array is too small, an
|
||||
* INDEX_OUTOFBOUNDS_ERROR will be returned.
|
||||
* U_INDEX_OUTOFBOUNDS_ERROR will be returned.
|
||||
*/
|
||||
void getSubstitutionChars(char* subChars,
|
||||
int8_t& len,
|
||||
@ -216,7 +216,7 @@ void getSubstitutionChars(char* subChars,
|
||||
* @param cstr the substitution character array to be set with
|
||||
* @param len the number of bytes of the substitution character array and upon return will contain the
|
||||
* number of bytes copied to that buffer
|
||||
* @param err the error status code. ILLEGAL_ARGUMENT_ERROR if the converter is
|
||||
* @param err the error status code. U_ILLEGAL_ARGUMENT_ERROR if the converter is
|
||||
* null. or if the number of bytes provided are not in the codepage's range (e.g length 1 for ucs-2)
|
||||
*/
|
||||
void setSubstitutionChars(const char* subChars,
|
||||
@ -233,7 +233,7 @@ void resetState(void);
|
||||
* Gets the name of the converter (zero-terminated).
|
||||
* the name will be the internal name of the converter
|
||||
* @param converter the Unicode converter
|
||||
* @param err the error status code. INDEX_OUTOFBOUNDS_ERROR in the converterNameLen is too
|
||||
* @param err the error status code. U_INDEX_OUTOFBOUNDS_ERROR in the converterNameLen is too
|
||||
* small to contain the name.
|
||||
*/
|
||||
const char* getName( UErrorCode& err) const;
|
||||
@ -244,7 +244,7 @@ const char* getName( UErrorCode& err) const;
|
||||
* to be the one used to create the converter. Some converters do not represent
|
||||
* IBM registered codepages and return zero for the codepage number.
|
||||
* The error code fill-in parameter indicates if the codepage number is available.
|
||||
* @param err the error status code. ILLEGAL_ARGUMENT_ERROR will returned if
|
||||
* @param err the error status code. U_ILLEGAL_ARGUMENT_ERROR will returned if
|
||||
* the converter is null or if converter's data table is null.
|
||||
* @return If any error occurrs, null will be returned.
|
||||
*/
|
||||
@ -320,15 +320,5 @@ static const char* const* getAvailableNames(int32_t& num,
|
||||
* @return the number of cached converters successfully deleted
|
||||
*/
|
||||
static int32_t flushCache(void);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -28,11 +28,7 @@ void T_fillOutputParams(const UnicodeString* temp,
|
||||
if (resultLengthOut) {
|
||||
*resultLengthOut = actual;
|
||||
if (SUCCESS(*status) && overflowed) {
|
||||
*status = BUFFER_OVERFLOW_ERROR;
|
||||
*status = U_BUFFER_OVERFLOW_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -259,7 +259,7 @@ Locale::operator==( const Locale& other) const
|
||||
Locale& Locale::init(const char* localeID)
|
||||
{
|
||||
int k,l;
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
||||
if (localeID == NULL) localeID = uloc_getDefault();
|
||||
l = uloc_getLanguage(localeID,
|
||||
@ -431,7 +431,7 @@ Locale::getISO3Language(UnicodeString& lang, UErrorCode& status) const
|
||||
|
||||
lang = uloc_getISO3Language(fullName);
|
||||
if (lang.size() == 0)
|
||||
status = MISSING_RESOURCE_ERROR;
|
||||
status = U_MISSING_RESOURCE_ERROR;
|
||||
|
||||
return lang;
|
||||
}
|
||||
@ -452,7 +452,7 @@ Locale::getISO3Country(UnicodeString& cntry, UErrorCode& status) const
|
||||
|
||||
cntry = uloc_getISO3Country(fullName);
|
||||
if (cntry.size() == 0)
|
||||
status = MISSING_RESOURCE_ERROR;
|
||||
status = U_MISSING_RESOURCE_ERROR;
|
||||
|
||||
return cntry;
|
||||
}
|
||||
@ -486,7 +486,7 @@ UnicodeString&
|
||||
Locale::getDisplayLanguage( const Locale& inLocale,
|
||||
UnicodeString& dispLang) const
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar bufBuffer[BUFFER_SIZE];
|
||||
UChar* buf = bufBuffer;
|
||||
|
||||
@ -499,9 +499,9 @@ Locale::getDisplayLanguage( const Locale& inLocale,
|
||||
&status);
|
||||
|
||||
|
||||
if (status == BUFFER_OVERFLOW_ERROR)
|
||||
if (status == U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
buf = new UChar[size];
|
||||
|
||||
uloc_getDisplayLanguage(fullName,
|
||||
@ -529,7 +529,7 @@ UnicodeString&
|
||||
Locale::getDisplayCountry( const Locale& inLocale,
|
||||
UnicodeString& dispCntry) const
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar bufBuffer[BUFFER_SIZE];
|
||||
UChar* buf = bufBuffer;
|
||||
|
||||
@ -540,9 +540,9 @@ Locale::getDisplayCountry( const Locale& inLocale,
|
||||
BUFFER_SIZE,
|
||||
&status);
|
||||
|
||||
if (status == BUFFER_OVERFLOW_ERROR)
|
||||
if (status == U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
buf = new UChar[size];
|
||||
uloc_getDisplayCountry(fullName,
|
||||
inLocale.fullName,
|
||||
@ -571,7 +571,7 @@ Locale::getDisplayVariant(UnicodeString& dispVar) const
|
||||
UnicodeString& Locale::getDisplayVariant(const Locale& inLocale,
|
||||
UnicodeString& dispVar) const
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar bufBuffer[BUFFER_SIZE];
|
||||
UChar* buf = bufBuffer;
|
||||
|
||||
@ -582,9 +582,9 @@ UnicodeString& Locale::getDisplayVariant(const Locale& inLocale,
|
||||
BUFFER_SIZE,
|
||||
&status);
|
||||
|
||||
if (status == BUFFER_OVERFLOW_ERROR)
|
||||
if (status == U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
buf = new UChar[size];
|
||||
uloc_getDisplayVariant(fullName,
|
||||
inLocale.fullName,
|
||||
@ -612,7 +612,7 @@ UnicodeString&
|
||||
Locale::getDisplayName( const Locale& inLocale,
|
||||
UnicodeString& result) const
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar bufBuffer[BUFFER_SIZE];
|
||||
UChar* buf = bufBuffer;
|
||||
|
||||
@ -622,9 +622,9 @@ Locale::getDisplayName( const Locale& inLocale,
|
||||
BUFFER_SIZE,
|
||||
&status);
|
||||
|
||||
if (status == BUFFER_OVERFLOW_ERROR)
|
||||
if (status == U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
|
||||
buf = new UChar[size];
|
||||
uloc_getDisplayName(fullName,
|
||||
@ -757,7 +757,7 @@ Locale::getLanguagesForCountry(const UnicodeString& country, int32_t& count)
|
||||
// the String s parsed to produce a Hashtable, which is then used for all
|
||||
// lookups.
|
||||
if(ctry2LangMapping == 0) {
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
UHashtable *temp = uhash_open(uhash_hashUString, &err);
|
||||
if (FAILURE(err))
|
||||
{
|
||||
@ -843,5 +843,4 @@ void Locale::setFromPOSIXID(const UnicodeString &posixIDString)
|
||||
if (buffer != onStack) delete [] buffer;
|
||||
}
|
||||
|
||||
|
||||
//eof
|
||||
|
@ -128,7 +128,7 @@
|
||||
* for creating a default <code>NumberFormat</code> object:
|
||||
* <blockquote>
|
||||
* <pre>
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . Locale myLocale;
|
||||
* . NumberFormat *nf;
|
||||
* .
|
||||
|
@ -493,7 +493,7 @@ UChar Normalizer::nextCompose()
|
||||
*/
|
||||
UChar Normalizer::prevCompose()
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
initBuffer();
|
||||
|
||||
// Slurp up characters until we hit a base char or an initial Jamo
|
||||
@ -1017,7 +1017,7 @@ Normalizer::setText(const UnicodeString& newText,
|
||||
}
|
||||
CharacterIterator *newIter = new StringCharacterIterator(newText);
|
||||
if (newIter == NULL) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
delete text;
|
||||
@ -1038,7 +1038,7 @@ Normalizer::setText(const CharacterIterator& newText,
|
||||
}
|
||||
CharacterIterator *newIter = newText.clone();
|
||||
if (newIter == NULL) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
delete text;
|
||||
@ -1185,5 +1185,3 @@ void Normalizer::jamoToHangul(UnicodeString& buffer, UTextOffset start) {
|
||||
|
||||
buffer.truncate(out);
|
||||
}
|
||||
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
ResourceBundleCache::ResourceBundleCache()
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
hashTable = uhash_open((UHashFunction)uhash_hashUString, &err);
|
||||
uhash_setValueDeleter(hashTable, deleteValue);
|
||||
}
|
||||
@ -39,7 +39,7 @@ void ResourceBundleCache::deleteValue(void* value)
|
||||
|
||||
VisitedFileCache::VisitedFileCache()
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
hashTable = uhash_open((UHashFunction)uhash_hashUString, &err);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ inline bool_t VisitedFileCache::wasVisited(const UnicodeString& filename) const
|
||||
|
||||
inline void VisitedFileCache::markAsVisited(const UnicodeString& filename)
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
uhash_putKey(hashTable, uhash_hashUString(filename.getUChars()), (void*)TRUE, &err);
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ String2dList::getStaticClassID()
|
||||
|
||||
TaggedList::TaggedList()
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
fHashtableValues = uhash_open((UHashFunction)uhash_hashUString, &err);
|
||||
uhash_setValueDeleter(fHashtableValues, deleteValue);
|
||||
|
||||
@ -103,7 +103,7 @@ void
|
||||
TaggedList::put(const UnicodeString& tag,
|
||||
const UnicodeString& data)
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
||||
uhash_putKey(fHashtableValues,
|
||||
tag.hashCode() & 0x7FFFFFFF,
|
||||
|
@ -93,7 +93,7 @@ read_strlist(FileStream *rb,
|
||||
/* Setup the string list */
|
||||
retval = new StringList();
|
||||
if(retval == 0) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ read_strlist(FileStream *rb,
|
||||
/* Allocate space for the array of strings */
|
||||
retval->fStrings = new UnicodeString [ retval->fCount ];
|
||||
if(retval->fStrings == 0) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
delete retval;
|
||||
return 0;
|
||||
}
|
||||
@ -146,7 +146,7 @@ read_strlist2d(FileStream *rb,
|
||||
/* Setup the 2-d string list */
|
||||
retval = new String2dList();
|
||||
if(retval == 0) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ read_strlist2d(FileStream *rb,
|
||||
/* Allocate space for the array of strings */
|
||||
retval->fStrings = new UnicodeString* [ retval->fRowCount ];
|
||||
if(retval->fStrings == 0) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
delete retval;
|
||||
return 0;
|
||||
}
|
||||
@ -181,7 +181,7 @@ read_strlist2d(FileStream *rb,
|
||||
/* Allocate enough space for each item */
|
||||
retval->fStrings[i] = new UnicodeString[itemcount];
|
||||
if(retval->fStrings[i] == 0) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
/* Complicated cleanup later */
|
||||
delete retval;
|
||||
return 0;
|
||||
@ -218,7 +218,7 @@ read_taglist(FileStream *rb,
|
||||
/* Setup the tagged list */
|
||||
retval = new TaggedList();
|
||||
if(retval == 0) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -269,7 +269,7 @@ rb_parse(FileStream *f,
|
||||
/* Open the hashtable for saving data */
|
||||
retval = uhash_open((UHashFunction)uhash_hashUString, &status);
|
||||
if(retval == 0 || FAILURE(status)) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
uhash_setValueDeleter(retval, RBHashtable_valueDeleter);
|
||||
@ -280,7 +280,7 @@ rb_parse(FileStream *f,
|
||||
/* Verify the byte ordering matches */
|
||||
if(bom != sBOM) {
|
||||
uhash_close(retval);
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -338,7 +338,7 @@ rb_parse(FileStream *f,
|
||||
|
||||
/* Check if any errors occurred during reading */
|
||||
if(T_FileStream_error(f) != 0) {
|
||||
status = FILE_ACCESS_ERROR;
|
||||
status = U_FILE_ACCESS_ERROR;
|
||||
delete retval;
|
||||
return 0;
|
||||
}
|
||||
|
@ -96,9 +96,9 @@
|
||||
* that data will not be stored into a TaggedList until a TaggedList
|
||||
* has been created. Nonetheless, the code in parse() does some
|
||||
* consistency checks as it runs the network, and fails with an
|
||||
* INTERNAL_PROGRAM_ERROR if one of these checks fails. If the input
|
||||
* data has a bad format, an INVALID_FORMAT_ERROR is returned. If you
|
||||
* see an INTERNAL_PROGRAM_ERROR the transition matrix has a bug in
|
||||
* U_INTERNAL_PROGRAM_ERROR if one of these checks fails. If the input
|
||||
* data has a bad format, an U_INVALID_FORMAT_ERROR is returned. If you
|
||||
* see an U_INTERNAL_PROGRAM_ERROR the transition matrix has a bug in
|
||||
* it.
|
||||
*
|
||||
* Old functionality of multiple locales in a single file is still
|
||||
@ -221,22 +221,22 @@ ResourceBundle::LocaleFallbackIterator::nextLocale(UErrorCode& status)
|
||||
fTriedDefaultLocale = fTriedDefaultLocale || (fLocale == fDefaultLocale);
|
||||
|
||||
chopLocale();
|
||||
if(status != USING_DEFAULT_ERROR)
|
||||
status = USING_FALLBACK_ERROR;
|
||||
if(status != U_USING_DEFAULT_ERROR)
|
||||
status = U_USING_FALLBACK_ERROR;
|
||||
|
||||
if(fLocale.size() == 0) {
|
||||
if(fUseDefaultLocale && !fTriedDefaultLocale) {
|
||||
fLocale = fDefaultLocale;
|
||||
fTriedDefaultLocale = TRUE;
|
||||
status = USING_DEFAULT_ERROR;
|
||||
status = U_USING_DEFAULT_ERROR;
|
||||
}
|
||||
else if( ! fTriedRoot) {
|
||||
fLocale = fRoot;
|
||||
fTriedRoot = TRUE;
|
||||
status = USING_DEFAULT_ERROR;
|
||||
status = U_USING_DEFAULT_ERROR;
|
||||
}
|
||||
else {
|
||||
status = MISSING_RESOURCE_ERROR;
|
||||
status = U_MISSING_RESOURCE_ERROR;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@ -297,13 +297,13 @@ ResourceBundle::ResourceBundle( const UnicodeString& path,
|
||||
fgCache(fgUserCache),
|
||||
fgVisitedFiles(fgUserVisitedFiles)
|
||||
{
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
|
||||
int32_t i;
|
||||
for(i = 0; i < kDataCount; ++i) {
|
||||
fData[i] = 0;
|
||||
fLoaded[i] = FALSE;
|
||||
fDataStatus[i] = INTERNAL_PROGRAM_ERROR;
|
||||
fDataStatus[i] = U_INTERNAL_PROGRAM_ERROR;
|
||||
}
|
||||
|
||||
fLocaleIterator = 0;
|
||||
@ -314,7 +314,7 @@ ResourceBundle::ResourceBundle( const UnicodeString& path,
|
||||
(void*)this, fgCache, status);
|
||||
}
|
||||
else {
|
||||
status = MISSING_RESOURCE_ERROR;
|
||||
status = U_MISSING_RESOURCE_ERROR;
|
||||
}
|
||||
|
||||
// Prevent further attempts to load hashtables
|
||||
@ -333,7 +333,7 @@ ResourceBundle::saveCollationHashtable(const UnicodeString& localeName,
|
||||
if( ! bundle->fLoaded[i]) {
|
||||
bundle->fData[i] = hashtable;
|
||||
bundle->fLoaded[i] = TRUE;
|
||||
bundle->fDataStatus[i] = ZERO_ERROR; /* ??? */
|
||||
bundle->fDataStatus[i] = U_ZERO_ERROR; /* ??? */
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -377,7 +377,7 @@ ResourceBundle::constructForLocale(const PathInfo& path,
|
||||
fIsDataOwned = FALSE;
|
||||
fVersionID = 0;
|
||||
|
||||
error = ZERO_ERROR;
|
||||
error = U_ZERO_ERROR;
|
||||
|
||||
locale.getName(fRealLocaleID);
|
||||
|
||||
@ -392,15 +392,15 @@ ResourceBundle::constructForLocale(const PathInfo& path,
|
||||
|
||||
for(i = 1; i < kDataCount; ++i) {
|
||||
fData[i] = 0;
|
||||
fDataStatus[i] = INTERNAL_PROGRAM_ERROR;
|
||||
fDataStatus[i] = U_INTERNAL_PROGRAM_ERROR;
|
||||
fLoaded[i] = FALSE;
|
||||
}
|
||||
|
||||
UnicodeString returnedLocale;
|
||||
error = ZERO_ERROR;
|
||||
error = U_ZERO_ERROR;
|
||||
fData[0] = getHashtableForLocale(fRealLocaleID, returnedLocale, error);
|
||||
fLoaded[0] = TRUE;
|
||||
fDataStatus[0] = ZERO_ERROR;
|
||||
fDataStatus[0] = U_ZERO_ERROR;
|
||||
if(SUCCESS(error))
|
||||
fRealLocaleID = returnedLocale;
|
||||
|
||||
@ -425,7 +425,7 @@ ResourceBundle::getHashtableForLocale(const UnicodeString& desiredLocale,
|
||||
{
|
||||
if(FAILURE(error)) return 0;
|
||||
|
||||
error = ZERO_ERROR;
|
||||
error = U_ZERO_ERROR;
|
||||
const UHashtable* h = getFromCache(fPath, desiredLocale, fgCache);
|
||||
if(h != 0) {
|
||||
returnedLocale = desiredLocale;
|
||||
@ -438,11 +438,11 @@ ResourceBundle::getHashtableForLocale(const UnicodeString& desiredLocale,
|
||||
// A note on fileError. We are tracking two different error states
|
||||
// here. One is that returned while iterating over different files.
|
||||
// For instance, when going from de_CH.txt to de.txt we will get a
|
||||
// USING_FALLBACK_ERROR, but we don't care -- because if de.txt
|
||||
// U_USING_FALLBACK_ERROR, but we don't care -- because if de.txt
|
||||
// contains the de_CH locale, it isn't a fallback, from our
|
||||
// perspective. Therefore we keep file associated errors in
|
||||
// fileError, apart from the error parameter.
|
||||
UErrorCode fileError = ZERO_ERROR;
|
||||
UErrorCode fileError = U_ZERO_ERROR;
|
||||
|
||||
for(;;) {
|
||||
// Build a filename for the locale.
|
||||
@ -451,7 +451,7 @@ ResourceBundle::getHashtableForLocale(const UnicodeString& desiredLocale,
|
||||
if(FAILURE(error))
|
||||
return 0;
|
||||
|
||||
error = ZERO_ERROR;
|
||||
error = U_ZERO_ERROR;
|
||||
h = getFromCacheWithFallback(fPath, desiredLocale,
|
||||
returnedLocale, fgCache, error);
|
||||
didTryCacheWithFallback = TRUE;
|
||||
@ -460,7 +460,7 @@ ResourceBundle::getHashtableForLocale(const UnicodeString& desiredLocale,
|
||||
}
|
||||
|
||||
if(!iterator.nextLocale(fileError)) {
|
||||
error = MISSING_RESOURCE_ERROR;
|
||||
error = U_MISSING_RESOURCE_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -472,7 +472,7 @@ ResourceBundle::getHashtableForLocale(const UnicodeString& desiredLocale,
|
||||
// attempt to load our locale from the cache.
|
||||
if(didTryCacheWithFallback)
|
||||
return 0;
|
||||
error = ZERO_ERROR;
|
||||
error = U_ZERO_ERROR;
|
||||
return getFromCacheWithFallback(fPath, desiredLocale,
|
||||
returnedLocale, fgCache, error);
|
||||
}
|
||||
@ -488,7 +488,7 @@ ResourceBundle::getHashtableForLocale(const UnicodeString& desiredLocale,
|
||||
{
|
||||
if(FAILURE(error))
|
||||
return 0;
|
||||
error = ZERO_ERROR;
|
||||
error = U_ZERO_ERROR;
|
||||
|
||||
// First try the cache
|
||||
const UHashtable* h = getFromCache(fPath, desiredLocale, fgCache);
|
||||
@ -499,7 +499,7 @@ ResourceBundle::getHashtableForLocale(const UnicodeString& desiredLocale,
|
||||
LocaleFallbackIterator iterator(desiredLocale, kDefaultFilename, FALSE);
|
||||
|
||||
for(;;) {
|
||||
UErrorCode parseError = ZERO_ERROR;
|
||||
UErrorCode parseError = U_ZERO_ERROR;
|
||||
if(parseIfUnparsed(fPath, iterator.getLocale(),
|
||||
fgCache, fgVisitedFiles, parseError)) {
|
||||
if(FAILURE(parseError)) {
|
||||
@ -531,7 +531,7 @@ ResourceBundle::getFromCacheWithFallback(const PathInfo& path,
|
||||
{
|
||||
if(FAILURE(error))
|
||||
return 0;
|
||||
error = ZERO_ERROR;
|
||||
error = U_ZERO_ERROR;
|
||||
|
||||
LocaleFallbackIterator iterator(desiredLocale, kDefaultLocaleName, TRUE);
|
||||
|
||||
@ -585,7 +585,7 @@ const ResourceBundleData*
|
||||
ResourceBundle::getDataForTag(const UnicodeString& tag,
|
||||
UErrorCode& err) const
|
||||
{
|
||||
err = ZERO_ERROR; /* just to make sure there's no fallback/etc left over */
|
||||
err = U_ZERO_ERROR; /* just to make sure there's no fallback/etc left over */
|
||||
// Iterate over the kDataCount hashtables which may be associated with this
|
||||
// bundle. At most we have kDataCount, but we may have as few as one.
|
||||
for(int32_t i = 0; i < kDataCount; ++i) {
|
||||
@ -595,7 +595,7 @@ ResourceBundle::getDataForTag(const UnicodeString& tag,
|
||||
ResourceBundle* nonconst = (ResourceBundle*)this;
|
||||
nonconst->fLoaded[i] = TRUE;
|
||||
if(fLocaleIterator->nextLocale(err)) {
|
||||
UErrorCode getHashtableStatus = ZERO_ERROR;
|
||||
UErrorCode getHashtableStatus = U_ZERO_ERROR;
|
||||
|
||||
nonconst->fDataStatus[i] = err;
|
||||
nonconst->fData[i] =
|
||||
@ -619,7 +619,7 @@ ResourceBundle::getDataForTag(const UnicodeString& tag,
|
||||
// cerr << "Failed to find tag " << tag << " in " << fPath << fRealLocaleID << fFilenameSuffix << endl;
|
||||
// cerr << *this;
|
||||
#endif
|
||||
err = MISSING_RESOURCE_ERROR;
|
||||
err = U_MISSING_RESOURCE_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -649,7 +649,7 @@ ResourceBundle::getString( const UnicodeString& resourceTag,
|
||||
&& ((StringList*)data)->fCount == 1) {
|
||||
return &(((StringList*)data)->fStrings[0]);
|
||||
}
|
||||
else err = MISSING_RESOURCE_ERROR;
|
||||
else err = U_MISSING_RESOURCE_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -667,7 +667,7 @@ ResourceBundle::getStringArray( const UnicodeString& resourceTag,
|
||||
count = ((StringList*)data)->fCount;
|
||||
return ((StringList*)data)->fStrings;
|
||||
}
|
||||
err = MISSING_RESOURCE_ERROR;
|
||||
err = U_MISSING_RESOURCE_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -704,7 +704,7 @@ ResourceBundle::getArrayItem( const UnicodeString& resourceTag,
|
||||
return &(((StringList*)data)->fStrings[index]);
|
||||
}
|
||||
else
|
||||
err = MISSING_RESOURCE_ERROR;
|
||||
err = U_MISSING_RESOURCE_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -726,7 +726,7 @@ ResourceBundle::get2dArray(const UnicodeString& resourceTag,
|
||||
// Why is this cast required? It shouldn't be. [LIU]
|
||||
return (const UnicodeString**)list->fStrings;
|
||||
}
|
||||
err = MISSING_RESOURCE_ERROR;
|
||||
err = U_MISSING_RESOURCE_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -769,7 +769,7 @@ ResourceBundle::get2dArrayItem(const UnicodeString& resourceTag,
|
||||
return &(list->fStrings[rowIndex][columnIndex]);
|
||||
}
|
||||
}
|
||||
err = MISSING_RESOURCE_ERROR;
|
||||
err = U_MISSING_RESOURCE_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -804,7 +804,7 @@ ResourceBundle::getTaggedArrayItem( const UnicodeString& resourceTag,
|
||||
return s;
|
||||
}
|
||||
|
||||
err = MISSING_RESOURCE_ERROR;
|
||||
err = U_MISSING_RESOURCE_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -847,7 +847,7 @@ getTaggedArrayUCharsImplementation( const ResourceBundle* bundle,
|
||||
const ResourceBundleData* data = bundle->getDataForTag(resourceTag, err);
|
||||
if(FAILURE(err) || data == 0
|
||||
|| data->getDynamicClassID() != TaggedList::getStaticClassID()) {
|
||||
err = MISSING_RESOURCE_ERROR;
|
||||
err = U_MISSING_RESOURCE_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -880,7 +880,7 @@ ResourceBundle::getTaggedArray( const UnicodeString& resourceTag,
|
||||
const ResourceBundleData* data = getDataForTag(resourceTag, err);
|
||||
if(FAILURE(err) || data == 0
|
||||
|| data->getDynamicClassID() != TaggedList::getStaticClassID()) {
|
||||
err = MISSING_RESOURCE_ERROR;
|
||||
err = U_MISSING_RESOURCE_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -913,7 +913,7 @@ ResourceBundle::getVersionNumber() const
|
||||
if(fVersionID == 0) {
|
||||
// If the version ID has not been built yet, then do so. Retrieve
|
||||
// the minor version from the file.
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UnicodeString minor_version;
|
||||
getString(kVersionTag, minor_version, status);
|
||||
|
||||
@ -953,7 +953,7 @@ ResourceBundle::listInstalledLocales(const UnicodeString& path,
|
||||
kIndexLocaleName, fgUserCache);
|
||||
|
||||
if(h == 0) {
|
||||
UErrorCode error = ZERO_ERROR;
|
||||
UErrorCode error = U_ZERO_ERROR;
|
||||
if(parseIfUnparsed(PathInfo(path, kDefaultSuffix),
|
||||
kIndexFilename, fgUserCache,
|
||||
fgUserVisitedFiles, error)) {
|
||||
@ -1014,7 +1014,7 @@ T_ResourceBundle_countArrayItemsImplementation(const ResourceBundle* resourceBun
|
||||
return 0;
|
||||
|
||||
if(!resourceKey) {
|
||||
err = ILLEGAL_ARGUMENT_ERROR;
|
||||
err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return 0;
|
||||
}
|
||||
const ResourceBundleData* data = resourceBundle->getDataForTag(resourceKey,
|
||||
@ -1035,7 +1035,7 @@ T_ResourceBundle_countArrayItemsImplementation(const ResourceBundle* resourceBun
|
||||
numItems = ((String2dList*)data)->fRowCount;
|
||||
}
|
||||
else {
|
||||
err = MISSING_RESOURCE_ERROR;
|
||||
err = U_MISSING_RESOURCE_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1087,7 +1087,7 @@ ResourceBundle::parse(const PathInfo& path,
|
||||
|
||||
f = path.openFile(locale);
|
||||
if(f == 0) {
|
||||
status = FILE_ACCESS_ERROR;
|
||||
status = U_FILE_ACCESS_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1113,7 +1113,7 @@ ResourceBundle::addToCache(const UnicodeString& localeName,
|
||||
{
|
||||
PathInfo *c = (PathInfo*)context;
|
||||
UnicodeString keyName(c->makeHashkey(localeName));
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
Mutex lock;
|
||||
if(uhash_get(fgCache->hashTable, keyName.hashCode() & 0x7FFFFFFF) == 0) {
|
||||
uhash_putKey(fgCache->hashTable, keyName.hashCode() & 0x7FFFFFFF,
|
||||
|
@ -138,7 +138,7 @@ typedef struct _FileStream FileStream;
|
||||
* This is an example for using a possible custom resource:
|
||||
* <pre>
|
||||
* . Locale currentLocale;
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . ResourceBundle myResources("MyResources", currentLocale, success );
|
||||
* .
|
||||
* . UnicodeString button1Title, button2Title;
|
||||
@ -168,9 +168,9 @@ public:
|
||||
* The UErrorCode& err parameter is used to return status information to the user. To
|
||||
* check whether the construction succeeded or not, you should check the value of
|
||||
* SUCCESS(err). If you wish more detailed information, you can check for
|
||||
* informational error results which still indicate success. USING_FALLBACK_ERROR
|
||||
* informational error results which still indicate success. U_USING_FALLBACK_ERROR
|
||||
* indicates that a fall back locale was used. For example, 'de_CH' was requested,
|
||||
* but nothing was found there, so 'de' was used. USING_DEFAULT_ERROR indicates that
|
||||
* but nothing was found there, so 'de' was used. U_USING_DEFAULT_ERROR indicates that
|
||||
* the default locale data was used; neither the requested locale nor any of its
|
||||
* fall back locales could be found.
|
||||
*/
|
||||
@ -192,7 +192,7 @@ public:
|
||||
*
|
||||
* @param resourceTag The resource tag of the string resource the caller wants
|
||||
* @param theString Receives the actual data in the resource
|
||||
* @param err Set to MISSING_RESOURCE_ERROR if a resource with the
|
||||
* @param err Set to U_MISSING_RESOURCE_ERROR if a resource with the
|
||||
* specified tag couldn't be found.
|
||||
*/
|
||||
void getString( const UnicodeString& resourceTag,
|
||||
@ -205,7 +205,7 @@ public:
|
||||
* these will be parsed prior to the data's return.
|
||||
*
|
||||
* @param resourceTag The resource tag of the string resource the caller wants
|
||||
* @param err Set to MISSING_RESOURCE_ERROR if a resource with the
|
||||
* @param err Set to U_MISSING_RESOURCE_ERROR if a resource with the
|
||||
* specified tag couldn't be found.
|
||||
* @return A pointer to the string from the resource bundle, or NULL if there was
|
||||
* an error.
|
||||
@ -219,13 +219,13 @@ public:
|
||||
* objects. The number of elements in the array is returned in numArrayItems.
|
||||
* Calling getStringArray on a resource of type string will return an array with one
|
||||
* element; calling it on a resource of type tagged-array results in a
|
||||
* MISSING_RESOURCE_ERROR error.
|
||||
* U_MISSING_RESOURCE_ERROR error.
|
||||
*
|
||||
* @param resourceTag The resource tag of the string-array resource the caller
|
||||
* wants
|
||||
* @param numArrayItems Receives the number of items in the array the function
|
||||
* returns.
|
||||
* @param err Set to MISSING_RESOURCE_ERROR if a resource with the
|
||||
* @param err Set to U_MISSING_RESOURCE_ERROR if a resource with the
|
||||
* specified tag couldn't be found.
|
||||
* @return The resource requested, as a pointer to an array of
|
||||
* UnicodeStrings. The caller does not own the storage and
|
||||
@ -238,7 +238,7 @@ public:
|
||||
/**
|
||||
* Returns a single item from a string-array resource. This will return the contents
|
||||
* of a single item in a resource of string-array (comma-delimited-list) type. If
|
||||
* the resource is not an array, a MISSING_RESOURCE_ERROR will be returned in err.
|
||||
* the resource is not an array, a U_MISSING_RESOURCE_ERROR will be returned in err.
|
||||
* [THIS FUNCTION IS DEPRECATED; USE THE OVERLOAD BELOW INSTEAD]
|
||||
*
|
||||
* @param resourceTag The resource tag of the resource the caller wants to extract
|
||||
@ -246,7 +246,7 @@ public:
|
||||
* @param index The index (zero-based) of the particular array item the user
|
||||
* wants to extract from the resource.
|
||||
* @param theArrayItem Receives the actual text of the desired array item.
|
||||
* @param err Set to MISSING_RESOURCE_ERROR if a resource with the
|
||||
* @param err Set to U_MISSING_RESOURCE_ERROR if a resource with the
|
||||
* specified tag couldn't be found, or if the index was out of range.
|
||||
*/
|
||||
void getArrayItem( const UnicodeString& resourceTag,
|
||||
@ -257,13 +257,13 @@ public:
|
||||
/**
|
||||
* Returns a single item from a string-array resource. This will return the contents
|
||||
* of a single item in a resource of string-array (comma-delimited-list) type. If
|
||||
* the resource is not an array, a MISSING_RESOURCE_ERROR will be returned in err.
|
||||
* the resource is not an array, a U_MISSING_RESOURCE_ERROR will be returned in err.
|
||||
*
|
||||
* @param resourceTag The resource tag of the resource the caller wants to extract
|
||||
* an item from.
|
||||
* @param index The index (zero-based) of the particular array item the user
|
||||
* wants to extract from the resource.
|
||||
* @param err Set to MISSING_RESOURCE_ERROR if a resource with the
|
||||
* @param err Set to U_MISSING_RESOURCE_ERROR if a resource with the
|
||||
* specified tag couldn't be found, or if the index was out of range.
|
||||
* @return A pointer to the text of the array item, or NULL is there was an error.
|
||||
*/
|
||||
@ -275,7 +275,7 @@ public:
|
||||
* Return the contents of a 2-dimensional array resource. The return value will be a
|
||||
* UnicodeString** array. (This is really an array of pointers; each pointer is a
|
||||
* ROW of the data.) The number of rows and columns is returned. If the resource is
|
||||
* of the wrong type, or not present, MISSING_RESOURCE_ERROR is placed in err.
|
||||
* of the wrong type, or not present, U_MISSING_RESOURCE_ERROR is placed in err.
|
||||
*
|
||||
* @param resourceTag The resource tag of the string-array resource the caller
|
||||
* wants
|
||||
@ -283,7 +283,7 @@ public:
|
||||
* returns.
|
||||
* @param columnCount Receives the number of columns in the array the function
|
||||
* returns.
|
||||
* @param err Set to MISSING_RESOURCE_ERROR if a resource with the
|
||||
* @param err Set to U_MISSING_RESOURCE_ERROR if a resource with the
|
||||
* specified tag couldn't be found.
|
||||
* @return The resource requested, as a UnicodeStrings**. The caller
|
||||
* does not own the storage and must not delete it.
|
||||
@ -296,7 +296,7 @@ public:
|
||||
/**
|
||||
* Return a single string from a 2-dimensional array resource. If the resource does
|
||||
* not exists, or if it is not a 2-d array, or if the row or column indices are out
|
||||
* of bounds, err is set to MISSING_RESOURCE_ERROR.
|
||||
* of bounds, err is set to U_MISSING_RESOURCE_ERROR.
|
||||
* [THIS FUNCTION IS DEPRECATED; USE THE OVERLOAD BELOW INSTEAD]
|
||||
*
|
||||
* @param resourceTag The resource tag of the resource the caller wants to extract
|
||||
@ -306,7 +306,7 @@ public:
|
||||
* @param columnIndex The column index (zero-based) of the array item the user
|
||||
* wants to extract from the resource.
|
||||
* @param theArrayItem Receives the actual text of the desired array item.
|
||||
* @param err Set to MISSING_RESOURCE_ERROR if a resource with the
|
||||
* @param err Set to U_MISSING_RESOURCE_ERROR if a resource with the
|
||||
* specified tag couldn't be found, if the resource data was in
|
||||
* the wrong format, or if either index is out of bounds.
|
||||
*/
|
||||
@ -319,7 +319,7 @@ public:
|
||||
/**
|
||||
* Return a single string from a 2-dimensional array resource. If the resource does
|
||||
* not exists, or if it is not a 2-d array, or if the row or column indices are out
|
||||
* of bounds, err is set to MISSING_RESOURCE_ERROR.
|
||||
* of bounds, err is set to U_MISSING_RESOURCE_ERROR.
|
||||
*
|
||||
* @param resourceTag The resource tag of the resource the caller wants to extract
|
||||
* an item from.
|
||||
@ -327,7 +327,7 @@ public:
|
||||
* to extract from the resource.
|
||||
* @param columnIndex The column index (zero-based) of the array item the user
|
||||
* wants to extract from the resource.
|
||||
* @param err Set to MISSING_RESOURCE_ERROR if a resource with the
|
||||
* @param err Set to U_MISSING_RESOURCE_ERROR if a resource with the
|
||||
* specified tag couldn't be found, if the resource data was in
|
||||
* the wrong format, or if either index is out of bounds.
|
||||
* @return A pointer to the text of the array item, or NULL is there was an error.
|
||||
@ -348,7 +348,7 @@ public:
|
||||
* an item from.
|
||||
* @param itemTag The item tag for the item the caller wants to extract.
|
||||
* @param theArrayItem Receives the text of the desired array item.
|
||||
* @param err Set to MISSING_RESOURCE_ERROR if a resource with the
|
||||
* @param err Set to U_MISSING_RESOURCE_ERROR if a resource with the
|
||||
* specified resource tag couldn't be found, or if an item
|
||||
* with the specified item tag couldn't be found in the resource.
|
||||
*/
|
||||
@ -366,7 +366,7 @@ public:
|
||||
* @param resourceTag The resource tag of the resource the caller wants to extract
|
||||
* an item from.
|
||||
* @param itemTag The item tag for the item the caller wants to extract.
|
||||
* @param err Set to MISSING_RESOURCE_ERROR if a resource with the
|
||||
* @param err Set to U_MISSING_RESOURCE_ERROR if a resource with the
|
||||
* specified resource tag couldn't be found, or if an item
|
||||
* with the specified item tag coldn't be found in the resource.
|
||||
* @return A pointer to the text of the array item, or NULL is there was an error.
|
||||
@ -394,7 +394,7 @@ public:
|
||||
* own this array, and must delete it.
|
||||
* @param numItems Receives the number of items in the arrays pointed to by
|
||||
* items and itemTags.
|
||||
* @param err Set to MISSING_RESOURCE_ERROR if a resource with the
|
||||
* @param err Set to U_MISSING_RESOURCE_ERROR if a resource with the
|
||||
* specified tag couldn't be found.
|
||||
*/
|
||||
void getTaggedArray( const UnicodeString& resourceTag,
|
||||
@ -627,7 +627,3 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -278,7 +278,7 @@ scsu_compress(UnicodeCompressor *comp,
|
||||
}
|
||||
/* verify the target buffer can hold at least 4 bytes */
|
||||
else if(targetLimit - byteBuffer < 4) {
|
||||
*status = ILLEGAL_ARGUMENT_ERROR;
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -836,7 +836,7 @@ scsu_compress(UnicodeCompressor *comp,
|
||||
*source = unicharBuffer;
|
||||
|
||||
if(unicharBuffer < sourceLimit)
|
||||
*status = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*status = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
|
||||
void
|
||||
@ -869,7 +869,7 @@ scsu_decompress(UnicodeCompressor *comp,
|
||||
}
|
||||
/* verify the target buffer can hold at least 1 UChar */
|
||||
else if(targetLimit - unicharBuffer < sizeof(UChar)) {
|
||||
*status = ILLEGAL_ARGUMENT_ERROR;
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1229,7 +1229,7 @@ scsu_decompress(UnicodeCompressor *comp,
|
||||
*source = byteBuffer;
|
||||
|
||||
if(byteBuffer < sourceLimit)
|
||||
*status = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*status = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
|
||||
/** Reset the compressor to its initial state. */
|
||||
|
@ -82,9 +82,9 @@ CAPI void U_EXPORT2 scsu_reset(UnicodeCompressor *comp);
|
||||
* This function is not guaranteed to completely fill the output buffer, nor
|
||||
* is it guaranteed to compress the entire input.
|
||||
* If the source data is completely compressed, <TT>status</TT> will be set
|
||||
* to <TT>ZERO_ERROR</TT>.
|
||||
* to <TT>U_ZERO_ERROR</TT>.
|
||||
* If the source data is not completely compressed, <TT>status</TT> will be
|
||||
* set to <TT>INDEX_OUTOFBOUNDS_ERROR</TT>. If this occurs, larger buffers
|
||||
* set to <TT>U_INDEX_OUTOFBOUNDS_ERROR</TT>. If this occurs, larger buffers
|
||||
* should be allocated, or data flushed, and the function should be called
|
||||
* again with the new buffers.
|
||||
*
|
||||
@ -114,9 +114,9 @@ CAPI void U_EXPORT2 scsu_compress(UnicodeCompressor *comp,
|
||||
* This function will either completely fill the output buffer, or
|
||||
* consume the entire input.
|
||||
* If the source data is completely compressed, <TT>status</TT> will be set
|
||||
* to <TT>ZERO_ERROR</TT>.
|
||||
* to <TT>U_ZERO_ERROR</TT>.
|
||||
* If the source data is not completely compressed, <TT>status</TT> will be
|
||||
* set to <TT>INDEX_OUTOFBOUNDS_ERROR</TT>. If this occurs, larger buffers
|
||||
* set to <TT>U_INDEX_OUTOFBOUNDS_ERROR</TT>. If this occurs, larger buffers
|
||||
* should be allocated, or data flushed, and the function should be called
|
||||
* again with the new buffers.
|
||||
*
|
||||
|
@ -136,7 +136,7 @@ adjustWSLevels(UBiDi *pBiDi);
|
||||
|
||||
CAPI UBiDi * U_EXPORT2
|
||||
ubidi_open() {
|
||||
UErrorCode errorCode=ZERO_ERROR;
|
||||
UErrorCode errorCode=U_ZERO_ERROR;
|
||||
return ubidi_openSized(0, 0, &errorCode);
|
||||
}
|
||||
|
||||
@ -148,14 +148,14 @@ ubidi_openSized(UTextOffset maxLength, UTextOffset maxRunCount, UErrorCode *pErr
|
||||
if(pErrorCode==NULL || FAILURE(*pErrorCode)) {
|
||||
return NULL;
|
||||
} else if(maxLength<0 || maxRunCount<0) {
|
||||
*pErrorCode=ILLEGAL_ARGUMENT_ERROR;
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL; /* invalid arguments */
|
||||
}
|
||||
|
||||
/* allocate memory for the object */
|
||||
pBiDi=(UBiDi *)icu_malloc(sizeof(UBiDi));
|
||||
if(pBiDi==NULL) {
|
||||
*pErrorCode=MEMORY_ALLOCATION_ERROR;
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ ubidi_openSized(UTextOffset maxLength, UTextOffset maxRunCount, UErrorCode *pErr
|
||||
if( !getInitialDirPropsMemory(pBiDi, maxLength) ||
|
||||
!getInitialLevelsMemory(pBiDi, maxLength)
|
||||
) {
|
||||
*pErrorCode=MEMORY_ALLOCATION_ERROR;
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
} else {
|
||||
pBiDi->mayAllocateText=TRUE;
|
||||
@ -178,7 +178,7 @@ ubidi_openSized(UTextOffset maxLength, UTextOffset maxRunCount, UErrorCode *pErr
|
||||
/* use simpleRuns[] */
|
||||
pBiDi->runsSize=sizeof(Run);
|
||||
} else if(!getInitialRunsMemory(pBiDi, maxRunCount)) {
|
||||
*pErrorCode=MEMORY_ALLOCATION_ERROR;
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
} else {
|
||||
pBiDi->mayAllocateRuns=TRUE;
|
||||
@ -271,7 +271,7 @@ ubidi_setPara(UBiDi *pBiDi, const UChar *text, UTextOffset length,
|
||||
(UBIDI_MAX_EXPLICIT_LEVEL<paraLevel) && !IS_DEFAULT_LEVEL(paraLevel) ||
|
||||
length<-1
|
||||
) {
|
||||
*pErrorCode=ILLEGAL_ARGUMENT_ERROR;
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -321,7 +321,7 @@ ubidi_setPara(UBiDi *pBiDi, const UChar *text, UTextOffset length,
|
||||
pBiDi->dirProps=pBiDi->dirPropsMemory;
|
||||
getDirProps(pBiDi, text);
|
||||
} else {
|
||||
*pErrorCode=MEMORY_ALLOCATION_ERROR;
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ ubidi_setPara(UBiDi *pBiDi, const UChar *text, UTextOffset length,
|
||||
pBiDi->levels=pBiDi->levelsMemory;
|
||||
direction=resolveExplicitLevels(pBiDi);
|
||||
} else {
|
||||
*pErrorCode=MEMORY_ALLOCATION_ERROR;
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@ -735,7 +735,7 @@ checkExplicitLevels(UBiDi *pBiDi, UErrorCode *pErrorCode) {
|
||||
}
|
||||
if(level<paraLevel || UBIDI_MAX_EXPLICIT_LEVEL<level) {
|
||||
/* level out of bounds */
|
||||
*pErrorCode=ILLEGAL_ARGUMENT_ERROR;
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return UBIDI_LTR;
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ ubidi_setLine(const UBiDi *pParaBiDi,
|
||||
start<0 || start>limit || limit>pParaBiDi->length ||
|
||||
pLineBiDi==NULL
|
||||
) {
|
||||
*pErrorCode=ILLEGAL_ARGUMENT_ERROR;
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ ubidi_getLevels(UBiDi *pBiDi, UErrorCode *pErrorCode) {
|
||||
if(pErrorCode==NULL || FAILURE(*pErrorCode)) {
|
||||
return NULL;
|
||||
} else if(pBiDi==NULL || (length=pBiDi->length)<=0) {
|
||||
*pErrorCode=ILLEGAL_ARGUMENT_ERROR;
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -263,7 +263,7 @@ ubidi_getLevels(UBiDi *pBiDi, UErrorCode *pErrorCode) {
|
||||
return pBiDi->levels=levels;
|
||||
} else {
|
||||
/* out of memory */
|
||||
*pErrorCode=MEMORY_ALLOCATION_ERROR;
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@ -341,7 +341,7 @@ ubidi_countRuns(UBiDi *pBiDi, UErrorCode *pErrorCode) {
|
||||
if(pErrorCode==NULL || FAILURE(*pErrorCode)) {
|
||||
return -1;
|
||||
} else if(pBiDi==NULL || pBiDi->runCount<0 && !getRuns(pBiDi)) {
|
||||
*pErrorCode=MEMORY_ALLOCATION_ERROR;
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return -1;
|
||||
} else {
|
||||
return pBiDi->runCount;
|
||||
@ -827,7 +827,7 @@ ubidi_getVisualIndex(UBiDi *pBiDi, UTextOffset logicalIndex, UErrorCode *pErrorC
|
||||
if(pErrorCode==NULL || FAILURE(*pErrorCode)) {
|
||||
return 0;
|
||||
} else if(pBiDi==NULL || logicalIndex<0 || pBiDi->length<=logicalIndex) {
|
||||
*pErrorCode=ILLEGAL_ARGUMENT_ERROR;
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return 0;
|
||||
} else {
|
||||
/* we can do the trivial cases without the runs array */
|
||||
@ -838,7 +838,7 @@ ubidi_getVisualIndex(UBiDi *pBiDi, UTextOffset logicalIndex, UErrorCode *pErrorC
|
||||
return pBiDi->length-logicalIndex-1;
|
||||
default:
|
||||
if(pBiDi->runCount<0 && !getRuns(pBiDi)) {
|
||||
*pErrorCode=MEMORY_ALLOCATION_ERROR;
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
} else {
|
||||
Run *runs=pBiDi->runs;
|
||||
@ -869,7 +869,7 @@ ubidi_getLogicalIndex(UBiDi *pBiDi, UTextOffset visualIndex, UErrorCode *pErrorC
|
||||
if(pErrorCode==NULL || FAILURE(*pErrorCode)) {
|
||||
return 0;
|
||||
} else if(pBiDi==NULL || visualIndex<0 || pBiDi->length<=visualIndex) {
|
||||
*pErrorCode=ILLEGAL_ARGUMENT_ERROR;
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return 0;
|
||||
} else {
|
||||
/* we can do the trivial cases without the runs array */
|
||||
@ -880,7 +880,7 @@ ubidi_getLogicalIndex(UBiDi *pBiDi, UTextOffset visualIndex, UErrorCode *pErrorC
|
||||
return pBiDi->length-visualIndex-1;
|
||||
default:
|
||||
if(pBiDi->runCount<0 && !getRuns(pBiDi)) {
|
||||
*pErrorCode=MEMORY_ALLOCATION_ERROR;
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
} else {
|
||||
Run *runs=pBiDi->runs;
|
||||
@ -931,7 +931,7 @@ ubidi_getLogicalMap(UBiDi *pBiDi, UTextOffset *indexMap, UErrorCode *pErrorCode)
|
||||
if((levels=(UBiDiLevel *)ubidi_getLevels(pBiDi, pErrorCode))==NULL) {
|
||||
/* no op */
|
||||
} else if(indexMap==NULL) {
|
||||
*pErrorCode=ILLEGAL_ARGUMENT_ERROR;
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
} else {
|
||||
ubidi_reorderLogical(levels, pBiDi->length, indexMap);
|
||||
}
|
||||
@ -943,7 +943,7 @@ ubidi_getVisualMap(UBiDi *pBiDi, UTextOffset *indexMap, UErrorCode *pErrorCode)
|
||||
if(ubidi_countRuns(pBiDi, pErrorCode)<=0) {
|
||||
/* no op */
|
||||
} else if(indexMap==NULL) {
|
||||
*pErrorCode=ILLEGAL_ARGUMENT_ERROR;
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
} else {
|
||||
/* fill a visual-to-logical index map using the runs[] */
|
||||
Run *runs=pBiDi->runs, *runsLimit=runs+pBiDi->runCount;
|
||||
|
@ -4655,9 +4655,9 @@ static const UCharDigitPair fCodeDigitTable[] = {
|
||||
{ 0x4E5D, 9}, /* Han Nine*/
|
||||
{ 0xFFFF, 0xF}
|
||||
};
|
||||
static const int8_t isLetterMask = (1 << UPPERCASE_LETTER) | (1 << LOWERCASE_LETTER)
|
||||
| (1 << TITLECASE_LETTER) | (1 << MODIFIER_LETTER)
|
||||
| (1 << OTHER_LETTER);
|
||||
static const int8_t isLetterMask = (1 << U_UPPERCASE_LETTER) | (1 << U_LOWERCASE_LETTER)
|
||||
| (1 << U_TITLECASE_LETTER) | (1 << U_MODIFIER_LETTER)
|
||||
| (1 << U_OTHER_LETTER);
|
||||
|
||||
|
||||
static const BlockScriptMap fScriptIndex[] = {
|
||||
@ -4747,9 +4747,9 @@ static const BlockScriptMap fScriptIndex[] = {
|
||||
{ 0xFE30, 0xFE4F }, /*CJK_COMPATIBILITY_FORMS */
|
||||
{ 0xFE50, 0xFE6F }, /*SMALL_FORM_VARIANTS */
|
||||
{ 0xFE70, 0xFEFE }, /*ARABIC_PRESENTATION_FORMS_B */
|
||||
{ 0xFEFF, 0xFEFF }, /*SPECIALS */
|
||||
{ 0xFEFF, 0xFEFF }, /*U_SPECIALS */
|
||||
{ 0xFF00, 0xFFEF }, /*HALFWIDTH_AND_FULLWIDTH_FORMS */
|
||||
{ 0xFFF0, 0xFFFD }, /*SPECIALS_2 = "SCRIPT_COUNT" (really specials) */
|
||||
{ 0xFFF0, 0xFFFD }, /*SPECIALS_2 = "U_CHAR_SCRIPT_COUNT" (really specials) */
|
||||
{ 0xFFFF, 0xFFFF } /* END */
|
||||
};
|
||||
const UChar cellWidthRanges[] =
|
||||
@ -4774,22 +4774,22 @@ const UChar cellWidthRanges[] =
|
||||
|
||||
const UChar cellWidthValues[] =
|
||||
{
|
||||
HALF_WIDTH, /* general scripts area*/
|
||||
FULL_WIDTH, /* combining Hangul choseong*/
|
||||
ZERO_WIDTH, /* combining Hangul jungseong and jongseong*/
|
||||
HALF_WIDTH, /* Latin extended aAdditional, Greek extended*/
|
||||
NEUTRAL, /* symbols and punctuation*/
|
||||
FULL_WIDTH, /* CJK phonetics & symbols, CJK ideographs, Hangul syllables*/
|
||||
NEUTRAL, /* surrogates, private use*/
|
||||
FULL_WIDTH, /* CJK compatibility ideographs*/
|
||||
HALF_WIDTH, /* alphabetic presentation forms, Arabic presentations forms A, combining half marks*/
|
||||
FULL_WIDTH, /* CJK compatibility forms, small form variants*/
|
||||
HALF_WIDTH, /* Arabic presentation forms B*/
|
||||
FULL_WIDTH, /* fullwidth ASCII*/
|
||||
HALF_WIDTH, /* halfwidth CJK punctuation, Katakana, Hangul Jamo*/
|
||||
FULL_WIDTH, /* fullwidth punctuation and currency signs*/
|
||||
HALF_WIDTH, /* halfwidth forms, arrows, and shapes*/
|
||||
ZERO_WIDTH /* specials*/
|
||||
U_HALF_WIDTH, /* general scripts area*/
|
||||
U_FULL_WIDTH, /* combining Hangul choseong*/
|
||||
U_ZERO_WIDTH, /* combining Hangul jungseong and jongseong*/
|
||||
U_HALF_WIDTH, /* Latin extended aAdditional, Greek extended*/
|
||||
U_NEUTRAL_WIDTH, /* symbols and punctuation*/
|
||||
U_FULL_WIDTH, /* CJK phonetics & symbols, CJK ideographs, Hangul syllables*/
|
||||
U_NEUTRAL_WIDTH, /* surrogates, private use*/
|
||||
U_FULL_WIDTH, /* CJK compatibility ideographs*/
|
||||
U_HALF_WIDTH, /* alphabetic presentation forms, Arabic presentations forms A, combining half marks*/
|
||||
U_FULL_WIDTH, /* CJK compatibility forms, small form variants*/
|
||||
U_HALF_WIDTH, /* Arabic presentation forms B*/
|
||||
U_FULL_WIDTH, /* fullwidth ASCII*/
|
||||
U_HALF_WIDTH, /* halfwidth CJK punctuation, Katakana, Hangul Jamo*/
|
||||
U_FULL_WIDTH, /* fullwidth punctuation and currency signs*/
|
||||
U_HALF_WIDTH, /* halfwidth forms, arrows, and shapes*/
|
||||
U_ZERO_WIDTH /* specials*/
|
||||
};
|
||||
|
||||
const int16_t numCellWidthValues = 16;
|
||||
@ -4806,7 +4806,7 @@ u_islower(UChar ch)
|
||||
if (!tablesCreated) {
|
||||
createTables();
|
||||
}
|
||||
return (ucmp8_get(tables, ch) == LOWERCASE_LETTER);
|
||||
return (ucmp8_get(tables, ch) == U_LOWERCASE_LETTER);
|
||||
}
|
||||
|
||||
/*Checks if ch is a upper case letter.*/
|
||||
@ -4816,7 +4816,7 @@ u_isupper(UChar ch)
|
||||
if (!tablesCreated) {
|
||||
createTables();
|
||||
}
|
||||
return (ucmp8_get(tables, ch) == UPPERCASE_LETTER);
|
||||
return (ucmp8_get(tables, ch) == U_UPPERCASE_LETTER);
|
||||
}
|
||||
|
||||
/* Checks if ch is a title case letter; usually upper case letters.*/
|
||||
@ -4826,7 +4826,7 @@ u_istitle(UChar ch)
|
||||
if (!tablesCreated) {
|
||||
createTables();
|
||||
}
|
||||
return (ucmp8_get(tables, ch) == TITLECASE_LETTER);
|
||||
return (ucmp8_get(tables, ch) == U_TITLECASE_LETTER);
|
||||
}
|
||||
|
||||
/* Checks if ch is a decimal digit. */
|
||||
@ -4838,7 +4838,7 @@ u_isdigit(UChar ch)
|
||||
createTables();
|
||||
}
|
||||
type = ucmp8_get(tables, ch);
|
||||
return (type == DECIMAL_DIGIT_NUMBER || type == OTHER_NUMBER || type == LETTER_NUMBER);
|
||||
return (type == U_DECIMAL_DIGIT_NUMBER || type == U_OTHER_NUMBER || type == U_LETTER_NUMBER);
|
||||
}
|
||||
|
||||
/* Checks if ch is a unicode character with assigned character type.*/
|
||||
@ -4848,7 +4848,7 @@ u_isdefined(UChar ch)
|
||||
if (!tablesCreated) {
|
||||
createTables();
|
||||
}
|
||||
return (ucmp8_get(tables, ch) != UNASSIGNED);
|
||||
return (ucmp8_get(tables, ch) != U_UNASSIGNED);
|
||||
}
|
||||
|
||||
|
||||
@ -4868,17 +4868,17 @@ UCharScript
|
||||
u_charScript(UChar ch)
|
||||
{
|
||||
int32_t index, j;
|
||||
UCharScript returnValue = NO_SCRIPT;
|
||||
UCharScript returnValue = U_NO_SCRIPT;
|
||||
|
||||
index = -1;
|
||||
for( j = 0; index == -1 && fScriptIndex[j].fFirstCode != 0xFFFF; ++j )
|
||||
if( fScriptIndex[j].fFirstCode <= ch && ch <= fScriptIndex[j].fLastCode ) {
|
||||
index = j;
|
||||
if(j == SCRIPT_COUNT) /* "SPECIALS 2" */
|
||||
index = SPECIALS;
|
||||
if(j == U_CHAR_SCRIPT_COUNT) /* "U_SPECIALS 2" */
|
||||
index = U_SPECIALS;
|
||||
}
|
||||
if(index >= SCRIPT_COUNT) {
|
||||
returnValue = NO_SCRIPT;
|
||||
if(index >= U_CHAR_SCRIPT_COUNT) {
|
||||
returnValue = U_NO_SCRIPT;
|
||||
}
|
||||
else if( index != -1 ) {
|
||||
returnValue = (UCharScript)index;
|
||||
@ -4896,9 +4896,9 @@ u_isbase(UChar ch)
|
||||
}
|
||||
|
||||
return (u_isalpha(ch) || u_isdigit(ch) ||
|
||||
(((((1 << NON_SPACING_MARK) |
|
||||
(1 << ENCLOSING_MARK) |
|
||||
(1 << COMBINING_SPACING_MARK)) >> u_charType(ch)) & 1) != 0));
|
||||
(((((1 << U_NON_SPACING_MARK) |
|
||||
(1 << U_ENCLOSING_MARK) |
|
||||
(1 << U_COMBINING_SPACING_MARK)) >> u_charType(ch)) & 1) != 0));
|
||||
|
||||
}
|
||||
|
||||
@ -4912,10 +4912,10 @@ u_iscntrl(UChar ch)
|
||||
}
|
||||
|
||||
type = ucmp8_get(tables, ch);
|
||||
return (type == CONTROL ||
|
||||
type == FORMAT ||
|
||||
type == LINE_SEPARATOR ||
|
||||
type == PARAGRAPH_SEPARATOR);
|
||||
return (type == U_CONTROL_CHAR ||
|
||||
type == U_FORMAT_CHAR ||
|
||||
type == U_LINE_SEPARATOR ||
|
||||
type == U_PARAGRAPH_SEPARATOR);
|
||||
}
|
||||
|
||||
/* Checks if the Unicode character is printable.*/
|
||||
@ -4927,8 +4927,8 @@ u_isprint(UChar ch)
|
||||
createTables();
|
||||
}
|
||||
type = ucmp8_get(tables, ch);
|
||||
return ((type >= UPPERCASE_LETTER && type <= PARAGRAPH_SEPARATOR) ||
|
||||
(type >= DASH_PUNCTUATION && type <= OTHER_SYMBOL));
|
||||
return ((type >= U_UPPERCASE_LETTER && type <= U_PARAGRAPH_SEPARATOR) ||
|
||||
(type >= U_DASH_PUNCTUATION && type <= U_OTHER_SYMBOL));
|
||||
}
|
||||
|
||||
/* Checks if the Unicode character is a letter.*/
|
||||
@ -4962,11 +4962,11 @@ u_isIDPart(UChar ch)
|
||||
}
|
||||
type = ucmp8_get(tables, ch);
|
||||
return(((isLetterMask & (1 << type)) != 0) ||
|
||||
(type == CONNECTOR_PUNCTUATION) ||
|
||||
(type == DECIMAL_DIGIT_NUMBER) ||
|
||||
(type == LETTER_NUMBER) ||
|
||||
(type == COMBINING_SPACING_MARK) ||
|
||||
(type == NON_SPACING_MARK) ||
|
||||
(type == U_CONNECTOR_PUNCTUATION) ||
|
||||
(type == U_DECIMAL_DIGIT_NUMBER) ||
|
||||
(type == U_LETTER_NUMBER) ||
|
||||
(type == U_COMBINING_SPACING_MARK) ||
|
||||
(type == U_NON_SPACING_MARK) ||
|
||||
u_isIDIgnorable(ch));
|
||||
}
|
||||
|
||||
@ -4990,8 +4990,8 @@ bool_t u_isJavaIDStart(UChar ch)
|
||||
}
|
||||
type = ucmp8_get(tables, ch);
|
||||
return(((isLetterMask & (1 << type)) != 0) ||
|
||||
(type == CURRENCY_SYMBOL) ||
|
||||
(type == CONNECTOR_PUNCTUATION));
|
||||
(type == U_CURRENCY_SYMBOL) ||
|
||||
(type == U_CONNECTOR_PUNCTUATION));
|
||||
}
|
||||
|
||||
/*Checks if the Unicode character can be a Java identifier part other than starting the
|
||||
@ -5005,12 +5005,12 @@ bool_t u_isJavaIDPart(UChar ch)
|
||||
}
|
||||
type = ucmp8_get(tables, ch);
|
||||
return(((isLetterMask & (1 << type)) != 0) ||
|
||||
(type == CURRENCY_SYMBOL) ||
|
||||
(type == CONNECTOR_PUNCTUATION) ||
|
||||
(type == DECIMAL_DIGIT_NUMBER) ||
|
||||
(type == LETTER_NUMBER) ||
|
||||
(type == COMBINING_SPACING_MARK) ||
|
||||
(type == NON_SPACING_MARK) ||
|
||||
(type == U_CURRENCY_SYMBOL) ||
|
||||
(type == U_CONNECTOR_PUNCTUATION) ||
|
||||
(type == U_DECIMAL_DIGIT_NUMBER) ||
|
||||
(type == U_LETTER_NUMBER) ||
|
||||
(type == U_COMBINING_SPACING_MARK) ||
|
||||
(type == U_NON_SPACING_MARK) ||
|
||||
u_isIDIgnorable(ch));
|
||||
}
|
||||
/* Transforms the Unicode character to its lower case equivalent.*/
|
||||
@ -5089,9 +5089,9 @@ u_isspace(UChar ch)
|
||||
createTables();
|
||||
}
|
||||
type = ucmp8_get(tables, ch);
|
||||
return ((type == SPACE_SEPARATOR) ||
|
||||
(type == LINE_SEPARATOR) ||
|
||||
(type == PARAGRAPH_SEPARATOR));
|
||||
return ((type == U_SPACE_SEPARATOR) ||
|
||||
(type == U_LINE_SEPARATOR) ||
|
||||
(type == U_PARAGRAPH_SEPARATOR));
|
||||
}
|
||||
|
||||
/* Gets if the Unicode character's character property.*/
|
||||
@ -5116,26 +5116,24 @@ u_charCellWidth(UChar ch)
|
||||
/* these Unicode character types are scattered throughout the Unicode range, so
|
||||
special-case for them*/
|
||||
switch (type) {
|
||||
case UNASSIGNED:
|
||||
case NON_SPACING_MARK:
|
||||
case ENCLOSING_MARK:
|
||||
case LINE_SEPARATOR:
|
||||
case PARAGRAPH_SEPARATOR:
|
||||
case CONTROL:
|
||||
case FORMAT:
|
||||
return ZERO_WIDTH;
|
||||
case U_UNASSIGNED:
|
||||
case U_NON_SPACING_MARK:
|
||||
case U_ENCLOSING_MARK:
|
||||
case U_LINE_SEPARATOR:
|
||||
case U_PARAGRAPH_SEPARATOR:
|
||||
case U_CONTROL_CHAR:
|
||||
case U_FORMAT_CHAR:
|
||||
return U_ZERO_WIDTH;
|
||||
|
||||
default:
|
||||
; /* fall out the bottom*/
|
||||
/* for all remaining characters, find out which Unicode range they belong to using
|
||||
the table above, and then look up the appropriate return value in that table*/
|
||||
for (i = 0; i < numCellWidthValues; ++i)
|
||||
if (ch < cellWidthRanges[i])
|
||||
break;
|
||||
--i;
|
||||
return cellWidthValues[i];
|
||||
}
|
||||
|
||||
/* for all remaining characters, find out which Unicode range they belong to using
|
||||
the table above, and then look up the appropriate return value in that table*/
|
||||
for (i = 0; i < numCellWidthValues; ++i)
|
||||
if (ch < cellWidthRanges[i])
|
||||
break;
|
||||
--i;
|
||||
return cellWidthValues[i];
|
||||
}
|
||||
|
||||
int32_t
|
||||
|
@ -100,38 +100,38 @@
|
||||
|
||||
enum UCharCategory
|
||||
{
|
||||
UNASSIGNED = 0,
|
||||
UPPERCASE_LETTER = 1,
|
||||
LOWERCASE_LETTER = 2,
|
||||
TITLECASE_LETTER = 3,
|
||||
MODIFIER_LETTER = 4,
|
||||
OTHER_LETTER = 5,
|
||||
NON_SPACING_MARK = 6,
|
||||
ENCLOSING_MARK = 7,
|
||||
COMBINING_SPACING_MARK = 8,
|
||||
DECIMAL_DIGIT_NUMBER = 9,
|
||||
LETTER_NUMBER = 10,
|
||||
OTHER_NUMBER = 11,
|
||||
SPACE_SEPARATOR = 12,
|
||||
LINE_SEPARATOR = 13,
|
||||
PARAGRAPH_SEPARATOR = 14,
|
||||
CONTROL = 15,
|
||||
FORMAT = 16,
|
||||
PRIVATE_USE = 17,
|
||||
SURROGATE = 18,
|
||||
DASH_PUNCTUATION = 19,
|
||||
START_PUNCTUATION = 20,
|
||||
END_PUNCTUATION = 21,
|
||||
CONNECTOR_PUNCTUATION = 22,
|
||||
OTHER_PUNCTUATION = 23,
|
||||
MATH_SYMBOL = 24,
|
||||
CURRENCY_SYMBOL = 25,
|
||||
MODIFIER_SYMBOL = 26,
|
||||
OTHER_SYMBOL = 27,
|
||||
INITIAL_PUNCTUATION = 28,
|
||||
FINAL_PUNCTUATION = 29,
|
||||
GENERAL_OTHER_TYPES = 30
|
||||
|
||||
U_UNASSIGNED = 0,
|
||||
U_UPPERCASE_LETTER = 1,
|
||||
U_LOWERCASE_LETTER = 2,
|
||||
U_TITLECASE_LETTER = 3,
|
||||
U_MODIFIER_LETTER = 4,
|
||||
U_OTHER_LETTER = 5,
|
||||
U_NON_SPACING_MARK = 6,
|
||||
U_ENCLOSING_MARK = 7,
|
||||
U_COMBINING_SPACING_MARK = 8,
|
||||
U_DECIMAL_DIGIT_NUMBER = 9,
|
||||
U_LETTER_NUMBER = 10,
|
||||
U_OTHER_NUMBER = 11,
|
||||
U_SPACE_SEPARATOR = 12,
|
||||
U_LINE_SEPARATOR = 13,
|
||||
U_PARAGRAPH_SEPARATOR = 14,
|
||||
U_CONTROL_CHAR = 15,
|
||||
U_FORMAT_CHAR = 16,
|
||||
U_PRIVATE_USE_CHAR = 17,
|
||||
U_SURROGATE = 18,
|
||||
U_DASH_PUNCTUATION = 19,
|
||||
U_START_PUNCTUATION = 20,
|
||||
U_END_PUNCTUATION = 21,
|
||||
U_CONNECTOR_PUNCTUATION = 22,
|
||||
U_OTHER_PUNCTUATION = 23,
|
||||
U_MATH_SYMBOL = 24,
|
||||
U_CURRENCY_SYMBOL = 25,
|
||||
U_MODIFIER_SYMBOL = 26,
|
||||
U_OTHER_SYMBOL = 27,
|
||||
U_INITIAL_PUNCTUATION = 28,
|
||||
U_FINAL_PUNCTUATION = 29,
|
||||
U_GENERAL_OTHER_TYPES = 30,
|
||||
U_CHAR_CATEGORY_COUNT
|
||||
};
|
||||
|
||||
typedef enum UCharCategory UCharCategory;
|
||||
@ -151,15 +151,15 @@ enum UCharDirection {
|
||||
U_SEGMENT_SEPARATOR = 8,
|
||||
U_WHITE_SPACE_NEUTRAL = 9,
|
||||
U_OTHER_NEUTRAL = 10,
|
||||
U_LEFT_TO_RIGHT_EMBEDDING = 11,
|
||||
U_LEFT_TO_RIGHT_EMBEDDING = 11,
|
||||
U_LEFT_TO_RIGHT_OVERRIDE = 12,
|
||||
U_RIGHT_TO_LEFT_ARABIC = 13,
|
||||
U_RIGHT_TO_LEFT_EMBEDDING = 14,
|
||||
U_RIGHT_TO_LEFT_OVERRIDE = 15,
|
||||
U_POP_DIRECTIONAL_FORMAT = 16,
|
||||
U_DIR_NON_SPACING_MARK = 17,
|
||||
U_BOUNDARY_NEUTRAL = 18,
|
||||
UCharDirectionCount
|
||||
U_RIGHT_TO_LEFT_ARABIC = 13,
|
||||
U_RIGHT_TO_LEFT_EMBEDDING = 14,
|
||||
U_RIGHT_TO_LEFT_OVERRIDE = 15,
|
||||
U_POP_DIRECTIONAL_FORMAT = 16,
|
||||
U_DIR_NON_SPACING_MARK = 17,
|
||||
U_BOUNDARY_NEUTRAL = 18,
|
||||
U_CHAR_DIRECTION_COUNT
|
||||
};
|
||||
|
||||
typedef enum UCharDirection UCharDirection;
|
||||
@ -170,134 +170,95 @@ typedef enum UCharDirection UCharDirection;
|
||||
/* Generated from Unicode Data files */
|
||||
enum UCharScript {
|
||||
/* Script names */
|
||||
BASIC_LATIN,
|
||||
LATIN_1_SUPPLEMENT,
|
||||
LATIN_EXTENDED_A,
|
||||
LATIN_EXTENDED_B,
|
||||
IPA_EXTENSIONS,
|
||||
SPACING_MODIFIER_LETTERS,
|
||||
COMBINING_DIACRITICAL_MARKS,
|
||||
GREEK,
|
||||
CYRILLIC,
|
||||
ARMENIAN,
|
||||
HEBREW,
|
||||
ARABIC,
|
||||
SYRIAC,
|
||||
THAANA,
|
||||
DEVANAGARI,
|
||||
BENGALI,
|
||||
GURMUKHI,
|
||||
GUJARATI,
|
||||
ORIYA,
|
||||
TAMIL,
|
||||
TELUGU,
|
||||
KANNADA,
|
||||
MALAYALAM,
|
||||
SINHALA,
|
||||
THAI,
|
||||
LAO,
|
||||
TIBETAN,
|
||||
MYANMAR,
|
||||
GEORGIAN,
|
||||
HANGUL_JAMO,
|
||||
ETHIOPIC,
|
||||
CHEROKEE,
|
||||
UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS,
|
||||
OGHAM,
|
||||
RUNIC,
|
||||
KHMER,
|
||||
MONGOLIAN,
|
||||
LATIN_EXTENDED_ADDITIONAL,
|
||||
GREEK_EXTENDED,
|
||||
GENERAL_PUNCTUATION,
|
||||
SUPERSCRIPTS_AND_SUBSCRIPTS,
|
||||
CURRENCY_SYMBOLS,
|
||||
COMBINING_MARKS_FOR_SYMBOLS,
|
||||
LETTERLIKE_SYMBOLS,
|
||||
NUMBER_FORMS,
|
||||
ARROWS,
|
||||
MATHEMATICAL_OPERATORS,
|
||||
MISCELLANEOUS_TECHNICAL,
|
||||
CONTROL_PICTURES,
|
||||
OPTICAL_CHARACTER_RECOGNITION,
|
||||
ENCLOSED_ALPHANUMERICS,
|
||||
BOX_DRAWING,
|
||||
BLOCK_ELEMENTS,
|
||||
GEOMETRIC_SHAPES,
|
||||
MISCELLANEOUS_SYMBOLS,
|
||||
DINGBATS,
|
||||
BRAILLE_PATTERNS,
|
||||
CJK_RADICALS_SUPPLEMENT,
|
||||
KANGXI_RADICALS,
|
||||
IDEOGRAPHIC_DESCRIPTION_CHARACTERS,
|
||||
CJK_SYMBOLS_AND_PUNCTUATION,
|
||||
HIRAGANA,
|
||||
KATAKANA,
|
||||
BOPOMOFO,
|
||||
HANGUL_COMPATIBILITY_JAMO,
|
||||
KANBUN,
|
||||
BOPOMOFO_EXTENDED,
|
||||
ENCLOSED_CJK_LETTERS_AND_MONTHS,
|
||||
CJK_COMPATIBILITY,
|
||||
CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A,
|
||||
CJK_UNIFIED_IDEOGRAPHS,
|
||||
YI_SYLLABLES,
|
||||
YI_RADICALS,
|
||||
HANGUL_SYLLABLES,
|
||||
HIGH_SURROGATES,
|
||||
HIGH_PRIVATE_USE_SURROGATES,
|
||||
LOW_SURROGATES,
|
||||
PRIVATE_USE_AREA, /* PRIVATE_USE */
|
||||
CJK_COMPATIBILITY_IDEOGRAPHS,
|
||||
ALPHABETIC_PRESENTATION_FORMS,
|
||||
ARABIC_PRESENTATION_FORMS_A,
|
||||
COMBINING_HALF_MARKS,
|
||||
CJK_COMPATIBILITY_FORMS,
|
||||
SMALL_FORM_VARIANTS,
|
||||
ARABIC_PRESENTATION_FORMS_B,
|
||||
SPECIALS,
|
||||
HALFWIDTH_AND_FULLWIDTH_FORMS,
|
||||
SCRIPT_COUNT,
|
||||
NO_SCRIPT,
|
||||
|
||||
|
||||
/* Enums for compatibility with ICU 1.2.4 and previous */
|
||||
LATIN1_SUPPLEMENT=LATIN_1_SUPPLEMENT,
|
||||
IPA_EXTENSION=IPA_EXTENSIONS,
|
||||
SPACING_MODIFIER=SPACING_MODIFIER_LETTERS,
|
||||
COMBINING_DIACRITICAL=COMBINING_DIACRITICAL_MARKS,
|
||||
SUPER_SUBSCRIPT=SUPERSCRIPTS_AND_SUBSCRIPTS,
|
||||
CURRENCY_SYMBOL_SCRIPT=CURRENCY_SYMBOLS,
|
||||
SYMBOL_COMBINING_MARK=COMBINING_MARKS_FOR_SYMBOLS,
|
||||
LETTERLIKE_SYMBOL=LETTERLIKE_SYMBOLS,
|
||||
NUMBER_FORM=NUMBER_FORMS,
|
||||
ARROW=ARROWS,
|
||||
MATH_OPERATOR=MATHEMATICAL_OPERATORS,
|
||||
MISC_TECHNICAL=MISCELLANEOUS_TECHNICAL,
|
||||
CONTROL_PICTURE=CONTROL_PICTURES,
|
||||
OPTICAL_CHARACTER=OPTICAL_CHARACTER_RECOGNITION,
|
||||
ENCLOSED_ALPHANUMERIC=ENCLOSED_ALPHANUMERICS,
|
||||
BOXDRAWING=BOX_DRAWING,
|
||||
BLOCK_ELEMENT=BLOCK_ELEMENTS,
|
||||
GEOMETRIC_SHAPE=GEOMETRIC_SHAPES,
|
||||
MISC_SYMBOL=MISCELLANEOUS_SYMBOLS,
|
||||
DINGBAT=DINGBATS,
|
||||
CJK_SYMBOL_PUNCTUATION=CJK_SYMBOLS_AND_PUNCTUATION,
|
||||
ENCLOSED_CJK_LETTER_MONTH=ENCLOSED_CJK_LETTERS_AND_MONTHS,
|
||||
CJK_UNIFIED_IDEOGRAPH=CJK_UNIFIED_IDEOGRAPHS,
|
||||
HANGUL_SYLLABLE=HANGUL_SYLLABLES,
|
||||
HIGH_SURROGATE=HIGH_SURROGATES,
|
||||
HIGH_PRIVATE_USE_SURROGATE=HIGH_PRIVATE_USE_SURROGATES,
|
||||
LOW_SURROGATE=LOW_SURROGATES,
|
||||
PRIVATE_USE_CHARACTERS=PRIVATE_USE_AREA,
|
||||
CJK_COMPATIBILITY_IDEOGRAPH=CJK_COMPATIBILITY_IDEOGRAPHS,
|
||||
ALPHABETIC_PRESENTATION=ALPHABETIC_PRESENTATION_FORMS,
|
||||
ARABIC_PRESENTATION_A=ARABIC_PRESENTATION_FORMS_A,
|
||||
COMBINING_HALFMARK=COMBINING_HALF_MARKS,
|
||||
CJK_COMPATIBILITY_FORM=CJK_COMPATIBILITY_FORMS,
|
||||
SMALL_FORM_VARIANT=SMALL_FORM_VARIANTS,
|
||||
ARABIC_PRESENTATION_B=ARABIC_PRESENTATION_FORMS_B,
|
||||
HALFWIDTH_FULLWIDTH_FORM=HALFWIDTH_AND_FULLWIDTH_FORMS
|
||||
U_BASIC_LATIN,
|
||||
U_LATIN_1_SUPPLEMENT,
|
||||
U_LATIN_EXTENDED_A,
|
||||
U_LATIN_EXTENDED_B,
|
||||
U_IPA_EXTENSIONS,
|
||||
U_SPACING_MODIFIER_LETTERS,
|
||||
U_COMBINING_DIACRITICAL_MARKS,
|
||||
U_GREEK,
|
||||
U_CYRILLIC,
|
||||
U_ARMENIAN,
|
||||
U_HEBREW,
|
||||
U_ARABIC,
|
||||
U_SYRIAC,
|
||||
U_THAANA,
|
||||
U_DEVANAGARI,
|
||||
U_BENGALI,
|
||||
U_GURMUKHI,
|
||||
U_GUJARATI,
|
||||
U_ORIYA,
|
||||
U_TAMIL,
|
||||
U_TELUGU,
|
||||
U_KANNADA,
|
||||
U_MALAYALAM,
|
||||
U_SINHALA,
|
||||
U_THAI,
|
||||
U_LAO,
|
||||
U_TIBETAN,
|
||||
U_MYANMAR,
|
||||
U_GEORGIAN,
|
||||
U_HANGUL_JAMO,
|
||||
U_ETHIOPIC,
|
||||
U_CHEROKEE,
|
||||
U_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS,
|
||||
U_OGHAM,
|
||||
U_RUNIC,
|
||||
U_KHMER,
|
||||
U_MONGOLIAN,
|
||||
U_LATIN_EXTENDED_ADDITIONAL,
|
||||
U_GREEK_EXTENDED,
|
||||
U_GENERAL_PUNCTUATION,
|
||||
U_SUPERSCRIPTS_AND_SUBSCRIPTS,
|
||||
U_CURRENCY_SYMBOLS,
|
||||
U_COMBINING_MARKS_FOR_SYMBOLS,
|
||||
U_LETTERLIKE_SYMBOLS,
|
||||
U_NUMBER_FORMS,
|
||||
U_ARROWS,
|
||||
U_MATHEMATICAL_OPERATORS,
|
||||
U_MISCELLANEOUS_TECHNICAL,
|
||||
U_CONTROL_PICTURES,
|
||||
U_OPTICAL_CHARACTER_RECOGNITION,
|
||||
U_ENCLOSED_ALPHANUMERICS,
|
||||
U_BOX_DRAWING,
|
||||
U_BLOCK_ELEMENTS,
|
||||
U_GEOMETRIC_SHAPES,
|
||||
U_MISCELLANEOUS_SYMBOLS,
|
||||
U_DINGBATS,
|
||||
U_BRAILLE_PATTERNS,
|
||||
U_CJK_RADICALS_SUPPLEMENT,
|
||||
U_KANGXI_RADICALS,
|
||||
U_IDEOGRAPHIC_DESCRIPTION_CHARACTERS,
|
||||
U_CJK_SYMBOLS_AND_PUNCTUATION,
|
||||
U_HIRAGANA,
|
||||
U_KATAKANA,
|
||||
U_BOPOMOFO,
|
||||
U_HANGUL_COMPATIBILITY_JAMO,
|
||||
U_KANBUN,
|
||||
U_BOPOMOFO_EXTENDED,
|
||||
U_ENCLOSED_CJK_LETTERS_AND_MONTHS,
|
||||
U_CJK_COMPATIBILITY,
|
||||
U_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A,
|
||||
U_CJK_UNIFIED_IDEOGRAPHS,
|
||||
U_YI_SYLLABLES,
|
||||
U_YI_RADICALS,
|
||||
U_HANGUL_SYLLABLES,
|
||||
U_HIGH_SURROGATES,
|
||||
U_HIGH_PRIVATE_USE_SURROGATES,
|
||||
U_LOW_SURROGATES,
|
||||
U_PRIVATE_USE_AREA,
|
||||
U_CJK_COMPATIBILITY_IDEOGRAPHS,
|
||||
U_ALPHABETIC_PRESENTATION_FORMS,
|
||||
U_ARABIC_PRESENTATION_FORMS_A,
|
||||
U_COMBINING_HALF_MARKS,
|
||||
U_CJK_COMPATIBILITY_FORMS,
|
||||
U_SMALL_FORM_VARIANTS,
|
||||
U_ARABIC_PRESENTATION_FORMS_B,
|
||||
U_SPECIALS,
|
||||
U_HALFWIDTH_AND_FULLWIDTH_FORMS,
|
||||
U_CHAR_SCRIPT_COUNT,
|
||||
U_NO_SCRIPT=U_CHAR_SCRIPT_COUNT
|
||||
};
|
||||
typedef enum UCharScript UCharScript;
|
||||
|
||||
@ -306,10 +267,11 @@ typedef enum UCharScript UCharScript;
|
||||
*/
|
||||
enum UCellWidth
|
||||
{
|
||||
ZERO_WIDTH = 0,
|
||||
HALF_WIDTH = 1,
|
||||
FULL_WIDTH = 2,
|
||||
NEUTRAL = 3
|
||||
U_ZERO_WIDTH = 0,
|
||||
U_HALF_WIDTH = 1,
|
||||
U_FULL_WIDTH = 2,
|
||||
U_NEUTRAL_WIDTH = 3,
|
||||
U_CELL_WIDTH_COUNT
|
||||
};
|
||||
|
||||
typedef enum UCellWidth UCellWidth;
|
||||
|
@ -191,7 +191,7 @@ UConverter* ucnv_openU (const UChar * name,
|
||||
return ucnv_open (NULL, err);
|
||||
if (u_strlen (name) > MAX_CONVERTER_NAME_LENGTH)
|
||||
{
|
||||
*err = ILLEGAL_ARGUMENT_ERROR;
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
return ucnv_open (u_austrcpy (asciiName, name), err);
|
||||
@ -264,7 +264,7 @@ int32_t ucnv_flushCache ()
|
||||
/*deletes only if reference counter == 0 */
|
||||
if (mySharedData->referenceCounter == 0)
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
tableDeletedNum++;
|
||||
|
||||
uhash_remove (SHARED_DATA_HASHTABLE, uhash_hashIString (mySharedData->name), &err);
|
||||
@ -281,7 +281,7 @@ int32_t ucnv_flushCache ()
|
||||
*/
|
||||
const char* ucnv_getAvailableName (int32_t index)
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
/*lazy evaluates the list of Available converters */
|
||||
if (AVAILABLE_CONVERTERS_NAMES == NULL)
|
||||
setupAliasTableAndAvailableConverters (&err);
|
||||
@ -293,7 +293,7 @@ const char* ucnv_getAvailableName (int32_t index)
|
||||
|
||||
int32_t ucnv_countAvailable ()
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
/*lazy evaluates the list of Available converters */
|
||||
if (AVAILABLE_CONVERTERS_NAMES == NULL)
|
||||
setupAliasTableAndAvailableConverters (&err);
|
||||
@ -311,7 +311,7 @@ void ucnv_getSubstChars (const UConverter * converter,
|
||||
|
||||
if (*len < converter->subCharLen) /*not enough space in subChars */
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -335,7 +335,7 @@ void ucnv_setSubstChars (UConverter * converter,
|
||||
if ((len > converter->sharedData->maxBytesPerChar)
|
||||
|| (len < converter->sharedData->minBytesPerChar))
|
||||
{
|
||||
*err = ILLEGAL_ARGUMENT_ERROR;
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -386,8 +386,8 @@ int32_t ucnv_getDisplayName (const UConverter * converter,
|
||||
stringToWrite = u_uastrcpy (stringToWriteBuffer, converter->sharedData->name);
|
||||
|
||||
/*Hides the fallback to the internal name from the user */
|
||||
if (*err == MISSING_RESOURCE_ERROR)
|
||||
*err = ZERO_ERROR;
|
||||
if (*err == U_MISSING_RESOURCE_ERROR)
|
||||
*err = U_ZERO_ERROR;
|
||||
}
|
||||
|
||||
/*At this point we have a displayName and its length
|
||||
@ -402,7 +402,7 @@ int32_t ucnv_getDisplayName (const UConverter * converter,
|
||||
else
|
||||
{
|
||||
/*it doesn't fit */
|
||||
*err = BUFFER_OVERFLOW_ERROR;
|
||||
*err = U_BUFFER_OVERFLOW_ERROR;
|
||||
|
||||
u_strncpy (displayName,
|
||||
stringToWrite,
|
||||
@ -538,7 +538,7 @@ void ucnv_fromUnicode (UConverter * _this,
|
||||
if (FAILURE (*err)) return;
|
||||
if ((_this == NULL) || ((char *) targetLimit < *target) || (sourceLimit < *source))
|
||||
{
|
||||
*err = ILLEGAL_ARGUMENT_ERROR;
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -629,7 +629,7 @@ void ucnv_toUnicode (UConverter * _this,
|
||||
if (FAILURE (*err)) return;
|
||||
if ((_this == NULL) || ((UChar *) targetLimit < *target) || (sourceLimit < *source))
|
||||
{
|
||||
*err = ILLEGAL_ARGUMENT_ERROR;
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -720,7 +720,7 @@ int32_t ucnv_fromUChars (const UConverter * converter,
|
||||
|
||||
if ((converter == NULL) || (targetSize < 0))
|
||||
{
|
||||
*err = ILLEGAL_ARGUMENT_ERROR;
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -761,13 +761,13 @@ int32_t ucnv_fromUChars (const UConverter * converter,
|
||||
|
||||
if (targetSize == 0)
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
|
||||
/* If the output buffer is exhausted, we need to stop writing
|
||||
* to it but continue the conversion in order to store in targetSize
|
||||
* the number of bytes that was required*/
|
||||
if (*err == INDEX_OUTOFBOUNDS_ERROR)
|
||||
if (*err == U_INDEX_OUTOFBOUNDS_ERROR)
|
||||
{
|
||||
char target2[CHUNK_SIZE];
|
||||
char *target2_alias = target2;
|
||||
@ -777,9 +777,9 @@ int32_t ucnv_fromUChars (const UConverter * converter,
|
||||
*(in case the output is greater than CHUNK_SIZE)
|
||||
*/
|
||||
|
||||
while (*err == INDEX_OUTOFBOUNDS_ERROR)
|
||||
while (*err == U_INDEX_OUTOFBOUNDS_ERROR)
|
||||
{
|
||||
*err = ZERO_ERROR;
|
||||
*err = U_ZERO_ERROR;
|
||||
target2_alias = target2;
|
||||
ucnv_fromUnicode (&myConverter,
|
||||
&target2_alias,
|
||||
@ -793,11 +793,11 @@ int32_t ucnv_fromUChars (const UConverter * converter,
|
||||
/*updates the output parameter to contain the number of char required */
|
||||
targetCapacity += (target2_alias - target2) + 1;
|
||||
}
|
||||
/*We will set the erro code to BUFFER_OVERFLOW_ERROR only if
|
||||
/*We will set the erro code to U_BUFFER_OVERFLOW_ERROR only if
|
||||
*nothing graver happened in the previous loop*/
|
||||
(targetCapacity)--;
|
||||
if (SUCCESS (*err))
|
||||
*err = BUFFER_OVERFLOW_ERROR;
|
||||
*err = U_BUFFER_OVERFLOW_ERROR;
|
||||
}
|
||||
|
||||
return targetCapacity;
|
||||
@ -821,7 +821,7 @@ int32_t ucnv_toUChars (const UConverter * converter,
|
||||
|
||||
if ((converter == NULL) || (targetSize < 0) || (sourceSize < 0))
|
||||
{
|
||||
*err = ILLEGAL_ARGUMENT_ERROR;
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return 0;
|
||||
}
|
||||
/*Means there is no work to be done */
|
||||
@ -871,14 +871,14 @@ int32_t ucnv_toUChars (const UConverter * converter,
|
||||
targetCapacity += myTarget - target;
|
||||
if (targetSize == 0)
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
/* If the output buffer is exhausted, we need to stop writing
|
||||
* to it but if the input buffer is not exhausted,
|
||||
* we need to continue the conversion in order to store in targetSize
|
||||
* the number of bytes that was required
|
||||
*/
|
||||
if (*err == INDEX_OUTOFBOUNDS_ERROR)
|
||||
if (*err == U_INDEX_OUTOFBOUNDS_ERROR)
|
||||
{
|
||||
UChar target2[CHUNK_SIZE];
|
||||
UChar *target2_alias = target2;
|
||||
@ -887,9 +887,9 @@ int32_t ucnv_toUChars (const UConverter * converter,
|
||||
/*We use a stack allocated buffer around which we loop
|
||||
(in case the output is greater than CHUNK_SIZE) */
|
||||
|
||||
while (*err == INDEX_OUTOFBOUNDS_ERROR)
|
||||
while (*err == U_INDEX_OUTOFBOUNDS_ERROR)
|
||||
{
|
||||
*err = ZERO_ERROR;
|
||||
*err = U_ZERO_ERROR;
|
||||
target2_alias = target2;
|
||||
ucnv_toUnicode (&myConverter,
|
||||
&target2_alias,
|
||||
@ -905,7 +905,7 @@ int32_t ucnv_toUChars (const UConverter * converter,
|
||||
}
|
||||
(targetCapacity)--; /*adjust for last one */
|
||||
if (SUCCESS (*err))
|
||||
*err = BUFFER_OVERFLOW_ERROR;
|
||||
*err = U_BUFFER_OVERFLOW_ERROR;
|
||||
}
|
||||
|
||||
return targetCapacity;
|
||||
@ -992,13 +992,13 @@ T_UConverter_fromCodepageToCodepage (UConverter * outConverter,
|
||||
flush,
|
||||
err);
|
||||
|
||||
/*INDEX_OUTOFBOUNDS_ERROR means that the output "CHUNK" is full
|
||||
/*U_INDEX_OUTOFBOUNDS_ERROR means that the output "CHUNK" is full
|
||||
*we will require at least another loop (it's a recoverable error)
|
||||
*/
|
||||
|
||||
if (SUCCESS (*err) || (*err == INDEX_OUTOFBOUNDS_ERROR))
|
||||
if (SUCCESS (*err) || (*err == U_INDEX_OUTOFBOUNDS_ERROR))
|
||||
{
|
||||
*err = ZERO_ERROR;
|
||||
*err = U_ZERO_ERROR;
|
||||
out_chunk_alias2 = out_chunk;
|
||||
|
||||
while ((out_chunk_alias2 != out_chunk_alias) && SUCCESS (*err))
|
||||
@ -1042,7 +1042,7 @@ int32_t ucnv_convert(const char *toConverterName,
|
||||
|
||||
if ((targetSize < 0) || (sourceSize < 0))
|
||||
{
|
||||
*err = ILLEGAL_ARGUMENT_ERROR;
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1084,13 +1084,13 @@ int32_t ucnv_convert(const char *toConverterName,
|
||||
targetCapacity = myTarget - target;
|
||||
if (targetSize == 0)
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
|
||||
/* If the output buffer is exhausted, we need to stop writing
|
||||
* to it but continue the conversion in order to store in targetSize
|
||||
* the number of bytes that was required*/
|
||||
if (*err == INDEX_OUTOFBOUNDS_ERROR)
|
||||
if (*err == U_INDEX_OUTOFBOUNDS_ERROR)
|
||||
{
|
||||
char target2[CHUNK_SIZE];
|
||||
char *target2_alias = target2;
|
||||
@ -1100,9 +1100,9 @@ int32_t ucnv_convert(const char *toConverterName,
|
||||
*(in case the output is greater than CHUNK_SIZE)
|
||||
*/
|
||||
|
||||
while (*err == INDEX_OUTOFBOUNDS_ERROR)
|
||||
while (*err == U_INDEX_OUTOFBOUNDS_ERROR)
|
||||
{
|
||||
*err = ZERO_ERROR;
|
||||
*err = U_ZERO_ERROR;
|
||||
target2_alias = target2;
|
||||
T_UConverter_fromCodepageToCodepage (outConverter,
|
||||
inConverter,
|
||||
@ -1117,11 +1117,11 @@ int32_t ucnv_convert(const char *toConverterName,
|
||||
/*updates the output parameter to contain the number of char required */
|
||||
targetCapacity += (target2_alias - target2) + 1;
|
||||
}
|
||||
/*We will set the erro code to BUFFER_OVERFLOW_ERROR only if
|
||||
/*We will set the erro code to U_BUFFER_OVERFLOW_ERROR only if
|
||||
*nothing graver happened in the previous loop*/
|
||||
(targetCapacity)--;
|
||||
if (SUCCESS (*err))
|
||||
*err = BUFFER_OVERFLOW_ERROR;
|
||||
*err = U_BUFFER_OVERFLOW_ERROR;
|
||||
}
|
||||
|
||||
ucnv_close (inConverter);
|
||||
@ -1143,7 +1143,7 @@ void ucnv_getStarters(const UConverter* converter,
|
||||
/*Fire off an error if converter is not MBCS*/
|
||||
if (converter->sharedData->conversionType != MBCS)
|
||||
{
|
||||
*err = ILLEGAL_ARGUMENT_ERROR;
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1151,5 +1151,3 @@ void ucnv_getStarters(const UConverter* converter,
|
||||
icu_memcpy(starters, converter->sharedData->table->mbcs.starters, 256*sizeof(bool_t));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* if <TT>NULL</TT> is passed for the converter name, it will create one with the
|
||||
* getDefaultName return value.
|
||||
* @param converterName : name of the uconv table
|
||||
* @param err outgoing error status <TT>MEMORY_ALLOCATION_ERROR, TABLE_NOT_FOUND</TT>
|
||||
* @param err outgoing error status <TT>U_MEMORY_ALLOCATION_ERROR, TABLE_NOT_FOUND</TT>
|
||||
* @return the created Unicode converter object, or <TT>NULL</TT> if an error occured
|
||||
* @see ucnv_openU
|
||||
* @see ucnv_openCCSID
|
||||
@ -52,7 +52,7 @@ UConverter* U_EXPORT2 ucnv_open (const char *converterName,
|
||||
* if <TT>NULL</TT> is passed for the converter name, it will create one with the
|
||||
* getDefaultName return value.
|
||||
* @param converterName : name of the uconv table in a zero terminated Unicode string
|
||||
* @param err outgoing error status <TT>MEMORY_ALLOCATION_ERROR, TABLE_NOT_FOUND</TT>
|
||||
* @param err outgoing error status <TT>U_MEMORY_ALLOCATION_ERROR, TABLE_NOT_FOUND</TT>
|
||||
* @return the created Unicode converter object, or <TT>NULL</TT> if an error occured
|
||||
* @see ucnv_open
|
||||
* @see ucnv_openCCSID
|
||||
@ -67,7 +67,7 @@ CAPI UConverter* U_EXPORT2 ucnv_openU (const UChar * name,
|
||||
* Creates a UConverter object using a CCSID number.
|
||||
* @param codepage : codepage # of the uconv table
|
||||
* @param platform : codepage's platform (now only <TT>IBM</TT> supported)
|
||||
* @param err error status <TT>MEMORY_ALLOCATION_ERROR, TABLE_NOT_FOUND</TT>
|
||||
* @param err error status <TT>U_MEMORY_ALLOCATION_ERROR, TABLE_NOT_FOUND</TT>
|
||||
* @return the created Unicode converter object, or <TT>NULL</TT> if and error occured
|
||||
* @see ucnv_open
|
||||
* @see ucnv_openU
|
||||
@ -98,7 +98,7 @@ CAPI void U_EXPORT2 ucnv_close (UConverter * converter);
|
||||
* @param len: on input the capacity of subChars, on output the number of bytes copied to it
|
||||
* @param err: the outgoing error status code.
|
||||
* If the substitution character array is too small, an
|
||||
* <TT>INDEX_OUTOFBOUNDS_ERROR</TT> will be returned.
|
||||
* <TT>U_INDEX_OUTOFBOUNDS_ERROR</TT> will be returned.
|
||||
* @see ucnv_setSubstChars
|
||||
*/
|
||||
|
||||
@ -115,7 +115,7 @@ CAPI void U_EXPORT2
|
||||
* @param converter the Unicode converter
|
||||
* @param subChars the substitution character byte sequence we want set
|
||||
* @param len the number of bytes in subChars
|
||||
* @param err the error status code. <TT>INDEX_OUTOFBOUNDS_ERROR </TT> if
|
||||
* @param err the error status code. <TT>U_INDEX_OUTOFBOUNDS_ERROR </TT> if
|
||||
* len is bigger than the maximum number of bytes allowed in subchars
|
||||
* @see ucnv_getSubstChars
|
||||
*/
|
||||
@ -136,7 +136,7 @@ CAPI void U_EXPORT2
|
||||
* @param len: on input the capacity of errBytes, on output the number of bytes copied to it
|
||||
* @param err: the outgoing error status code.
|
||||
* If the substitution character array is too small, an
|
||||
* <TT>INDEX_OUTOFBOUNDS_ERROR</TT> will be returned.
|
||||
* <TT>U_INDEX_OUTOFBOUNDS_ERROR</TT> will be returned.
|
||||
*/
|
||||
|
||||
CAPI void U_EXPORT2
|
||||
@ -154,7 +154,7 @@ CAPI void U_EXPORT2
|
||||
* @param len: on input the capacity of errUChars, on output the number of UChars copied to it
|
||||
* @param err: the outgoing error status code.
|
||||
* If the substitution character array is too small, an
|
||||
* <TT>INDEX_OUTOFBOUNDS_ERROR</TT> will be returned.
|
||||
* <TT>U_INDEX_OUTOFBOUNDS_ERROR</TT> will be returned.
|
||||
*/
|
||||
|
||||
CAPI void U_EXPORT2
|
||||
@ -264,7 +264,7 @@ ucnv_getType (const UConverter * converter);
|
||||
|
||||
/**
|
||||
*Gets the "starter" bytes for the converters of type MBCS
|
||||
*will fill in an <TT>ILLEGAL_ARGUMENT_ERROR</TT> if converter passed in
|
||||
*will fill in an <TT>U_ILLEGAL_ARGUMENT_ERROR</TT> if converter passed in
|
||||
*is not MBCS.
|
||||
*fills in an array of boolean, with the value of the byte as offset to the array.
|
||||
*At return, if TRUE is found in at offset 0x20, it means that the byte 0x20 is a starter byte
|
||||
@ -348,7 +348,7 @@ CAPI UCNV_FromUCallBack U_EXPORT2
|
||||
* For output data carried across calls -1 will be placed for offsets.
|
||||
* @param flush <TT>TRUE</TT> if the buffer is the last buffer of the conversion interation
|
||||
* and the conversion will finish with this call, FALSE otherwise.
|
||||
* @param err the error status. <TT>ILLEGAL_ARGUMENT_ERROR</TT> will be returned if the
|
||||
* @param err the error status. <TT>U_ILLEGAL_ARGUMENT_ERROR</TT> will be returned if the
|
||||
* converter is <TT>NULL</TT>.
|
||||
* @see ucnv_fromUChars
|
||||
* @see ucnv_convert
|
||||
@ -387,7 +387,7 @@ CAPI
|
||||
* For output data carried across calls -1 will be placed for offsets.
|
||||
* @param flush TRUE if the buffer is the last buffer and the conversion will finish
|
||||
* in this call, FALSE otherwise.
|
||||
* @param err the error code status <TT>ILLEGAL_ARGUMENT_ERROR</TT> will be returned if the
|
||||
* @param err the error code status <TT>U_ILLEGAL_ARGUMENT_ERROR</TT> will be returned if the
|
||||
* converter is <TT>NULL</TT>, or if <TT>targetLimit</TT> and <TT>sourceLimit</TT> are misaligned.
|
||||
* @see ucnv_toUChars
|
||||
* @see ucnv_getNextUChar
|
||||
@ -420,10 +420,10 @@ CAPI
|
||||
* codepage do not use '\0' as a string terminator
|
||||
* @param targetCapacity Input the number of bytes available in the <TT>target</TT> buffer
|
||||
* @param err the error status code.
|
||||
* <TT>INDEX_OUTOFBOUNDS_ERROR</TT> will be returned if the
|
||||
* <TT>U_INDEX_OUTOFBOUNDS_ERROR</TT> will be returned if the
|
||||
* the # of bytes provided are not enough for transcoding.
|
||||
* <TT>ILLEGAL_ARGUMENT_ERROR</TT> is returned if the converter is <TT>NULL</TT> or the source or target string is empty.
|
||||
* <TT>BUFFER_OVERFLOW_ERROR</TT> when <TT>targetSize</TT> turns out to be bigger than <TT>targetCapacity</TT>
|
||||
* <TT>U_ILLEGAL_ARGUMENT_ERROR</TT> is returned if the converter is <TT>NULL</TT> or the source or target string is empty.
|
||||
* <TT>U_BUFFER_OVERFLOW_ERROR</TT> when <TT>targetSize</TT> turns out to be bigger than <TT>targetCapacity</TT>
|
||||
* @return number of bytes needed in target, regardless of <TT>targetCapacity</TT>
|
||||
* @see ucnv_fromUnicode
|
||||
* @see ucnv_convert
|
||||
@ -455,11 +455,11 @@ CAPI
|
||||
* @param targetCapacity capacity of the target buffer
|
||||
* @param sourceSize : Number of bytes in <TT>source</TT> to be transcoded
|
||||
* @param err the error status code
|
||||
* <TT>MEMORY_ALLOCATION_ERROR</TT> will be returned if the
|
||||
* <TT>U_MEMORY_ALLOCATION_ERROR</TT> will be returned if the
|
||||
* the internal process buffer cannot be allocated for transcoding.
|
||||
* <TT>ILLEGAL_ARGUMENT_ERROR</TT> is returned if the converter is <TT>NULL</TT> or
|
||||
* <TT>U_ILLEGAL_ARGUMENT_ERROR</TT> is returned if the converter is <TT>NULL</TT> or
|
||||
* if the source or target string is empty.
|
||||
* <TT>BUFFER_OVERFLOW_ERROR</TT> when the input buffer is prematurely exhausted and targetSize non-<TT>NULL</TT>.
|
||||
* <TT>U_BUFFER_OVERFLOW_ERROR</TT> when the input buffer is prematurely exhausted and targetSize non-<TT>NULL</TT>.
|
||||
* @return the number of UChar needed in target (including the zero terminator)
|
||||
* @see ucnv_getNextUChar
|
||||
* @see ucnv_toUnicode
|
||||
|
@ -95,13 +95,13 @@ CompactShortArray* createCompactShortArrayFromFile (FileStream * infile, UError
|
||||
|
||||
if (myValuesCount < 0)
|
||||
{
|
||||
*err = INVALID_TABLE_FILE;
|
||||
*err = U_INVALID_TABLE_FILE;
|
||||
return NULL;
|
||||
}
|
||||
myShortArray = (int16_t *) icu_malloc (myValuesCount * sizeof (int16_t));
|
||||
if (myShortArray == NULL)
|
||||
{
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
/*reads in the first array */
|
||||
@ -110,7 +110,7 @@ CompactShortArray* createCompactShortArrayFromFile (FileStream * infile, UError
|
||||
if (myIndexCount < 0)
|
||||
{
|
||||
icu_free (myShortArray);
|
||||
*err = INVALID_TABLE_FILE;
|
||||
*err = U_INVALID_TABLE_FILE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ CompactShortArray* createCompactShortArrayFromFile (FileStream * infile, UError
|
||||
if (myIndexArray == NULL)
|
||||
{
|
||||
icu_free (myShortArray);
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -149,13 +149,13 @@ CompactByteArray* createCompactByteArrayFromFile (FileStream * infile,
|
||||
|
||||
if (myValuesCount < 0)
|
||||
{
|
||||
*err = INVALID_TABLE_FILE;
|
||||
*err = U_INVALID_TABLE_FILE;
|
||||
return NULL;
|
||||
}
|
||||
myByteArray = (int8_t *) icu_malloc (myValuesCount * sizeof (int8_t));
|
||||
if (myByteArray == NULL)
|
||||
{
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
/*reads in the first array */
|
||||
@ -164,14 +164,14 @@ CompactByteArray* createCompactByteArrayFromFile (FileStream * infile,
|
||||
if (myIndexCount < 0)
|
||||
{
|
||||
icu_free (myByteArray);
|
||||
*err = INVALID_TABLE_FILE;
|
||||
*err = U_INVALID_TABLE_FILE;
|
||||
return NULL;
|
||||
}
|
||||
myIndexArray = (uint16_t *) icu_malloc (myIndexCount * sizeof (uint16_t));
|
||||
if (myIndexArray == NULL)
|
||||
{
|
||||
icu_free (myByteArray);
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
/*reads in the second array */
|
||||
@ -201,7 +201,7 @@ UConverter* createConverterFromFile (const char *fileName, UErrorCode * err)
|
||||
infile = openConverterFile (fileName);
|
||||
if (infile == NULL)
|
||||
{
|
||||
*err = FILE_ACCESS_ERROR;
|
||||
*err = U_FILE_ACCESS_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ UConverter* createConverterFromFile (const char *fileName, UErrorCode * err)
|
||||
if (myCheck != FILE_CHECK_MARKER)
|
||||
{
|
||||
T_FileStream_close (infile);
|
||||
*err = INVALID_TABLE_FILE;
|
||||
*err = U_INVALID_TABLE_FILE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ UConverter* createConverterFromFile (const char *fileName, UErrorCode * err)
|
||||
if (myConverter == NULL)
|
||||
{
|
||||
T_FileStream_close (infile);
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -231,7 +231,7 @@ UConverter* createConverterFromFile (const char *fileName, UErrorCode * err)
|
||||
{
|
||||
T_FileStream_close (infile);
|
||||
icu_free (myConverter);
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ UConverter* createConverterFromFile (const char *fileName, UErrorCode * err)
|
||||
{
|
||||
icu_free (myConverter->sharedData);
|
||||
icu_free (myConverter);
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
break;
|
||||
}
|
||||
T_FileStream_read (infile, myConverter->sharedData->table->sbcs.toUnicode, 256 * sizeof (UChar));
|
||||
@ -267,7 +267,7 @@ UConverter* createConverterFromFile (const char *fileName, UErrorCode * err)
|
||||
{
|
||||
icu_free (myConverter->sharedData);
|
||||
icu_free (myConverter);
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
break;
|
||||
}
|
||||
myConverter->sharedData->table->dbcs.toUnicode = createCompactShortArrayFromFile (infile, err);
|
||||
@ -282,7 +282,7 @@ UConverter* createConverterFromFile (const char *fileName, UErrorCode * err)
|
||||
{
|
||||
icu_free (myConverter->sharedData);
|
||||
icu_free (myConverter);
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
break;
|
||||
}
|
||||
T_FileStream_read (infile, myConverter->sharedData->table->mbcs.starters, 256 * sizeof (bool_t));
|
||||
@ -294,7 +294,7 @@ UConverter* createConverterFromFile (const char *fileName, UErrorCode * err)
|
||||
default:
|
||||
{
|
||||
/*If it isn't any of the above, the file is invalid */
|
||||
*err = INVALID_TABLE_FILE;
|
||||
*err = U_INVALID_TABLE_FILE;
|
||||
icu_free (myConverter->sharedData);
|
||||
icu_free (myConverter);
|
||||
}
|
||||
@ -399,7 +399,7 @@ int32_t uhash_hashSharedData (void *sharedData)
|
||||
void shareConverterData (UConverterSharedData * data)
|
||||
{
|
||||
Mutex *sharedData = NULL;
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
/*Lazy evaluates the Hashtable itself */
|
||||
|
||||
if (SHARED_DATA_HASHTABLE == NULL)
|
||||
@ -493,7 +493,7 @@ bool_t isDataBasedConverter (const char *name)
|
||||
Mutex *createHashTableMutex = NULL;
|
||||
int32_t i = 0;
|
||||
bool_t result = FALSE;
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
||||
/*Lazy evaluates the hashtable */
|
||||
if (ALGORITHMIC_CONVERTERS_HASHTABLE == NULL)
|
||||
@ -558,7 +558,7 @@ UConverter *
|
||||
|
||||
if (resolveName (realName, converterName) == FALSE)
|
||||
{
|
||||
*err = INVALID_TABLE_FILE;
|
||||
*err = U_INVALID_TABLE_FILE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -591,7 +591,7 @@ UConverter *
|
||||
myUConverter = (UConverter *) icu_malloc (sizeof (UConverter));
|
||||
if (myUConverter == NULL)
|
||||
{
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -632,7 +632,7 @@ UConverter *
|
||||
myUConverter = (UConverter *) icu_malloc (sizeof (UConverter));
|
||||
if (myUConverter == NULL)
|
||||
{
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -856,7 +856,7 @@ UConverter *
|
||||
myConverter = (UConverter *) icu_malloc (sizeof (UConverter));
|
||||
if (myConverter == NULL)
|
||||
{
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -864,7 +864,7 @@ UConverter *
|
||||
mySharedData = (UConverterSharedData *) icu_malloc (sizeof (UConverterSharedData));
|
||||
if (mySharedData == NULL)
|
||||
{
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
icu_free (myConverter);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ void T_UConverter_toUnicode_SBCS (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
_this->invalidCharBuffer[0] = (char) mySource[mySourceIndex - 1];
|
||||
_this->invalidCharLength = 1;
|
||||
|
||||
@ -313,7 +313,7 @@ void T_UConverter_toUnicode_SBCS (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -376,7 +376,7 @@ void T_UConverter_toUnicode_DBCS (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
_this->invalidCharBuffer[0] = (char) (mySourceChar >> 8);
|
||||
_this->invalidCharBuffer[1] = (char) mySourceChar;
|
||||
_this->invalidCharLength = 2;
|
||||
@ -399,7 +399,7 @@ void T_UConverter_toUnicode_DBCS (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -414,7 +414,7 @@ void T_UConverter_toUnicode_DBCS (UConverter * _this,
|
||||
|
||||
if (SUCCESS(*err))
|
||||
{
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
_this->toUnicodeStatus = 0x00;
|
||||
}
|
||||
}
|
||||
@ -451,7 +451,7 @@ void T_UConverter_toUnicode_LATIN_1 (UConverter * _this,
|
||||
if ((targetLimit - *target) < sourceLength)
|
||||
{
|
||||
readLen = targetLimit - *target;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -494,7 +494,7 @@ void T_UConverter_fromUnicode_LATIN_1 (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
_this->invalidUCharBuffer[0] = (UChar) mySource[mySourceIndex++];
|
||||
_this->invalidUCharLength = 1;
|
||||
|
||||
@ -516,7 +516,7 @@ void T_UConverter_fromUnicode_LATIN_1 (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -564,7 +564,7 @@ void T_UConverter_fromUnicode_SBCS (UConverter * _this,
|
||||
else
|
||||
{
|
||||
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
_this->invalidUCharBuffer[0] = (UChar)mySource[mySourceIndex - 1];
|
||||
_this->invalidUCharLength = 1;
|
||||
|
||||
@ -588,7 +588,7 @@ void T_UConverter_fromUnicode_SBCS (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -661,7 +661,7 @@ void T_UConverter_toUnicode_EBCDIC_STATEFUL (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
if (mySourceChar > 0xff)
|
||||
{
|
||||
_this->invalidCharLength = 2;
|
||||
@ -692,7 +692,7 @@ void T_UConverter_toUnicode_EBCDIC_STATEFUL (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -706,7 +706,7 @@ void T_UConverter_toUnicode_EBCDIC_STATEFUL (UConverter * _this,
|
||||
{
|
||||
if (SUCCESS(*err))
|
||||
{
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
_this->toUnicodeStatus = 0x00;
|
||||
}
|
||||
}
|
||||
@ -788,7 +788,7 @@ void T_UConverter_toUnicode_EBCDIC_STATEFUL_OFFSETS_LOGIC (UConverter * _this,
|
||||
{
|
||||
int32_t currentOffset = offsets[myTargetIndex-1] + 2;/* Because mySourceIndex was already incremented */
|
||||
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
if (mySourceChar > 0xFF)
|
||||
{
|
||||
_this->invalidCharLength = 2;
|
||||
@ -820,7 +820,7 @@ void T_UConverter_toUnicode_EBCDIC_STATEFUL_OFFSETS_LOGIC (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -834,7 +834,7 @@ void T_UConverter_toUnicode_EBCDIC_STATEFUL_OFFSETS_LOGIC (UConverter * _this,
|
||||
{
|
||||
if (SUCCESS(*err))
|
||||
{
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
_this->toUnicodeStatus = 0x00;
|
||||
}
|
||||
}
|
||||
@ -911,7 +911,7 @@ void T_UConverter_toUnicode_MBCS (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
if (mySourceChar > 0xff)
|
||||
{
|
||||
_this->invalidCharLength = 2;
|
||||
@ -942,7 +942,7 @@ void T_UConverter_toUnicode_MBCS (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -956,7 +956,7 @@ void T_UConverter_toUnicode_MBCS (UConverter * _this,
|
||||
{
|
||||
if (SUCCESS(*err))
|
||||
{
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
_this->toUnicodeStatus = 0x00;
|
||||
}
|
||||
}
|
||||
@ -1047,7 +1047,7 @@ void T_UConverter_toUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
|
||||
{
|
||||
int32_t currentOffset = offsets[myTargetIndex-1] + ((oldMySourceChar>0x00FF)?2:1);
|
||||
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
if (mySourceChar > 0xff)
|
||||
{
|
||||
_this->invalidCharLength = 2;
|
||||
@ -1078,7 +1078,7 @@ void T_UConverter_toUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1092,7 +1092,7 @@ void T_UConverter_toUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
|
||||
{
|
||||
if (SUCCESS(*err))
|
||||
{
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
_this->toUnicodeStatus = 0x00;
|
||||
}
|
||||
}
|
||||
@ -1150,7 +1150,7 @@ void T_UConverter_fromUnicode_EBCDIC_STATEFUL (UConverter * _this,
|
||||
{
|
||||
_this->charErrorBuffer[0] = (char) targetUniChar;
|
||||
_this->charErrorBufferLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
else if (myTargetIndex+1 >= targetLength)
|
||||
@ -1158,7 +1158,7 @@ void T_UConverter_fromUnicode_EBCDIC_STATEFUL (UConverter * _this,
|
||||
_this->charErrorBuffer[0] = (char) (targetUniChar >> 8);
|
||||
_this->charErrorBuffer[1] = (char) targetUniChar & 0x00FF;
|
||||
_this->charErrorBufferLength = 2;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1179,7 +1179,7 @@ void T_UConverter_fromUnicode_EBCDIC_STATEFUL (UConverter * _this,
|
||||
{
|
||||
_this->charErrorBuffer[0] = (char) targetUniChar;
|
||||
_this->charErrorBufferLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1187,7 +1187,7 @@ void T_UConverter_fromUnicode_EBCDIC_STATEFUL (UConverter * _this,
|
||||
else
|
||||
{
|
||||
isTargetUCharDBCS = oldIsTargetUCharDBCS;
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
_this->invalidUCharBuffer[0] = (UChar) mySourceChar;
|
||||
_this->invalidUCharLength = 1;
|
||||
|
||||
@ -1209,7 +1209,7 @@ void T_UConverter_fromUnicode_EBCDIC_STATEFUL (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1273,7 +1273,7 @@ void T_UConverter_fromUnicode_EBCDIC_STATEFUL_OFFSETS_LOGIC (UConverter * _this,
|
||||
{
|
||||
_this->charErrorBuffer[0] = (char) targetUniChar;
|
||||
_this->charErrorBufferLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
else if (myTargetIndex+1 >= targetLength)
|
||||
@ -1281,7 +1281,7 @@ void T_UConverter_fromUnicode_EBCDIC_STATEFUL_OFFSETS_LOGIC (UConverter * _this,
|
||||
_this->charErrorBuffer[0] = (char) (targetUniChar >> 8);
|
||||
_this->charErrorBuffer[1] = (char) targetUniChar & 0x00FF;
|
||||
_this->charErrorBufferLength = 2;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1304,7 +1304,7 @@ void T_UConverter_fromUnicode_EBCDIC_STATEFUL_OFFSETS_LOGIC (UConverter * _this,
|
||||
{
|
||||
_this->charErrorBuffer[0] = (char) targetUniChar;
|
||||
_this->charErrorBufferLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1312,7 +1312,7 @@ void T_UConverter_fromUnicode_EBCDIC_STATEFUL_OFFSETS_LOGIC (UConverter * _this,
|
||||
else
|
||||
{
|
||||
int32_t currentOffset = offsets[myTargetIndex-1]+1;
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
_this->invalidUCharBuffer[0] = (UChar) mySourceChar;
|
||||
_this->invalidUCharLength = 1;
|
||||
|
||||
@ -1335,7 +1335,7 @@ void T_UConverter_fromUnicode_EBCDIC_STATEFUL_OFFSETS_LOGIC (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1399,13 +1399,13 @@ void T_UConverter_fromUnicode_MBCS (UConverter * _this,
|
||||
{
|
||||
_this->charErrorBuffer[0] = (char) targetUniChar;
|
||||
_this->charErrorBufferLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
_this->invalidUCharBuffer[0] = (UChar) mySourceChar;
|
||||
_this->invalidUCharLength = 1;
|
||||
|
||||
@ -1426,7 +1426,7 @@ void T_UConverter_fromUnicode_MBCS (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1495,7 +1495,7 @@ void T_UConverter_fromUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
|
||||
{
|
||||
_this->charErrorBuffer[0] = (char) targetUniChar;
|
||||
_this->charErrorBufferLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1504,7 +1504,7 @@ void T_UConverter_fromUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
|
||||
int32_t currentOffset = mySourceIndex -1;
|
||||
int32_t* offsetsAnchor = offsets;
|
||||
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
_this->invalidUCharBuffer[0] = (UChar) mySourceChar;
|
||||
_this->invalidUCharLength = 1;
|
||||
|
||||
@ -1525,7 +1525,7 @@ void T_UConverter_fromUnicode_MBCS_OFFSETS_LOGIC (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1692,7 +1692,7 @@ void changeState_2022(UConverter* _this,
|
||||
puts("INVALID_2022");
|
||||
#endif /*Debug*/
|
||||
_this->toUnicodeStatus = 0;
|
||||
*err = ILLEGAL_CHAR_FOUND;
|
||||
*err = U_ILLEGAL_CHAR_FOUND;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1867,7 +1867,7 @@ void T_UConverter_toUnicode_ISO_2022(UConverter* _this,
|
||||
if (FAILURE(*err)) return;
|
||||
if ((_this == NULL) || (targetLimit < *target) || (sourceLimit < *source))
|
||||
{
|
||||
*err = ILLEGAL_ARGUMENT_ERROR;
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1941,7 +1941,7 @@ void T_UConverter_toUnicode_ISO_2022_OFFSETS_LOGIC(UConverter* _this,
|
||||
if (FAILURE(*err)) return;
|
||||
if ((_this == NULL) || (targetLimit < *target) || (sourceLimit < *source))
|
||||
{
|
||||
*err = ILLEGAL_ARGUMENT_ERROR;
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2052,12 +2052,12 @@ void T_UConverter_fromUnicode_DBCS (UConverter * _this,
|
||||
{
|
||||
_this->charErrorBuffer[0] = (char) targetUniChar;
|
||||
_this->charErrorBufferLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
_this->invalidUCharBuffer[0] = (UChar) mySourceChar;
|
||||
_this->invalidUCharLength = 1;
|
||||
|
||||
@ -2080,7 +2080,7 @@ void T_UConverter_fromUnicode_DBCS (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2142,7 +2142,7 @@ void T_UConverter_fromUnicode_UTF8 (UConverter * _this,
|
||||
{
|
||||
_this->charErrorBuffer[0] = (char) ((ch & 0x3f) | 0x80);
|
||||
_this->charErrorBufferLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2185,14 +2185,14 @@ void T_UConverter_fromUnicode_UTF8 (UConverter * _this,
|
||||
else
|
||||
{
|
||||
_this->charErrorBuffer[_this->charErrorBufferLength++] = temp[i];
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2257,7 +2257,7 @@ void T_UConverter_fromUnicode_UTF8_OFFSETS_LOGIC (UConverter * _this,
|
||||
{
|
||||
_this->charErrorBuffer[0] = (char) ((ch & 0x3f) | 0x80);
|
||||
_this->charErrorBufferLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2301,14 +2301,14 @@ void T_UConverter_fromUnicode_UTF8_OFFSETS_LOGIC (UConverter * _this,
|
||||
else
|
||||
{
|
||||
_this->charErrorBuffer[_this->charErrorBufferLength++] = temp[i];
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2354,12 +2354,12 @@ void T_UConverter_fromUnicode_UTF16_BE (UConverter * _this,
|
||||
{
|
||||
_this->charErrorBuffer[0] = (char) mySourceChar;
|
||||
_this->charErrorBufferLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2404,12 +2404,12 @@ void T_UConverter_fromUnicode_UTF16_LE (UConverter * _this,
|
||||
{
|
||||
_this->charErrorBuffer[0] = (char) (mySourceChar >> 8);
|
||||
_this->charErrorBufferLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2464,7 +2464,7 @@ void T_UConverter_toUnicode_UTF16_BE (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2475,7 +2475,7 @@ void T_UConverter_toUnicode_UTF16_BE (UConverter * _this,
|
||||
{
|
||||
if (SUCCESS(*err))
|
||||
{
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
_this->toUnicodeStatus = 0x00;
|
||||
}
|
||||
}
|
||||
@ -2531,7 +2531,7 @@ void T_UConverter_toUnicode_UTF16_LE (UConverter * _this,
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2543,7 +2543,7 @@ void T_UConverter_toUnicode_UTF16_LE (UConverter * _this,
|
||||
{
|
||||
if (SUCCESS(*err))
|
||||
{
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
_this->toUnicodeStatus = 0x00;
|
||||
}
|
||||
}
|
||||
@ -2615,7 +2615,7 @@ void T_UConverter_toUnicode_UTF8 (UConverter * _this,
|
||||
{
|
||||
if (SUCCESS(*err))
|
||||
{
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
_this->toUnicodeStatus = 0x00;
|
||||
}
|
||||
}
|
||||
@ -2656,13 +2656,13 @@ void T_UConverter_toUnicode_UTF8 (UConverter * _this,
|
||||
{
|
||||
_this->invalidUCharBuffer[0] = (UChar) ch;
|
||||
_this->invalidUCharLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = ILLEGAL_CHAR_FOUND;
|
||||
*err = U_ILLEGAL_CHAR_FOUND;
|
||||
_this->invalidCharLength = (int8_t)i;
|
||||
|
||||
#ifdef Debug
|
||||
@ -2687,7 +2687,7 @@ void T_UConverter_toUnicode_UTF8 (UConverter * _this,
|
||||
else
|
||||
/* End of target buffer */
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2754,7 +2754,7 @@ void T_UConverter_toUnicode_UTF8_OFFSETS_LOGIC (UConverter * _this,
|
||||
{
|
||||
if (SUCCESS(*err))
|
||||
{
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
_this->toUnicodeStatus = 0x00;
|
||||
}
|
||||
}
|
||||
@ -2797,7 +2797,7 @@ void T_UConverter_toUnicode_UTF8_OFFSETS_LOGIC (UConverter * _this,
|
||||
{
|
||||
_this->invalidUCharBuffer[0] = (UChar) ch;
|
||||
_this->invalidUCharLength = 1;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2805,7 +2805,7 @@ void T_UConverter_toUnicode_UTF8_OFFSETS_LOGIC (UConverter * _this,
|
||||
{
|
||||
int32_t currentOffset = offsets[myTargetIndex-1];
|
||||
|
||||
*err = ILLEGAL_CHAR_FOUND;
|
||||
*err = U_ILLEGAL_CHAR_FOUND;
|
||||
_this->invalidCharLength = (int8_t)i;
|
||||
|
||||
/* Needed explicit cast for mySource on MVS to make compiler happy - JJD */
|
||||
@ -2829,7 +2829,7 @@ void T_UConverter_toUnicode_UTF8_OFFSETS_LOGIC (UConverter * _this,
|
||||
else
|
||||
/* End of target buffer */
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2884,7 +2884,7 @@ void flushInternalUnicodeBuffer (UConverter * _this,
|
||||
sizeof (UChar) * (myUCharErrorBufferLength - targetLength));
|
||||
_this->UCharErrorBufferLength -= (int8_t) targetLength;
|
||||
*myTargetIndex = targetLength;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
|
||||
return;
|
||||
@ -2930,7 +2930,7 @@ void flushInternalCharBuffer (UConverter * _this,
|
||||
(myCharErrorBufferLength - targetLength));
|
||||
_this->charErrorBufferLength -= (int8_t) targetLength;
|
||||
*myTargetIndex = targetLength;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
|
||||
return;
|
||||
@ -2948,7 +2948,7 @@ UChar T_UConverter_getNextUChar_SBCS(UConverter* converter,
|
||||
|
||||
if ((*source)+1 > sourceLimit)
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return 0xFFFD;
|
||||
}
|
||||
|
||||
@ -2962,7 +2962,7 @@ UChar T_UConverter_getNextUChar_SBCS(UConverter* converter,
|
||||
UChar* myUCharPtr = &myUChar;
|
||||
const char* sourceFinal = *source;
|
||||
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
|
||||
/*Calls the ErrorFunctor after rewinding the input buffer*/
|
||||
(*source)--;
|
||||
@ -2978,7 +2978,7 @@ UChar T_UConverter_getNextUChar_SBCS(UConverter* converter,
|
||||
err);
|
||||
|
||||
/*makes the internal caching transparent to the user*/
|
||||
if (*err == INDEX_OUTOFBOUNDS_ERROR) *err = ZERO_ERROR;
|
||||
if (*err == U_INDEX_OUTOFBOUNDS_ERROR) *err = U_ZERO_ERROR;
|
||||
|
||||
return myUChar;
|
||||
}
|
||||
@ -2997,7 +2997,7 @@ UChar T_UConverter_getNextUChar_LATIN_1(UConverter* converter,
|
||||
|
||||
if ((*source)+1 > sourceLimit)
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return 0xFFFD;
|
||||
}
|
||||
|
||||
@ -3013,7 +3013,7 @@ UChar T_UConverter_getNextUChar_ISO_2022(UConverter* converter,
|
||||
/*Arguments Check*/
|
||||
if (sourceLimit < *source)
|
||||
{
|
||||
*err = ILLEGAL_ARGUMENT_ERROR;
|
||||
*err = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return 0xFFFD;
|
||||
}
|
||||
|
||||
@ -3060,12 +3060,12 @@ UChar T_UConverter_getNextUChar_DBCS(UConverter* converter,
|
||||
if ((*source) >= sourceLimit)
|
||||
{
|
||||
/*Either caller has reached the end of the byte stream*/
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
else if (((*source)+1) == sourceLimit)
|
||||
{
|
||||
/* a character was cut in half*/
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
}
|
||||
|
||||
return 0xFFFD;
|
||||
@ -3086,7 +3086,7 @@ UChar T_UConverter_getNextUChar_DBCS(UConverter* converter,
|
||||
/*Calls the ErrorFunctor after rewinding the input buffer*/
|
||||
(*source) -= 2;
|
||||
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
|
||||
/*It's is very likely that the ErrorFunctor will write to the
|
||||
*internal buffers */
|
||||
@ -3099,7 +3099,7 @@ UChar T_UConverter_getNextUChar_DBCS(UConverter* converter,
|
||||
TRUE,
|
||||
err);
|
||||
/*makes the internal caching transparent to the user*/
|
||||
if (*err == INDEX_OUTOFBOUNDS_ERROR) *err = ZERO_ERROR;
|
||||
if (*err == U_INDEX_OUTOFBOUNDS_ERROR) *err = U_ZERO_ERROR;
|
||||
|
||||
return myUChar;
|
||||
}
|
||||
@ -3117,7 +3117,7 @@ UChar T_UConverter_getNextUChar_MBCS(UConverter* converter,
|
||||
/*Input boundary check*/
|
||||
if ((*source)+1 > sourceLimit)
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return 0xFFFD;
|
||||
}
|
||||
|
||||
@ -3135,7 +3135,7 @@ UChar T_UConverter_getNextUChar_MBCS(UConverter* converter,
|
||||
* and update the source ptr*/
|
||||
if ((*source + 2) > sourceLimit)
|
||||
{
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
return 0xFFFD;
|
||||
}
|
||||
|
||||
@ -3152,7 +3152,7 @@ UChar T_UConverter_getNextUChar_MBCS(UConverter* converter,
|
||||
const char* sourceFinal = *source;
|
||||
UChar* myUCharPtr = &myUChar;
|
||||
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
*source = sourceInitial;
|
||||
|
||||
/*It's is very likely that the ErrorFunctor will write to the
|
||||
@ -3167,7 +3167,7 @@ UChar T_UConverter_getNextUChar_MBCS(UConverter* converter,
|
||||
err);
|
||||
|
||||
/*makes the internal caching transparent to the user*/
|
||||
if (*err == INDEX_OUTOFBOUNDS_ERROR) *err = ZERO_ERROR;
|
||||
if (*err == U_INDEX_OUTOFBOUNDS_ERROR) *err = U_ZERO_ERROR;
|
||||
|
||||
return myUChar;
|
||||
}
|
||||
@ -3185,7 +3185,7 @@ UChar T_UConverter_getNextUChar_EBCDIC_STATEFUL(UConverter* converter,
|
||||
/*Input boundary check*/
|
||||
if ((*source)+1 > sourceLimit)
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return 0xFFFD;
|
||||
}
|
||||
|
||||
@ -3199,7 +3199,7 @@ UChar T_UConverter_getNextUChar_EBCDIC_STATEFUL(UConverter* converter,
|
||||
/*Rechecks boundary after consuming the shift sequence*/
|
||||
if ((*source)+1 > sourceLimit)
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return 0xFFFD;
|
||||
}
|
||||
}
|
||||
@ -3217,7 +3217,7 @@ UChar T_UConverter_getNextUChar_EBCDIC_STATEFUL(UConverter* converter,
|
||||
* and update the source ptr*/
|
||||
if ((*source + 2) > sourceLimit)
|
||||
{
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
return 0xFFFD;
|
||||
}
|
||||
|
||||
@ -3234,7 +3234,7 @@ UChar T_UConverter_getNextUChar_EBCDIC_STATEFUL(UConverter* converter,
|
||||
const char* sourceFinal = *source;
|
||||
UChar* myUCharPtr = &myUChar;
|
||||
|
||||
*err = INVALID_CHAR_FOUND;
|
||||
*err = U_INVALID_CHAR_FOUND;
|
||||
*source = sourceInitial;
|
||||
|
||||
/*It's is very likely that the ErrorFunctor will write to the
|
||||
@ -3249,7 +3249,7 @@ UChar T_UConverter_getNextUChar_EBCDIC_STATEFUL(UConverter* converter,
|
||||
err);
|
||||
|
||||
/*makes the internal caching transparent to the user*/
|
||||
if (*err == INDEX_OUTOFBOUNDS_ERROR) *err = ZERO_ERROR;
|
||||
if (*err == U_INDEX_OUTOFBOUNDS_ERROR) *err = U_ZERO_ERROR;
|
||||
|
||||
return myUChar;
|
||||
}
|
||||
@ -3267,12 +3267,12 @@ UChar T_UConverter_getNextUChar_UTF16_BE(UConverter* converter,
|
||||
if ((*source) >= sourceLimit)
|
||||
{
|
||||
/*Either caller has reached the end of the byte stream*/
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
else if (((*source)+1) == sourceLimit)
|
||||
{
|
||||
/* a character was cut in half*/
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
}
|
||||
|
||||
return 0xFFFD;
|
||||
@ -3299,12 +3299,12 @@ UChar T_UConverter_getNextUChar_UTF16_LE(UConverter* converter,
|
||||
if ((*source) >= sourceLimit)
|
||||
{
|
||||
/*Either caller has reached the end of the byte stream*/
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
else if (((*source)+1) == sourceLimit)
|
||||
{
|
||||
/* a character was cut in half*/
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
}
|
||||
|
||||
return 0xFFFD;
|
||||
@ -3334,7 +3334,7 @@ UChar T_UConverter_getNextUChar_UTF8(UConverter* converter,
|
||||
/*Input boundary check*/
|
||||
if ((*source)+1 > sourceLimit)
|
||||
{
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return 0xFFFD;
|
||||
}
|
||||
|
||||
@ -3348,7 +3348,7 @@ UChar T_UConverter_getNextUChar_UTF8(UConverter* converter,
|
||||
|
||||
if ((*source + extraBytesToWrite) > sourceLimit)
|
||||
{
|
||||
*err = TRUNCATED_CHAR_FOUND;
|
||||
*err = U_TRUNCATED_CHAR_FOUND;
|
||||
return 0xFFFD;
|
||||
}
|
||||
else
|
||||
@ -3416,7 +3416,7 @@ UChar T_UConverter_getNextUChar_UTF8(UConverter* converter,
|
||||
const char* sourceFinal = *source;
|
||||
UChar* myUCharPtr = &myUChar;
|
||||
|
||||
*err = ILLEGAL_CHAR_FOUND;
|
||||
*err = U_ILLEGAL_CHAR_FOUND;
|
||||
*source = sourceInitial;
|
||||
|
||||
/*It's is very likely that the ErrorFunctor will write to the
|
||||
@ -3431,10 +3431,8 @@ UChar T_UConverter_getNextUChar_UTF8(UConverter* converter,
|
||||
err);
|
||||
|
||||
/*makes the internal caching transparent to the user*/
|
||||
if (*err == INDEX_OUTOFBOUNDS_ERROR) *err = ZERO_ERROR;
|
||||
if (*err == U_INDEX_OUTOFBOUNDS_ERROR) *err = U_ZERO_ERROR;
|
||||
|
||||
return myUChar;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
bool_t
|
||||
CONVERSION_SUCCESS (UErrorCode err)
|
||||
{
|
||||
if ((err == INVALID_CHAR_FOUND) || (err == ILLEGAL_CHAR_FOUND)) return FALSE;
|
||||
if ((err == U_INVALID_CHAR_FOUND) || (err == U_ILLEGAL_CHAR_FOUND)) return FALSE;
|
||||
else return TRUE;
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ void MissingUnicodeAction_SKIP (UConverter * _this,
|
||||
UErrorCode * err)
|
||||
{
|
||||
if (CONVERSION_SUCCESS (*err)) return;
|
||||
*err = ZERO_ERROR;
|
||||
*err = U_ZERO_ERROR;
|
||||
}
|
||||
|
||||
void MissingUnicodeAction_SUBSTITUTE (UConverter * _this,
|
||||
@ -161,7 +161,7 @@ void MissingUnicodeAction_SUBSTITUTE (UConverter * _this,
|
||||
{
|
||||
icu_memcpy (*target, togo, togoLen);
|
||||
*target += togoLen;
|
||||
*err = ZERO_ERROR;
|
||||
*err = U_ZERO_ERROR;
|
||||
if (offsets)
|
||||
{
|
||||
int i=0;
|
||||
@ -188,7 +188,7 @@ void MissingUnicodeAction_SUBSTITUTE (UConverter * _this,
|
||||
togoLen - (targetLimit - *target));
|
||||
_this->charErrorBufferLength += togoLen - (targetLimit - *target);
|
||||
*target += (targetLimit - *target);
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
|
||||
return;
|
||||
@ -220,7 +220,7 @@ void MissingUnicodeAction_SUBSTITUTEwithValue (UConverter * _this,
|
||||
char myTarget[VALUE_STRING_LENGTH];
|
||||
char *myTargetAlias = myTarget;
|
||||
const UChar *myValueSource = NULL;
|
||||
UErrorCode err2 = ZERO_ERROR;
|
||||
UErrorCode err2 = U_ZERO_ERROR;
|
||||
uint32_t myFromUnicodeStatus = _this->fromUnicodeStatus;
|
||||
|
||||
|
||||
@ -284,7 +284,7 @@ void MissingUnicodeAction_SUBSTITUTEwithValue (UConverter * _this,
|
||||
{
|
||||
icu_memcpy (*target, myTarget, valueStringLength);
|
||||
*target += valueStringLength;
|
||||
*err = ZERO_ERROR;
|
||||
*err = U_ZERO_ERROR;
|
||||
|
||||
if (offsets)
|
||||
{
|
||||
@ -313,7 +313,7 @@ void MissingUnicodeAction_SUBSTITUTEwithValue (UConverter * _this,
|
||||
valueStringLength - (targetLimit - *target));
|
||||
_this->charErrorBufferLength += valueStringLength - (targetLimit - *target);
|
||||
*target += (targetLimit - *target);
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
|
||||
return;
|
||||
@ -331,7 +331,7 @@ void MissingCharAction_SKIP (UConverter * _this,
|
||||
UErrorCode * err)
|
||||
{
|
||||
if (CONVERSION_SUCCESS (*err)) return;
|
||||
*err = ZERO_ERROR;
|
||||
*err = U_ZERO_ERROR;
|
||||
}
|
||||
|
||||
void MissingCharAction_SUBSTITUTE (UConverter * _this,
|
||||
@ -351,13 +351,13 @@ void MissingCharAction_SUBSTITUTE (UConverter * _this,
|
||||
**target = 0xFFFD;
|
||||
(*target)++;
|
||||
if (offsets) *offsets = 0;
|
||||
*err = ZERO_ERROR;
|
||||
*err = U_ZERO_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
_this->UCharErrorBuffer[_this->UCharErrorBufferLength] = 0xFFFD;
|
||||
_this->UCharErrorBufferLength++;
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
|
||||
return;
|
||||
@ -407,7 +407,7 @@ void MissingCharAction_SUBSTITUTEwithValue (UConverter * _this,
|
||||
}
|
||||
*target += valueStringLength;
|
||||
|
||||
*err = ZERO_ERROR;
|
||||
*err = U_ZERO_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -428,15 +428,8 @@ void MissingCharAction_SUBSTITUTEwithValue (UConverter * _this,
|
||||
(sizeof (UChar)) * (valueStringLength - (targetLimit - *target)));
|
||||
_this->UCharErrorBufferLength += valueStringLength - (targetLimit - *target);
|
||||
*target += (targetLimit - *target);
|
||||
*err = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
* usage example:
|
||||
*
|
||||
* ...
|
||||
* UErrorCode err = ZERO_ERROR;
|
||||
* UErrorCode err = U_ZERO_ERROR;
|
||||
* UConverter* myConverter = T_UConverter_create("ibm-949", &err);
|
||||
*
|
||||
* if (SUCCESS(err))
|
||||
@ -79,7 +79,7 @@ CAPI void U_EXPORT2 MissingUnicodeAction_SKIP (UConverter * _this,
|
||||
|
||||
/* Functor Substitute the ILLEGAL SEQUENCE with the current substitution string assiciated with _this,
|
||||
* in the event target buffer is too small, it will store the extra info in the UConverter, and err
|
||||
* will be set to INDEX_OUTOFBOUNDS_ERROR. The next time T_UConverter_fromUnicode is called, it will
|
||||
* will be set to U_INDEX_OUTOFBOUNDS_ERROR. The next time T_UConverter_fromUnicode is called, it will
|
||||
* store the left over data in target, before transcoding the "source Stream"
|
||||
*/
|
||||
|
||||
@ -97,7 +97,7 @@ CAPI void U_EXPORT2 MissingUnicodeAction_SUBSTITUTE (UConverter * _this,
|
||||
* characters {u,%}[A-F][0-9], it will substitute the illegal sequence with the substitution characters
|
||||
* (it will behave like the above functor).
|
||||
* in the event target buffer is too small, it will store the extra info in the UConverter, and err
|
||||
* will be set to INDEX_OUTOFBOUNDS_ERROR. The next time T_UConverter_fromUnicode is called, it will
|
||||
* will be set to U_INDEX_OUTOFBOUNDS_ERROR. The next time T_UConverter_fromUnicode is called, it will
|
||||
* store the left over data in target, before transcoding the "source Stream"
|
||||
*/
|
||||
|
||||
@ -124,7 +124,7 @@ CAPI void U_EXPORT2 MissingCharAction_SKIP (UConverter * _this,
|
||||
|
||||
/* Functor Substitute the ILLEGAL SEQUENCE with the current substitution string assiciated with _this,
|
||||
* in the event target buffer is too small, it will store the extra info in the UConverter, and err
|
||||
* will be set to INDEX_OUTOFBOUNDS_ERROR. The next time T_UConverter_fromUnicode is called, it will
|
||||
* will be set to U_INDEX_OUTOFBOUNDS_ERROR. The next time T_UConverter_fromUnicode is called, it will
|
||||
* store the left over data in target, before transcoding the "source Stream"
|
||||
*/
|
||||
CAPI void U_EXPORT2 MissingCharAction_SUBSTITUTE (UConverter * _this,
|
||||
@ -139,7 +139,7 @@ CAPI void U_EXPORT2 MissingCharAction_SUBSTITUTE (UConverter * _this,
|
||||
/* Functor Substitute the ILLEGAL SEQUENCE with a sequence escaped codepoints corresponding to the
|
||||
* ILLEGAL SEQUENCE (format %XNN, e.g. "%XFF%X0A%XC8%X03").
|
||||
* in the event target buffer is too small, it will store the extra info in the UConverter, and err
|
||||
* will be set to INDEX_OUTOFBOUNDS_ERROR. The next time T_UConverter_fromUnicode is called, it will
|
||||
* will be set to U_INDEX_OUTOFBOUNDS_ERROR. The next time T_UConverter_fromUnicode is called, it will
|
||||
* store the left over data in target, before transcoding the "source Stream"
|
||||
*/
|
||||
|
||||
|
@ -128,7 +128,7 @@ void
|
||||
converterFile = T_FileStream_open (fullFileName, "r");
|
||||
if (converterFile == NULL)
|
||||
{
|
||||
*err = FILE_ACCESS_ERROR;
|
||||
*err = U_FILE_ACCESS_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -171,7 +171,7 @@ void
|
||||
toBeHashed = (char *) icu_malloc ((icu_strlen (actualNameToken) + 1) * sizeof (char));
|
||||
if (toBeHashed == NULL)
|
||||
{
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
icu_strcpy (toBeHashed, actualNameToken);
|
||||
@ -179,7 +179,7 @@ void
|
||||
(myAVAILABLE_CONVERTERS + 1) * sizeof (char *));
|
||||
if (myAVAILABLE_CONVERTERS_NAMES == NULL)
|
||||
{
|
||||
*err = MEMORY_ALLOCATION_ERROR;
|
||||
*err = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
myAVAILABLE_CONVERTERS_NAMES[myAVAILABLE_CONVERTERS++] = toBeHashed;
|
||||
@ -230,7 +230,7 @@ bool_t
|
||||
int32_t i = 0;
|
||||
bool_t found = FALSE;
|
||||
char *actualName = NULL;
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
||||
/*Lazy evaluates the Alias hashtable */
|
||||
if (ALIASNAMES_HASHTABLE == NULL)
|
||||
|
@ -97,7 +97,7 @@ uhash_openSize(UHashFunction func,
|
||||
|
||||
result = (UHashtable*) icu_malloc(sizeof(UHashtable));
|
||||
if(result == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ uhash_putKey(UHashtable *hash,
|
||||
if(hash->count > hash->highWaterMark) {
|
||||
if (hash->isGrowable) uhash_rehash(hash, status);
|
||||
else {
|
||||
*status = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*status = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return UHASH_INVALID;
|
||||
}
|
||||
}
|
||||
@ -216,7 +216,7 @@ uhash_put(UHashtable *hash,
|
||||
if(hash->count > hash->highWaterMark) {
|
||||
if (hash->isGrowable) uhash_rehash(hash, status);
|
||||
else {
|
||||
*status = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*status = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return UHASH_INVALID;
|
||||
}
|
||||
}
|
||||
@ -351,13 +351,13 @@ uhash_initialize(UHashtable *hash,
|
||||
|
||||
hash->values = (void**) icu_malloc(sizeof(void*) * hash->length);
|
||||
if(hash->values == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
hash->hashes = (int32_t*) icu_malloc(sizeof(int32_t) * hash->length);
|
||||
if(hash->values == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
icu_free(hash->values);
|
||||
return;
|
||||
}
|
||||
@ -566,5 +566,3 @@ uhash_hashLong(const void *parm)
|
||||
int32_t hash = (int32_t) parm;
|
||||
return (int32_t) (hash & 0x7FFFFFFF);
|
||||
}
|
||||
|
||||
|
||||
|
@ -209,7 +209,7 @@ int16_t _findIndex(const char* list, int32_t listLength, const char* key)
|
||||
const char* uloc_getDefault()
|
||||
{
|
||||
const char* result = _defaultLocale;
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
||||
/*lazy evaluates _defaultLocale*/
|
||||
if (result == NULL)
|
||||
@ -281,7 +281,7 @@ int32_t uloc_getParent(const char* localeID,
|
||||
/*Sets the error code on case of need*/
|
||||
if (i >= parentCapacity )
|
||||
{
|
||||
*err = BUFFER_OVERFLOW_ERROR;
|
||||
*err = U_BUFFER_OVERFLOW_ERROR;
|
||||
}
|
||||
|
||||
if (parentCapacity>0) parent[icu_min(i,parentCapacity-1)] = '\0';
|
||||
@ -314,7 +314,7 @@ uloc_getLanguage(const char* localeID,
|
||||
|
||||
if (i >= languageCapacity )
|
||||
{
|
||||
*err = BUFFER_OVERFLOW_ERROR;
|
||||
*err = U_BUFFER_OVERFLOW_ERROR;
|
||||
}
|
||||
|
||||
if (languageCapacity > 0)
|
||||
@ -362,7 +362,7 @@ int32_t uloc_getCountry(const char* localeID,
|
||||
|
||||
if (i >= countryCapacity )
|
||||
{
|
||||
*err = BUFFER_OVERFLOW_ERROR;
|
||||
*err = U_BUFFER_OVERFLOW_ERROR;
|
||||
}
|
||||
|
||||
if (countryCapacity > 0) {country[icu_min(i,countryCapacity-1)] = '\0';}
|
||||
@ -398,7 +398,7 @@ int32_t uloc_getVariant(const char* localeID,
|
||||
|
||||
if (i >= variantCapacity )
|
||||
{
|
||||
*err = BUFFER_OVERFLOW_ERROR;
|
||||
*err = U_BUFFER_OVERFLOW_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@ -414,7 +414,7 @@ int32_t uloc_getName(const char* localeID,
|
||||
int i= 0;
|
||||
int varSze = 0;
|
||||
int cntSze = 0;
|
||||
UErrorCode int_err = ZERO_ERROR;
|
||||
UErrorCode int_err = U_ZERO_ERROR;
|
||||
|
||||
if (FAILURE(*err)) return 0;
|
||||
/*First we preflight the components in order to ensure a valid return value*/
|
||||
@ -424,13 +424,13 @@ int32_t uloc_getName(const char* localeID,
|
||||
NULL ,
|
||||
0,
|
||||
&int_err);
|
||||
int_err = ZERO_ERROR;
|
||||
int_err = U_ZERO_ERROR;
|
||||
varSze = uloc_getVariant(localeID,
|
||||
NULL ,
|
||||
0,
|
||||
&int_err);
|
||||
|
||||
int_err = ZERO_ERROR;
|
||||
int_err = U_ZERO_ERROR;
|
||||
i = uloc_getLanguage(localeID,
|
||||
NULL,
|
||||
0,
|
||||
@ -443,7 +443,7 @@ int32_t uloc_getName(const char* localeID,
|
||||
if (varSze) i++;
|
||||
i += cntSze + varSze;
|
||||
|
||||
int_err = ZERO_ERROR;
|
||||
int_err = U_ZERO_ERROR;
|
||||
|
||||
uloc_getLanguage(localeID,
|
||||
name,
|
||||
@ -480,7 +480,7 @@ const char* uloc_getISO3Language(const char* localeID)
|
||||
{
|
||||
int16_t index;
|
||||
char lang[TEMPBUFSIZE];
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
||||
if (localeID == NULL) localeID = uloc_getDefault();
|
||||
uloc_getLanguage(localeID, lang, TEMPBUFSIZE, &err);
|
||||
@ -494,7 +494,7 @@ const char* uloc_getISO3Country(const char* localeID)
|
||||
{
|
||||
int16_t index;
|
||||
char cntry[TEMPBUFSIZE];
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
||||
if (localeID == NULL) localeID = uloc_getDefault();
|
||||
uloc_getCountry(localeID, cntry, TEMPBUFSIZE, &err);
|
||||
@ -507,7 +507,7 @@ const char* uloc_getISO3Country(const char* localeID)
|
||||
|
||||
uint32_t uloc_getLCID(const char* localeID)
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
char temp[30];
|
||||
const UChar* lcid = NULL;
|
||||
uint32_t result = 0;
|
||||
@ -540,7 +540,7 @@ int32_t uloc_getDisplayLanguage(const char* locale,
|
||||
bool_t doneDefaultLocale = FALSE;
|
||||
char inLanguageBuffer[TEMPBUFSIZE];
|
||||
char inLocaleBuffer[TEMPBUFSIZE];
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
UResourceBundle* bundle;
|
||||
const UChar* temp = NULL;
|
||||
bool_t isDefaultLocale = FALSE;
|
||||
@ -597,7 +597,7 @@ int32_t uloc_getDisplayLanguage(const char* locale,
|
||||
|
||||
if (SUCCESS(err))
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
temp = ures_getTaggedArrayItem(bundle,
|
||||
_kLanguages,
|
||||
inLanguageBuffer,
|
||||
@ -607,7 +607,7 @@ int32_t uloc_getDisplayLanguage(const char* locale,
|
||||
}
|
||||
|
||||
|
||||
err = ZERO_ERROR;
|
||||
err = U_ZERO_ERROR;
|
||||
|
||||
/*Iterates down the Locale ID*/
|
||||
|
||||
@ -623,7 +623,7 @@ int32_t uloc_getDisplayLanguage(const char* locale,
|
||||
i = u_strlen(result)+1;
|
||||
if (i > languageCapacity)
|
||||
{
|
||||
*status = BUFFER_OVERFLOW_ERROR;
|
||||
*status = U_BUFFER_OVERFLOW_ERROR;
|
||||
|
||||
if (languageCapacity >= 1)
|
||||
{
|
||||
@ -639,7 +639,7 @@ int32_t uloc_getDisplayLanguage(const char* locale,
|
||||
i = langBufSize;
|
||||
if (i > languageCapacity)
|
||||
{
|
||||
*status = BUFFER_OVERFLOW_ERROR;
|
||||
*status = U_BUFFER_OVERFLOW_ERROR;
|
||||
|
||||
if (languageCapacity >= 1)
|
||||
{
|
||||
@ -665,7 +665,7 @@ int32_t uloc_getDisplayCountry(const char* locale,
|
||||
int cntryBufSize;
|
||||
bool_t doneDefaultLocale = FALSE;
|
||||
char inCountryBuffer[TEMPBUFSIZE];
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
UResourceBundle* bundle = NULL;
|
||||
char inLocaleBuffer[TEMPBUFSIZE];
|
||||
bool_t isDefaultLocale = FALSE;
|
||||
@ -733,7 +733,7 @@ int32_t uloc_getDisplayCountry(const char* locale,
|
||||
ures_close(bundle);
|
||||
}
|
||||
|
||||
err = ZERO_ERROR;
|
||||
err = U_ZERO_ERROR;
|
||||
uloc_getParent(inLocale, inLocaleBuffer, TEMPBUFSIZE, &err);
|
||||
|
||||
inLocale = inLocaleBuffer;
|
||||
@ -745,7 +745,7 @@ int32_t uloc_getDisplayCountry(const char* locale,
|
||||
i = u_strlen(result)+1;
|
||||
if (i > countryCapacity)
|
||||
{
|
||||
*status = BUFFER_OVERFLOW_ERROR;
|
||||
*status = U_BUFFER_OVERFLOW_ERROR;
|
||||
|
||||
if (countryCapacity >= 1)
|
||||
{
|
||||
@ -761,7 +761,7 @@ int32_t uloc_getDisplayCountry(const char* locale,
|
||||
i = cntryBufSize;
|
||||
if (i > countryCapacity)
|
||||
{
|
||||
*status = BUFFER_OVERFLOW_ERROR;
|
||||
*status = U_BUFFER_OVERFLOW_ERROR;
|
||||
|
||||
if (countryCapacity >= 1)
|
||||
{
|
||||
@ -787,7 +787,7 @@ int32_t uloc_getDisplayVariant(const char* locale,
|
||||
bool_t doneDefaultLocale = FALSE;
|
||||
char inVariantBuffer[TEMPBUFSIZE];
|
||||
char* inVariant = inVariantBuffer;
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
UResourceBundle* bundle;
|
||||
char inLocaleBuffer[TEMPBUFSIZE];
|
||||
bool_t isDefaultLocale = FALSE;
|
||||
@ -816,7 +816,7 @@ int32_t uloc_getDisplayVariant(const char* locale,
|
||||
if (varBufSize > 1)
|
||||
{
|
||||
/*In case the variant is longer than our stack buffers*/
|
||||
if (err == BUFFER_OVERFLOW_ERROR)
|
||||
if (err == U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
inVariant = (char*)icu_malloc(varBufSize*sizeof(char)+1);
|
||||
if (inVariant == NULL) goto NO_MEMORY;
|
||||
@ -826,7 +826,7 @@ int32_t uloc_getDisplayVariant(const char* locale,
|
||||
icu_free(inVariant);
|
||||
goto NO_MEMORY;
|
||||
}
|
||||
err = ZERO_ERROR;
|
||||
err = U_ZERO_ERROR;
|
||||
uloc_getVariant(locale, inVariant, varBufSize, &err);
|
||||
}
|
||||
|
||||
@ -868,7 +868,7 @@ int32_t uloc_getDisplayVariant(const char* locale,
|
||||
ures_close(bundle);
|
||||
}
|
||||
|
||||
err = ZERO_ERROR;
|
||||
err = U_ZERO_ERROR;
|
||||
uloc_getParent(inLocale, inLocaleBuffer, TEMPBUFSIZE, &err);
|
||||
|
||||
inLocale = inLocaleBuffer;
|
||||
@ -884,7 +884,7 @@ int32_t uloc_getDisplayVariant(const char* locale,
|
||||
i = u_strlen(result)+1;
|
||||
if (i > variantCapacity)
|
||||
{
|
||||
*status = BUFFER_OVERFLOW_ERROR;
|
||||
*status = U_BUFFER_OVERFLOW_ERROR;
|
||||
|
||||
if (variantCapacity >= 1)
|
||||
{
|
||||
@ -900,7 +900,7 @@ int32_t uloc_getDisplayVariant(const char* locale,
|
||||
i = varBufSize;
|
||||
if (i > variantCapacity)
|
||||
{
|
||||
*status = BUFFER_OVERFLOW_ERROR;
|
||||
*status = U_BUFFER_OVERFLOW_ERROR;
|
||||
|
||||
if (variantCapacity >= 1)
|
||||
{
|
||||
@ -920,7 +920,7 @@ int32_t uloc_getDisplayVariant(const char* locale,
|
||||
return i;
|
||||
|
||||
NO_MEMORY:
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -930,13 +930,13 @@ int32_t uloc_getDisplayName(const char* locale,
|
||||
int32_t nameCapacity,
|
||||
UErrorCode* err)
|
||||
{
|
||||
UErrorCode int_err = ZERO_ERROR;
|
||||
UErrorCode int_err = U_ZERO_ERROR;
|
||||
int i = 0;
|
||||
int cntSze, varSze;
|
||||
bool_t has_lang = TRUE;
|
||||
int result_size;
|
||||
|
||||
int_err = ZERO_ERROR;
|
||||
int_err = U_ZERO_ERROR;
|
||||
|
||||
/*Preflights all the components*/
|
||||
cntSze = uloc_getDisplayCountry(locale,
|
||||
@ -944,14 +944,14 @@ int32_t uloc_getDisplayName(const char* locale,
|
||||
NULL ,
|
||||
0,
|
||||
&int_err);
|
||||
int_err = ZERO_ERROR;
|
||||
int_err = U_ZERO_ERROR;
|
||||
varSze = uloc_getDisplayVariant(locale,
|
||||
inLocale,
|
||||
NULL ,
|
||||
0,
|
||||
&int_err);
|
||||
|
||||
int_err = ZERO_ERROR;
|
||||
int_err = U_ZERO_ERROR;
|
||||
i = uloc_getDisplayLanguage(locale,
|
||||
inLocale,
|
||||
NULL,
|
||||
@ -974,7 +974,7 @@ int32_t uloc_getDisplayName(const char* locale,
|
||||
else i += cntSze + 3;
|
||||
}
|
||||
|
||||
int_err = ZERO_ERROR;
|
||||
int_err = U_ZERO_ERROR;
|
||||
|
||||
result_size = uloc_getDisplayLanguage(locale,
|
||||
inLocale,
|
||||
@ -1191,7 +1191,3 @@ uloc_setDataDirectory(const char* newDirectory)
|
||||
umtx_unlock(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -119,7 +119,7 @@
|
||||
* </P>
|
||||
* <blockquote>
|
||||
* <pre>
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . UNumberFormat *nf;
|
||||
* . const char* myLocale = "fr_FR";
|
||||
* .
|
||||
|
@ -759,7 +759,7 @@ UnicodeString::extract(UTextOffset start,
|
||||
const UChar *mySource = getArrayStart() + start;
|
||||
const UChar *mySourceEnd = mySource + length;
|
||||
char *myTarget = dst;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int32_t arraySize = 0x0FFFFFFF;
|
||||
|
||||
// create the converter
|
||||
@ -810,7 +810,7 @@ UnicodeString::doCodepageCreate(const char *codepageData,
|
||||
const char *mySource = codepageData;
|
||||
const char *mySourceEnd = mySource + sourceLen;
|
||||
UChar *myTarget = getArrayStart();
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int32_t arraySize = getCapacity();
|
||||
|
||||
// create the converter
|
||||
@ -835,7 +835,7 @@ UnicodeString::doCodepageCreate(const char *codepageData,
|
||||
// perform the conversion
|
||||
do {
|
||||
// reset the error code
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
|
||||
// perform the conversion
|
||||
ucnv_toUnicode(converter, &myTarget, myTarget + arraySize,
|
||||
@ -880,7 +880,7 @@ UnicodeString::doCodepageCreate(const char *codepageData,
|
||||
arraySize = getCapacity() - fLength;
|
||||
}
|
||||
}
|
||||
while(status == INDEX_OUTOFBOUNDS_ERROR);
|
||||
while(status == U_INDEX_OUTOFBOUNDS_ERROR);
|
||||
|
||||
fHashCode = kInvalidHashCode;
|
||||
|
||||
@ -1245,5 +1245,3 @@ operator<<(ostream& stream,
|
||||
stream.setf(saveFlags & ios::basefield, ios::basefield);
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
|
@ -69,7 +69,7 @@ CAPI const UChar* ures_get( const UResourceBundle* resourceBundle,
|
||||
if (FAILURE(*status)) return NULL;
|
||||
if (!resourceBundle || !resourceTag)
|
||||
{
|
||||
*status = ILLEGAL_ARGUMENT_ERROR;
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ CAPI const UChar* ures_getArrayItem(const UResourceBundle* resourceBundle,
|
||||
if (FAILURE(*status)) return NULL;
|
||||
if (!resourceBundle || !resourceTag || (resourceIndex < 0))
|
||||
{
|
||||
*status = ILLEGAL_ARGUMENT_ERROR;
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ CAPI const UChar* ures_get2dArrayItem(const UResourceBundle* resourceBundle,
|
||||
if (FAILURE(*status)) return NULL;
|
||||
if (!resourceBundle || !resourceTag || (rowIndex < 0) || (columnIndex < 0))
|
||||
{
|
||||
*status = ILLEGAL_ARGUMENT_ERROR;
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ CAPI const UChar* ures_getTaggedArrayItem(const UResourceBundle* resourceBundl
|
||||
if (FAILURE(*status)) return NULL;
|
||||
if (!resourceBundle || !resourceTag || !itemTag)
|
||||
{
|
||||
*status = ILLEGAL_ARGUMENT_ERROR;
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -179,7 +179,4 @@ extern "C" void T_ResourceBundle_getTaggedArrayUChars(const ResourceBundle* UR
|
||||
int32_t* numItems,
|
||||
UErrorCode* err);
|
||||
|
||||
|
||||
//eof
|
||||
|
||||
|
||||
|
@ -107,7 +107,7 @@
|
||||
* This is an example for using a possible custom resource:
|
||||
* <pre>
|
||||
* . const char *currentLocale;
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . UResourceBundle* myResources=ures_open("MyResources", currentLocale, &success );
|
||||
* .
|
||||
* . UChar *button1Title, *button2Title;
|
||||
@ -141,9 +141,9 @@ typedef void* UResourceBundle;
|
||||
* The UErrorCode err parameter is used to return status information to the user. To
|
||||
* check whether the construction succeeded or not, you should check the value of
|
||||
* SUCCESS(err). If you wish more detailed information, you can check for
|
||||
* informational error results which still indicate success. USING_FALLBACK_ERROR
|
||||
* informational error results which still indicate success. U_USING_FALLBACK_ERROR
|
||||
* indicates that a fall back locale was used. For example, 'de_CH' was requested,
|
||||
* but nothing was found there, so 'de' was used. USING_DEFAULT_ERROR indicates that
|
||||
* but nothing was found there, so 'de' was used. U_USING_DEFAULT_ERROR indicates that
|
||||
* the default locale data was used; neither the requested locale nor any of its
|
||||
* fall back locales could be found.
|
||||
*@return : a newly allocated resource bundle.
|
||||
@ -182,9 +182,9 @@ CAPI UResourceBundle* U_EXPORT2 ures_openW(const wchar_t* path,
|
||||
*@param resourceBundle: resourceBundle containing the desired string
|
||||
*@param resourceTag: key tagging the desired string
|
||||
*@param status: fills in the outgoing error code
|
||||
* could be <TT>MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be <TT>U_MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be a non-failing error
|
||||
* e.g.: <TT>USING_FALLBACK_ERROR</TT>,<TT>USING_DEFAULT_ERROR </TT>
|
||||
* e.g.: <TT>U_USING_FALLBACK_ERROR</TT>,<TT>U_USING_DEFAULT_ERROR </TT>
|
||||
*@return: a library-owned zero-terminated unicode string (its lifetime
|
||||
* is that of the resource bundle.)
|
||||
*@see ures_getArrayItem
|
||||
@ -202,9 +202,9 @@ CAPI const UChar* U_EXPORT2 ures_get(const UResourceBundle* resourceBundle,
|
||||
*@param resourceTag: key tagging the desired array
|
||||
*@param resourceIndex: index of the desired string
|
||||
*@param status: fills in the outgoing error code
|
||||
* could be <TT>MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be <TT>U_MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be a non-failing error
|
||||
* e.g.: <TT>USING_FALLBACK_ERROR</TT>,<TT>USING_DEFAULT_ERROR </TT>
|
||||
* e.g.: <TT>U_USING_FALLBACK_ERROR</TT>,<TT>U_USING_DEFAULT_ERROR </TT>
|
||||
*@return: a library-owned zero-terminated unicode string (its lifetime
|
||||
* is that of the resource bundle.)
|
||||
*@see ures_get
|
||||
@ -224,9 +224,9 @@ CAPI const UChar* U_EXPORT2 ures_getArrayItem(const UResourceBundle* resourc
|
||||
*@param resourceIndex: x index of the desired string
|
||||
*@param resourceIndex: y index of the desired string
|
||||
*@param status: fills in the outgoing error code
|
||||
* could be <TT>MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be <TT>U_MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be a non-failing error
|
||||
* e.g.: <TT>USING_FALLBACK_ERROR</TT>,<TT>USING_DEFAULT_ERROR </TT>
|
||||
* e.g.: <TT>U_USING_FALLBACK_ERROR</TT>,<TT>U_USING_DEFAULT_ERROR </TT>
|
||||
*@return: a library-owned zero-terminated unicode string (its lifetime
|
||||
* is that of the resource bundle.)
|
||||
*@see ures_get
|
||||
@ -247,9 +247,9 @@ CAPI const UChar* U_EXPORT2 ures_get2dArrayItem(const UResourceBundle* resourc
|
||||
*@param resourceTag: key tagging the desired array
|
||||
*@param resourceIndex: key tagging the desired string
|
||||
*@param status: fills in the outgoing error code
|
||||
* could be <TT>MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be <TT>U_MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be a non-failing error
|
||||
* e.g.: <TT>USING_FALLBACK_ERROR</TT>,<TT>USING_DEFAULT_ERROR </TT>
|
||||
* e.g.: <TT>U_USING_FALLBACK_ERROR</TT>,<TT>U_USING_DEFAULT_ERROR </TT>
|
||||
*@return: a library-owned zero-terminated unicode string (its lifetime
|
||||
* is that of the resource bundle.)
|
||||
*@see ures_get
|
||||
@ -270,9 +270,9 @@ CAPI const UChar* U_EXPORT2 ures_getTaggedArrayItem(const UResourceBundle* res
|
||||
*@param resourceBundle: resource bundle containing the desired strings
|
||||
*@param resourceKey: key tagging the resource
|
||||
*@param err: fills in the outgoing error code
|
||||
* could be <TT>MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be <TT>U_MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be a non-failing error
|
||||
* e.g.: <TT>USING_FALLBACK_ERROR</TT>,<TT>USING_DEFAULT_ERROR </TT>
|
||||
* e.g.: <TT>U_USING_FALLBACK_ERROR</TT>,<TT>U_USING_DEFAULT_ERROR </TT>
|
||||
*@return: for <STRONG>Arrays</STRONG>: returns the number of strings in the array
|
||||
* <STRONG>2d Arrays</STRONG>: returns the number of 1d arrays
|
||||
* <STRONG>taggedArrays</STRONG>: returns the number of strings in the array
|
||||
@ -291,9 +291,9 @@ CAPI int32_t U_EXPORT2 ures_countArrayItems(const UResourceBundle* resourceBundl
|
||||
* on this particular bundle are INVALID henceforth.
|
||||
* @param resourceBundle: a succesfully opened resourceBundle.
|
||||
* @param status: fills in the outgoing error code
|
||||
* could be <TT>MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be <TT>U_MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be a non-failing error
|
||||
* e.g.: <TT>USING_FALLBACK_ERROR</TT>,<TT>USING_DEFAULT_ERROR </TT>
|
||||
* e.g.: <TT>U_USING_FALLBACK_ERROR</TT>,<TT>U_USING_DEFAULT_ERROR </TT>
|
||||
* @see ures_open
|
||||
* @see ures_openW
|
||||
*/
|
||||
@ -319,6 +319,3 @@ CAPI void U_EXPORT2 ures_close(UResourceBundle* resourceBundle);
|
||||
CAPI const char* U_EXPORT2 ures_getVersionNumber(const UResourceBundle* resourceBundle);
|
||||
#endif /*_URES*/
|
||||
/*eof*/
|
||||
|
||||
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
|
||||
static UConverter* _defaultConverter = NULL;
|
||||
static UErrorCode gErr = ZERO_ERROR;
|
||||
static UErrorCode gErr = U_ZERO_ERROR;
|
||||
|
||||
#define MAX_STRLEN 0x00FFFFFF
|
||||
|
||||
@ -134,7 +134,7 @@ u_strlen(const UChar *s)
|
||||
UChar* u_uastrcpy(UChar *ucs1,
|
||||
const char *s2 )
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
ucnv_toUChars(defaultConverter,
|
||||
ucs1,
|
||||
MAX_STRLEN,
|
||||
@ -149,7 +149,7 @@ UChar* u_uastrncpy(UChar *ucs1,
|
||||
const char *s2 ,
|
||||
int32_t n)
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
int32_t end = ucnv_toUChars(defaultConverter,
|
||||
ucs1,
|
||||
n,
|
||||
@ -165,7 +165,7 @@ char* u_austrcpy(char *s1,
|
||||
const UChar *ucs2 )
|
||||
{
|
||||
char * anchor = s1; /* save the start of result string */
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
int32_t len = ucnv_fromUChars(defaultConverter,
|
||||
s1,
|
||||
MAX_STRLEN,
|
||||
|
@ -104,6 +104,17 @@
|
||||
|
||||
|
||||
|
||||
/* Define NULL pointer value if it isn't already defined */
|
||||
|
||||
#ifndef NULL
|
||||
#ifdef XP_CPLUSPLUS
|
||||
#define NULL 0
|
||||
#else
|
||||
#define NULL ((void *)0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Calendar/TimeZone data types */
|
||||
/*===========================================================================*/
|
||||
@ -197,25 +208,30 @@ typedef void* ClassID;
|
||||
|
||||
/** Error code to replace exception handling */
|
||||
enum UErrorCode {
|
||||
ZERO_ERROR = 0,
|
||||
ILLEGAL_ARGUMENT_ERROR = 1, /* Start of codes indicating failure */
|
||||
MISSING_RESOURCE_ERROR = 2,
|
||||
INVALID_FORMAT_ERROR = 3,
|
||||
FILE_ACCESS_ERROR = 4,
|
||||
INTERNAL_PROGRAM_ERROR = 5, /* Indicates a bug in the library code */
|
||||
MESSAGE_PARSE_ERROR = 6,
|
||||
MEMORY_ALLOCATION_ERROR = 7, /* Memory allocation error */
|
||||
INDEX_OUTOFBOUNDS_ERROR = 8,
|
||||
PARSE_ERROR = 9, /* Equivalent to Java ParseException */
|
||||
INVALID_CHAR_FOUND = 10, /* In the Character conversion routines: Invalid character or sequence was encountered*/
|
||||
TRUNCATED_CHAR_FOUND = 11, /* In the Character conversion routines: More bytes are required to complete the conversion successfully*/
|
||||
ILLEGAL_CHAR_FOUND = 12, /* In codeset conversion: a sequence that does NOT belong in the codepage has been encountered*/
|
||||
INVALID_TABLE_FORMAT = 13, /*Conversion table file found, nut corrupted*/
|
||||
INVALID_TABLE_FILE = 14, /*Conversion table file not found*/
|
||||
BUFFER_OVERFLOW_ERROR = 15, /* A result would not fit in the supplied buffer */
|
||||
UNSUPPORTED_ERROR = 16, /* Requested operation not supported in current context */
|
||||
USING_FALLBACK_ERROR = -128, /* Start of information results (semantically successful) */
|
||||
USING_DEFAULT_ERROR = -127
|
||||
U_ERROR_INFO_START = -128, /* Start of information results (semantically successful) */
|
||||
U_USING_FALLBACK_ERROR = -128,
|
||||
U_USING_DEFAULT_ERROR = -127,
|
||||
U_ERROR_INFO_LIMIT,
|
||||
|
||||
U_ZERO_ERROR = 0, /* success */
|
||||
|
||||
U_ILLEGAL_ARGUMENT_ERROR = 1, /* Start of codes indicating failure */
|
||||
U_MISSING_RESOURCE_ERROR = 2,
|
||||
U_INVALID_FORMAT_ERROR = 3,
|
||||
U_FILE_ACCESS_ERROR = 4,
|
||||
U_INTERNAL_PROGRAM_ERROR = 5, /* Indicates a bug in the library code */
|
||||
U_MESSAGE_PARSE_ERROR = 6,
|
||||
U_MEMORY_ALLOCATION_ERROR = 7, /* Memory allocation error */
|
||||
U_INDEX_OUTOFBOUNDS_ERROR = 8,
|
||||
U_PARSE_ERROR = 9, /* Equivalent to Java ParseException */
|
||||
U_INVALID_CHAR_FOUND = 10, /* In the Character conversion routines: Invalid character or sequence was encountered*/
|
||||
U_TRUNCATED_CHAR_FOUND = 11, /* In the Character conversion routines: More bytes are required to complete the conversion successfully*/
|
||||
U_ILLEGAL_CHAR_FOUND = 12, /* In codeset conversion: a sequence that does NOT belong in the codepage has been encountered*/
|
||||
U_INVALID_TABLE_FORMAT = 13, /* Conversion table file found, but corrupted*/
|
||||
U_INVALID_TABLE_FILE = 14, /* Conversion table file not found*/
|
||||
U_BUFFER_OVERFLOW_ERROR = 15, /* A result would not fit in the supplied buffer */
|
||||
U_UNSUPPORTED_ERROR = 16, /* Requested operation not supported in current context */
|
||||
U_ERROR_LIMIT
|
||||
};
|
||||
|
||||
#ifndef XP_CPLUSPLUS
|
||||
@ -225,11 +241,11 @@ typedef enum UErrorCode UErrorCode;
|
||||
/* Use the following to determine if an UErrorCode represents */
|
||||
/* operational success or failure. */
|
||||
#ifdef XP_CPLUSPLUS
|
||||
inline bool_t SUCCESS(UErrorCode code) { return (bool_t)(code<=ZERO_ERROR); }
|
||||
inline bool_t FAILURE(UErrorCode code) { return (bool_t)(code>ZERO_ERROR); }
|
||||
inline bool_t SUCCESS(UErrorCode code) { return (bool_t)(code<=U_ZERO_ERROR); }
|
||||
inline bool_t FAILURE(UErrorCode code) { return (bool_t)(code>U_ZERO_ERROR); }
|
||||
#else
|
||||
#define SUCCESS(x) ((x)<=ZERO_ERROR)
|
||||
#define FAILURE(x) ((x)>ZERO_ERROR)
|
||||
#define SUCCESS(x) ((x)<=U_ZERO_ERROR)
|
||||
#define FAILURE(x) ((x)>U_ZERO_ERROR)
|
||||
#endif
|
||||
|
||||
|
||||
@ -296,42 +312,56 @@ icu_arrayCopy(const UChar *src, int32_t srcStart,
|
||||
/* This function is useful for debugging; it returns the text name */
|
||||
/* of an UErrorCode result. This is not the most efficient way of */
|
||||
/* doing this but it's just for Debug builds anyway. */
|
||||
#if defined(_DEBUG) && defined(XP_CPLUSPLUS)
|
||||
inline const char* errorName(UErrorCode code)
|
||||
{
|
||||
switch (code) {
|
||||
case ZERO_ERROR: return "ZERO_ERROR";
|
||||
case ILLEGAL_ARGUMENT_ERROR: return "ILLEGAL_ARGUMENT_ERROR";
|
||||
case MISSING_RESOURCE_ERROR: return "MISSING_RESOURCE_ERROR";
|
||||
case INVALID_FORMAT_ERROR: return "INVALID_FORMAT_ERROR";
|
||||
case FILE_ACCESS_ERROR: return "FILE_ACCESS_ERROR";
|
||||
case INTERNAL_PROGRAM_ERROR: return "INTERNAL_PROGRAM_ERROR";
|
||||
case MESSAGE_PARSE_ERROR: return "MESSAGE_PARSE_ERROR";
|
||||
case MEMORY_ALLOCATION_ERROR: return "MEMORY_ALLOCATION_ERROR";
|
||||
case PARSE_ERROR: return "PARSE_ERROR";
|
||||
case INVALID_CHAR_FOUND: return "INVALID_CHAR_FOUND";
|
||||
case TRUNCATED_CHAR_FOUND: return "TRUNCATED_CHAR_FOUND";
|
||||
case ILLEGAL_CHAR_FOUND: return "ILLEGAL_CHAR_FOUND";
|
||||
case INVALID_TABLE_FORMAT: return "INVALID_TABLE_FORMAT";
|
||||
case INVALID_TABLE_FILE: return "INVALID_TABLE_FILE";
|
||||
case BUFFER_OVERFLOW_ERROR: return "BUFFER_OVERFLOW_ERROR";
|
||||
case USING_FALLBACK_ERROR: return "USING_FALLBACK_ERROR";
|
||||
case USING_DEFAULT_ERROR: return "USING_DEFAULT_ERROR";
|
||||
default: return "[BOGUS UErrorCode]";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Define NULL pointer value if it isn't already defined */
|
||||
/* Do not use these arrays directly: they will move to a .c file! */
|
||||
static const char *
|
||||
_uErrorInfoName[U_ERROR_INFO_LIMIT-U_ERROR_INFO_START]={
|
||||
"U_USING_FALLBACK_ERROR",
|
||||
"U_USING_DEFAULT_ERROR"
|
||||
};
|
||||
|
||||
static const char *
|
||||
_uErrorName[U_ERROR_LIMIT]={
|
||||
"U_ZERO_ERROR",
|
||||
|
||||
"U_ILLEGAL_ARGUMENT_ERROR",
|
||||
"U_MISSING_RESOURCE_ERROR",
|
||||
"U_INVALID_FORMAT_ERROR",
|
||||
"U_FILE_ACCESS_ERROR",
|
||||
"U_INTERNAL_PROGRAM_ERROR",
|
||||
"U_MESSAGE_PARSE_ERROR",
|
||||
"U_MEMORY_ALLOCATION_ERROR",
|
||||
"U_INDEX_OUTOFBOUNDS_ERROR",
|
||||
"U_PARSE_ERROR",
|
||||
"U_INVALID_CHAR_FOUND",
|
||||
"U_TRUNCATED_CHAR_FOUND",
|
||||
"U_ILLEGAL_CHAR_FOUND",
|
||||
"U_INVALID_TABLE_FORMAT",
|
||||
"U_INVALID_TABLE_FILE",
|
||||
"U_BUFFER_OVERFLOW_ERROR",
|
||||
"U_UNSUPPORTED_ERROR"
|
||||
};
|
||||
|
||||
#ifndef NULL
|
||||
#ifdef XP_CPLUSPLUS
|
||||
#define NULL 0
|
||||
inline const char *
|
||||
errorName(UErrorCode code)
|
||||
{
|
||||
if(code>=0 && code<U_ERROR_LIMIT) {
|
||||
return _uErrorName[code];
|
||||
} else if(code>=U_ERROR_INFO_START && code<U_ERROR_INFO_LIMIT) {
|
||||
return _uErrorInfoName[code];
|
||||
} else {
|
||||
return "[BOGUS UErrorCode]";
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define NULL ((void *)0)
|
||||
# define errorName(code) \
|
||||
((code)>=0 && (code)<U_ERROR_LIMIT) ? \
|
||||
_uErrorName[code] : \
|
||||
((code)>=U_ERROR_INFO_START && (code)<U_ERROR_INFO_LIMIT) ? \
|
||||
_uErrorInfoName[code] : \
|
||||
"[BOGUS UErrorCode]"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Include header for platform utilies */
|
||||
@ -340,7 +370,3 @@ inline const char* errorName(UErrorCode code)
|
||||
#include "putil.h"
|
||||
|
||||
#endif /* _UTYPES */
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -56,7 +56,7 @@ ULocaleBundle*
|
||||
u_locbund_clone(const ULocaleBundle *bundle)
|
||||
{
|
||||
ULocaleBundle *result = (ULocaleBundle*)malloc(sizeof(ULocaleBundle));
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
if(result == 0)
|
||||
return 0;
|
||||
@ -119,7 +119,7 @@ u_locbund_delete(ULocaleBundle *bundle)
|
||||
UNumberFormat*
|
||||
u_locbund_getNumberFormat(ULocaleBundle *bundle)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
if(bundle->fNumberFormat == 0) {
|
||||
bundle->fNumberFormat = unum_open(UNUM_DEFAULT, bundle->fLocale, &status);
|
||||
@ -133,7 +133,7 @@ u_locbund_getNumberFormat(ULocaleBundle *bundle)
|
||||
UNumberFormat*
|
||||
u_locbund_getPercentFormat(ULocaleBundle *bundle)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
if(bundle->fPercentFormat == 0) {
|
||||
bundle->fPercentFormat = unum_open(UNUM_PERCENT, bundle->fLocale, &status);
|
||||
@ -147,7 +147,7 @@ u_locbund_getPercentFormat(ULocaleBundle *bundle)
|
||||
UNumberFormat*
|
||||
u_locbund_getCurrencyFormat(ULocaleBundle *bundle)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
if(bundle->fCurrencyFormat == 0) {
|
||||
bundle->fCurrencyFormat = unum_open(UNUM_CURRENCY, bundle->fLocale,
|
||||
@ -164,7 +164,7 @@ u_locbund_getCurrencyFormat(ULocaleBundle *bundle)
|
||||
UNumberFormat*
|
||||
u_locbund_getScientificFormat(ULocaleBundle *bundle)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar pattern [PAT_SIZE];
|
||||
|
||||
if(bundle->fScientificFormat == 0) {
|
||||
@ -184,7 +184,7 @@ u_locbund_getScientificFormat(ULocaleBundle *bundle)
|
||||
UNumberFormat*
|
||||
u_locbund_getSpelloutFormat(ULocaleBundle *bundle)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
if(bundle->fSpelloutFormat == 0) {
|
||||
bundle->fSpelloutFormat = unum_open(UNUM_SPELLOUT, bundle->fLocale,
|
||||
@ -197,7 +197,7 @@ u_locbund_getSpelloutFormat(ULocaleBundle *bundle)
|
||||
UDateFormat*
|
||||
u_locbund_getDateFormat(ULocaleBundle *bundle)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
if(bundle->fDateFormat == 0) {
|
||||
bundle->fDateFormat = udat_open(UDAT_NONE, UDAT_DEFAULT,
|
||||
@ -210,7 +210,7 @@ u_locbund_getDateFormat(ULocaleBundle *bundle)
|
||||
UDateFormat*
|
||||
u_locbund_getTimeFormat(ULocaleBundle *bundle)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
if(bundle->fTimeFormat == 0) {
|
||||
bundle->fTimeFormat = udat_open(UDAT_DEFAULT, UDAT_NONE,
|
||||
|
@ -44,7 +44,7 @@ u_loccache_get(const char *loc)
|
||||
UHashtable *tempCache;
|
||||
int32_t locCount;
|
||||
int32_t hashKey;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
/* Create the cache, if needed */
|
||||
if(gLocaleCache == 0) {
|
||||
|
@ -127,7 +127,7 @@ u_fopen(const char *filename,
|
||||
const char *locale,
|
||||
const char *codepage)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
bool_t useSysCP = (locale == 0 && codepage == 0);
|
||||
UFILE *result = (UFILE*) malloc(sizeof(UFILE));
|
||||
if(result == 0)
|
||||
@ -182,7 +182,7 @@ u_finit(FILE *f,
|
||||
const char *locale,
|
||||
const char *codepage)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
bool_t useSysCP = (locale == 0 && codepage == 0);
|
||||
UFILE *result = (UFILE*) malloc(sizeof(UFILE));
|
||||
if(result == 0)
|
||||
@ -269,7 +269,7 @@ u_fsetlocale(const char *locale,
|
||||
const char*
|
||||
u_fgetcodepage(UFILE *file)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
const char *codepage;
|
||||
|
||||
codepage = ucnv_getName(file->fConverter, &status);
|
||||
@ -281,7 +281,7 @@ int32_t
|
||||
u_fsetcodepage( const char *codepage,
|
||||
UFILE *file)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
/* if the codepage is 0, use the default for the locale */
|
||||
if(codepage == 0) {
|
||||
|
@ -136,7 +136,7 @@ ufmt_defaultCPToUnicode(const char *s,
|
||||
int32_t size;
|
||||
UChar *target, *alias;
|
||||
UConverter *defConverter;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
defConverter = ucnv_open(ucnv_getDefaultName(), &status);
|
||||
if(FAILURE(status) || defConverter == 0)
|
||||
@ -170,7 +170,7 @@ ufmt_unicodeToDefaultCP(const UChar *s,
|
||||
char *target, *alias;
|
||||
const UChar *consumed = 0;
|
||||
UConverter *defConverter;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
defConverter = ucnv_open(ucnv_getDefaultName(), &status);
|
||||
if(FAILURE(status) || defConverter == 0)
|
||||
|
@ -231,7 +231,7 @@ u_printf_integer_handler(UFILE *stream,
|
||||
UNumberFormat *format;
|
||||
UChar result [UFPRINTF_BUFFER_SIZE];
|
||||
int32_t i, minDigits = -1;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* mask off any necessary bits */
|
||||
@ -471,7 +471,7 @@ u_printf_double_handler(UFILE *stream,
|
||||
UChar result [UFPRINTF_BUFFER_SIZE];
|
||||
int32_t i, minDecimalDigits;
|
||||
int32_t maxDecimalDigits;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
/* mask off any necessary bits */
|
||||
/* if(! info->fIsLongDouble)
|
||||
@ -701,7 +701,7 @@ u_printf_scientific_handler(UFILE *stream,
|
||||
UChar result [UFPRINTF_BUFFER_SIZE];
|
||||
int32_t i, minDecimalDigits;
|
||||
int32_t maxDecimalDigits;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* mask off any necessary bits */
|
||||
@ -810,7 +810,7 @@ u_printf_date_handler(UFILE *stream,
|
||||
UDateFormat *format;
|
||||
UChar result [UFPRINTF_BUFFER_SIZE];
|
||||
int32_t i;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* get the formatter */
|
||||
@ -872,7 +872,7 @@ u_printf_time_handler(UFILE *stream,
|
||||
UDateFormat *format;
|
||||
UChar result [UFPRINTF_BUFFER_SIZE];
|
||||
int32_t i;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* get the formatter */
|
||||
@ -936,7 +936,7 @@ u_printf_percent_handler(UFILE *stream,
|
||||
UChar result [UFPRINTF_BUFFER_SIZE];
|
||||
int32_t i, minDecimalDigits;
|
||||
int32_t maxDecimalDigits;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* mask off any necessary bits */
|
||||
@ -1047,7 +1047,7 @@ u_printf_currency_handler(UFILE *stream,
|
||||
UChar result [UFPRINTF_BUFFER_SIZE];
|
||||
int32_t i, minDecimalDigits;
|
||||
int32_t maxDecimalDigits;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* mask off any necessary bits */
|
||||
@ -1349,7 +1349,7 @@ u_printf_spellout_handler(UFILE *stream,
|
||||
UChar result [UFPRINTF_BUFFER_SIZE];
|
||||
int32_t i, minDecimalDigits;
|
||||
int32_t maxDecimalDigits;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* mask off any necessary bits */
|
||||
|
@ -180,11 +180,11 @@ u_scanf_string_handler(UFILE *stream,
|
||||
int32_t count;
|
||||
const UChar *source;
|
||||
UConverter *conv;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
char *arg = (char*)(args[0].ptrValue);
|
||||
char *alias = arg;
|
||||
char *limit;
|
||||
|
||||
|
||||
/* skip all ws in the stream */
|
||||
u_scanf_skip_leading_ws(stream, info->fPadChar);
|
||||
|
||||
@ -343,7 +343,7 @@ u_scanf_integer_handler(UFILE *stream,
|
||||
long *num = (long*) (args[0].ptrValue);
|
||||
UNumberFormat *format;
|
||||
int32_t parsePos = 0;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* skip all ws in the stream */
|
||||
@ -407,7 +407,7 @@ u_scanf_double_handler(UFILE *stream,
|
||||
double *num = (double*) (args[0].ptrValue);
|
||||
UNumberFormat *format;
|
||||
int32_t parsePos = 0;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* skip all ws in the stream */
|
||||
@ -469,7 +469,7 @@ u_scanf_scientific_handler(UFILE *stream,
|
||||
double *num = (double*) (args[0].ptrValue);
|
||||
UNumberFormat *format;
|
||||
int32_t parsePos = 0;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* skip all ws in the stream */
|
||||
@ -532,8 +532,8 @@ u_scanf_scidbl_handler(UFILE *stream,
|
||||
UNumberFormat *scientificFormat, *genericFormat;
|
||||
int32_t scientificResult, genericResult;
|
||||
int32_t scientificParsePos = 0, genericParsePos = 0;
|
||||
UErrorCode scientificStatus = ZERO_ERROR;
|
||||
UErrorCode genericStatus = ZERO_ERROR;
|
||||
UErrorCode scientificStatus = U_ZERO_ERROR;
|
||||
UErrorCode genericStatus = U_ZERO_ERROR;
|
||||
bool_t useScientific;
|
||||
|
||||
|
||||
@ -614,7 +614,7 @@ u_scanf_currency_handler(UFILE *stream,
|
||||
double *num = (double*) (args[0].ptrValue);
|
||||
UNumberFormat *format;
|
||||
int32_t parsePos = 0;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* skip all ws in the stream */
|
||||
@ -676,7 +676,7 @@ u_scanf_percent_handler(UFILE *stream,
|
||||
double *num = (double*) (args[0].ptrValue);
|
||||
UNumberFormat *format;
|
||||
int32_t parsePos = 0;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* skip all ws in the stream */
|
||||
@ -738,7 +738,7 @@ u_scanf_date_handler(UFILE *stream,
|
||||
UDate *date = (UDate*) (args[0].ptrValue);
|
||||
UDateFormat *format;
|
||||
int32_t parsePos = 0;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* skip all ws in the stream */
|
||||
@ -796,7 +796,7 @@ u_scanf_time_handler(UFILE *stream,
|
||||
UDate *time = (UDate*) (args[0].ptrValue);
|
||||
UDateFormat *format;
|
||||
int32_t parsePos = 0;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* skip all ws in the stream */
|
||||
@ -939,7 +939,7 @@ u_scanf_spellout_handler(UFILE *stream,
|
||||
double *num = (double*) (args[0].ptrValue);
|
||||
UNumberFormat *format;
|
||||
int32_t parsePos = 0;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* skip all ws in the stream */
|
||||
@ -1168,7 +1168,7 @@ u_scanf_scanset_handler(UFILE *stream,
|
||||
UChar c;
|
||||
const UChar *source;
|
||||
UConverter *conv;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
char *s = (char*) (args[0].ptrValue);
|
||||
char *alias, *limit;
|
||||
|
||||
|
@ -61,7 +61,7 @@ u_file_write( const UChar *chars,
|
||||
UFILE *f)
|
||||
{
|
||||
/* Set up conversion parameters */
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
const UChar *mySource = chars;
|
||||
const UChar *sourceAlias = chars;
|
||||
const UChar *mySourceEnd = chars + count;
|
||||
@ -71,7 +71,7 @@ u_file_write( const UChar *chars,
|
||||
|
||||
/* Perform the conversion in a loop */
|
||||
do {
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
sourceAlias = mySource;
|
||||
|
||||
ucnv_fromUnicode(f->fConverter,
|
||||
@ -92,7 +92,7 @@ u_file_write( const UChar *chars,
|
||||
written += (myTarget - f->fCharBuffer);
|
||||
myTarget = f->fCharBuffer;
|
||||
}
|
||||
while(status == INDEX_OUTOFBOUNDS_ERROR);
|
||||
while(status == U_INDEX_OUTOFBOUNDS_ERROR);
|
||||
|
||||
/* return # of chars written */
|
||||
return written;
|
||||
@ -134,7 +134,7 @@ ufile_fill_uchar_buffer(UFILE *f)
|
||||
f->fFile);
|
||||
|
||||
/* Set up conversion parameters */
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
mySource = f->fCharBuffer;
|
||||
mySourceEnd = f->fCharBuffer + bytesRead;
|
||||
myTarget = f->fUCBuffer + dataSize;
|
||||
@ -336,8 +336,3 @@ u_file_read( UChar *chars,
|
||||
|
||||
return read;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -114,7 +114,7 @@ Calendar::Calendar(TimeZone* zone, const Locale& aLocale, UErrorCode& success)
|
||||
fNextStamp(kMinimumUserStamp)
|
||||
{
|
||||
if(zone == 0) {
|
||||
success = ILLEGAL_ARGUMENT_ERROR;
|
||||
success = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ Calendar::createInstance(const TimeZone& zone, const Locale& aLocale, UErrorCode
|
||||
bool_t
|
||||
Calendar::operator==(const Calendar& that) const
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
// {sfb} is this correct? (Java equals)
|
||||
return (getDynamicClassID() == that.getDynamicClassID() &&
|
||||
getTimeInMillis(status) == that.getTimeInMillis(status) &&
|
||||
@ -681,7 +681,7 @@ int32_t Calendar::stringToDayNumber(const UnicodeString& string, UErrorCode& sta
|
||||
|
||||
int32_t len = string.size();
|
||||
char *number = new char[1 + len];
|
||||
if (number == 0) { status = MEMORY_ALLOCATION_ERROR; return 0; }
|
||||
if (number == 0) { status = U_MEMORY_ALLOCATION_ERROR; return 0; }
|
||||
char *end;
|
||||
|
||||
string.extract(0, len, number);
|
||||
@ -691,7 +691,7 @@ int32_t Calendar::stringToDayNumber(const UnicodeString& string, UErrorCode& sta
|
||||
delete[] number;
|
||||
|
||||
if (end-number != len || len == 0 || value < 1 || value > 7)
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
|
||||
return value;
|
||||
}
|
||||
@ -719,7 +719,7 @@ Calendar::setWeekCountData(const Locale& desiredLocale, UErrorCode& status)
|
||||
// hard-coded data.
|
||||
if (FAILURE(status))
|
||||
{
|
||||
status = USING_FALLBACK_ERROR;
|
||||
status = U_USING_FALLBACK_ERROR;
|
||||
fFirstDayOfWeek = Calendar::SUNDAY;
|
||||
fMinimalDaysInFirstWeek = 1;
|
||||
return;
|
||||
@ -729,7 +729,7 @@ Calendar::setWeekCountData(const Locale& desiredLocale, UErrorCode& status)
|
||||
if (FAILURE(status)) return;
|
||||
if (count != 2)
|
||||
{
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,7 @@ public:
|
||||
* for deleting the object returned.
|
||||
*
|
||||
* @param success Indicates the success/failure of Calendar creation. Filled in
|
||||
* with ZERO_ERROR if created successfully, set to a failure result
|
||||
* with U_ZERO_ERROR if created successfully, set to a failure result
|
||||
* otherwise.
|
||||
* @return A Calendar if created successfully. NULL otherwise.
|
||||
*/
|
||||
@ -243,7 +243,7 @@ public:
|
||||
*
|
||||
* @param zoneToAdopt The given timezone to be adopted.
|
||||
* @param success Indicates the success/failure of Calendar creation. Filled in
|
||||
* with ZERO_ERROR if created successfully, set to a failure result
|
||||
* with U_ZERO_ERROR if created successfully, set to a failure result
|
||||
* otherwise.
|
||||
* @return A Calendar if created successfully. NULL otherwise.
|
||||
*/
|
||||
@ -255,7 +255,7 @@ public:
|
||||
*
|
||||
* @param zone The timezone.
|
||||
* @param success Indicates the success/failure of Calendar creation. Filled in
|
||||
* with ZERO_ERROR if created successfully, set to a failure result
|
||||
* with U_ZERO_ERROR if created successfully, set to a failure result
|
||||
* otherwise.
|
||||
* @return A Calendar if created successfully. NULL otherwise.
|
||||
*/
|
||||
@ -266,7 +266,7 @@ public:
|
||||
*
|
||||
* @param aLocale The given locale.
|
||||
* @param success Indicates the success/failure of Calendar creation. Filled in
|
||||
* with ZERO_ERROR if created successfully, set to a failure result
|
||||
* with U_ZERO_ERROR if created successfully, set to a failure result
|
||||
* otherwise.
|
||||
* @return A Calendar if created successfully. NULL otherwise.
|
||||
*/
|
||||
@ -280,7 +280,7 @@ public:
|
||||
* @param zoneToAdopt The given timezone to be adopted.
|
||||
* @param aLocale The given locale.
|
||||
* @param success Indicates the success/failure of Calendar creation. Filled in
|
||||
* with ZERO_ERROR if created successfully, set to a failure result
|
||||
* with U_ZERO_ERROR if created successfully, set to a failure result
|
||||
* otherwise.
|
||||
* @return A Calendar if created successfully. NULL otherwise.
|
||||
*/
|
||||
@ -293,7 +293,7 @@ public:
|
||||
* @param zone The timezone.
|
||||
* @param aLocale The given locale.
|
||||
* @param success Indicates the success/failure of Calendar creation. Filled in
|
||||
* with ZERO_ERROR if created successfully, set to a failure result
|
||||
* with U_ZERO_ERROR if created successfully, set to a failure result
|
||||
* otherwise.
|
||||
* @return A Calendar if created successfully. NULL otherwise.
|
||||
*/
|
||||
@ -749,7 +749,7 @@ protected:
|
||||
* TimeZone::createInstance(), and the default locale.
|
||||
*
|
||||
* @param success Indicates the status of Calendar object construction. Returns
|
||||
* ZERO_ERROR if constructed successfully.
|
||||
* U_ZERO_ERROR if constructed successfully.
|
||||
*/
|
||||
Calendar(UErrorCode& success);
|
||||
|
||||
@ -770,7 +770,7 @@ protected:
|
||||
* @param zoneToAdopt The given time zone.
|
||||
* @param aLocale The given locale.
|
||||
* @param success Indicates the status of Calendar object construction. Returns
|
||||
* ZERO_ERROR if constructed successfully.
|
||||
* U_ZERO_ERROR if constructed successfully.
|
||||
*/
|
||||
Calendar(TimeZone* zone, const Locale& aLocale, UErrorCode& success);
|
||||
|
||||
@ -780,7 +780,7 @@ protected:
|
||||
* @param zone The given time zone.
|
||||
* @param aLocale The given locale.
|
||||
* @param success Indicates the status of Calendar object construction. Returns
|
||||
* ZERO_ERROR if constructed successfully.
|
||||
* U_ZERO_ERROR if constructed successfully.
|
||||
*/
|
||||
Calendar(const TimeZone& zone, const Locale& aLocale, UErrorCode& success);
|
||||
|
||||
@ -935,7 +935,7 @@ private:
|
||||
*
|
||||
* @param desiredLocale The given locale.
|
||||
* @param success Indicates the status of setting the week count data from
|
||||
* the resource for the given locale. Returns ZERO_ERROR if
|
||||
* the resource for the given locale. Returns U_ZERO_ERROR if
|
||||
* constructed successfully.
|
||||
*/
|
||||
void setWeekCountData(const Locale& desiredLocale, UErrorCode& success);
|
||||
|
@ -261,7 +261,7 @@ ChoiceFormat::applyPattern(const UnicodeString& newPattern,
|
||||
}
|
||||
else if (ch == 0x003C /*'<'*/ || ch == 0x0023 /*'#'*/ || ch == 0x2264) {
|
||||
if (segments[0] == "") {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -288,7 +288,7 @@ ChoiceFormat::applyPattern(const UnicodeString& newPattern,
|
||||
// {sfb} There is a bug in MSVC 5.0 sp3 -- 0.0 <= NaN ==> TRUE
|
||||
//if (startValue <= oldStartValue) {
|
||||
if (startValue <= oldStartValue && ! icu_isNaN(oldStartValue)) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
segments[0].remove();
|
||||
@ -341,7 +341,7 @@ ChoiceFormat::toPattern(UnicodeString& result) const
|
||||
double tryLessOrEqual = icu_fabs(icu_IEEEremainder(fChoiceLimits[i], 1.0));
|
||||
double tryLess = icu_fabs(icu_IEEEremainder(less, 1.0));
|
||||
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UnicodeString buf;
|
||||
// {sfb} hack to get this to work on MSVC - NaN doesn't behave as it should
|
||||
if (tryLessOrEqual < tryLess &&
|
||||
@ -497,7 +497,7 @@ ChoiceFormat::format(const Formattable* objs,
|
||||
UErrorCode& status) const
|
||||
{
|
||||
if(cnt < 0) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return toAppendTo;
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@
|
||||
* . double filelimits[] = {0,1,2};
|
||||
* . UnicodeString filepart[] = {"are no files","is one file","are {2} files"};
|
||||
* . ChoiceFormat* fileform = new ChoiceFormat(filelimits, filepart, 3 );
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . const Format* testFormats[] = { fileform, NULL, NumberFormat::createInstance(success) };
|
||||
* . MessageFormat* pattform = new MessageFormat("There {0} on {1}", success );
|
||||
* . pattform->setFormats( testFormats, 3 );
|
||||
|
@ -49,7 +49,7 @@ static void deleteTCD(void* TCD)
|
||||
|
||||
CollationCache::CollationCache()
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
fHashtable = uhash_open((UHashFunction) uhash_hashUString, &err);
|
||||
uhash_setValueDeleter(fHashtable, deleteTCD);
|
||||
}
|
||||
@ -62,7 +62,7 @@ CollationCache::~CollationCache()
|
||||
|
||||
void CollationCache::Add(const UnicodeString& key, TableCollationData* value)
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
TableCollationData* previous = (TableCollationData*)uhash_putKey(fHashtable, key.hashCode() & 0x7FFFFFFF , value, &err);
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ CollationElementIterator::CollationElementIterator( const UnicodeString& sourceT
|
||||
|
||||
text = new Normalizer(sourceText, decomp);
|
||||
if (text == NULL) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -128,7 +128,7 @@ CollationElementIterator::CollationElementIterator( const CharacterIterator& sou
|
||||
|
||||
text = new Normalizer(sourceText, decomp);
|
||||
if (text == NULL) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ class VectorOfPToContractElement;
|
||||
* . void CollationElementIterator_Example()
|
||||
* . {
|
||||
* . UnicodeString str = "This is a test";
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . RuleBasedCollator* rbc =
|
||||
* . (RuleBasedCollator*) RuleBasedCollator::createInstance(success);
|
||||
* . CollationElementIterator* c =
|
||||
|
@ -79,7 +79,7 @@ class CollationKey;
|
||||
* <blockquote>
|
||||
* <pre>
|
||||
* // Compare two strings in the default locale
|
||||
* UErrorCode success = ZERO_ERROR;
|
||||
* UErrorCode success = U_ZERO_ERROR;
|
||||
* Collator* myCollator = Collator::createInstance(success);
|
||||
* if( myCollator->compare("abc", "ABC") < 0 ) {
|
||||
* cout << "abc is less than ABC" << endl;
|
||||
@ -103,7 +103,7 @@ class CollationKey;
|
||||
* <blockquote>
|
||||
* <pre>
|
||||
* //Get the Collator for US English and set its strength to PRIMARY
|
||||
* UErrorCode success = ZERO_ERROR;
|
||||
* UErrorCode success = U_ZERO_ERROR;
|
||||
* Collator* usCollator = Collator::createInstance(Locale::US, success);
|
||||
* usCollator->setStrength(Collator::PRIMARY);
|
||||
* if( usCollator->compare("abc", "ABC") == 0 ) {
|
||||
@ -216,9 +216,9 @@ public :
|
||||
* To check whether the construction succeeded or not, you should check
|
||||
* the value of SUCCESS(err). If you wish more detailed information, you
|
||||
* can check for informational error results which still indicate success.
|
||||
* USING_FALLBACK_ERROR indicates that a fall back locale was used. For
|
||||
* U_USING_FALLBACK_ERROR indicates that a fall back locale was used. For
|
||||
* example, 'de_CH' was requested, but nothing was found there, so 'de' was
|
||||
* used. USING_DEFAULT_ERROR indicates that the default locale data was
|
||||
* used. U_USING_DEFAULT_ERROR indicates that the default locale data was
|
||||
* used; neither the requested locale nor any of its fall back locales
|
||||
* could be found.
|
||||
* The caller owns the returned object and is responsible for deleting it.
|
||||
@ -240,9 +240,9 @@ public :
|
||||
* To check whether the construction succeeded or not, you should check
|
||||
* the value of SUCCESS(err). If you wish more detailed information, you
|
||||
* can check for informational error results which still indicate success.
|
||||
* USING_FALLBACK_ERROR indicates that a fall back locale was used. For
|
||||
* U_USING_FALLBACK_ERROR indicates that a fall back locale was used. For
|
||||
* example, 'de_CH' was requested, but nothing was found there, so 'de' was
|
||||
* used. USING_DEFAULT_ERROR indicates that the default locale data was
|
||||
* used. U_USING_DEFAULT_ERROR indicates that the default locale data was
|
||||
* used; neither the requested locale nor any of its fall back locales
|
||||
* could be found.
|
||||
* The caller owns the returned object and is responsible for deleting it.
|
||||
@ -257,7 +257,7 @@ public :
|
||||
* is less than, greater than or equal to another string.
|
||||
* <p>Example of use:
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . Collator *myCollation = Collator::createInstance(Locale::US, status);
|
||||
* . if (FAILURE(status)) return;
|
||||
* . myCollation->setStrength(Collator::PRIMARY);
|
||||
@ -282,7 +282,7 @@ public :
|
||||
* Does the same thing as compare but limits the comparison to a specified length
|
||||
* <p>Example of use:
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . Collator *myCollation = Collator::createInstance(Locale::US, status);
|
||||
* . if (FAILURE(status)) return;
|
||||
* . myCollation->setStrength(Collator::PRIMARY);
|
||||
@ -316,7 +316,7 @@ public :
|
||||
* generated sort keys.
|
||||
* <p>Example of use:
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . Collator *myCollation = Collator::createInstance(Locale::US, status);
|
||||
* . if (FAILURE(status)) return;
|
||||
* . myCollation->setStrength(Collator::PRIMARY);
|
||||
@ -395,7 +395,7 @@ public :
|
||||
Normalizer::EMode getDecomposition(void) const;
|
||||
/**
|
||||
* Set the decomposition mode of the collator object. success is equal
|
||||
* to ILLEGAL_ARGUMENT_ERROR if error occurs.
|
||||
* to U_ILLEGAL_ARGUMENT_ERROR if error occurs.
|
||||
* @param the new decomposition mode
|
||||
* @see Collator#getDecomposition
|
||||
*/
|
||||
@ -414,7 +414,7 @@ public :
|
||||
* Sets the minimum strength to be used in comparison or transformation.
|
||||
* <p>Example of use:
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . Collator *myCollation = Collator::createInstance(Locale::US, status);
|
||||
* . if (FAILURE(status)) return;
|
||||
* . myCollation->setStrength(Collator::PRIMARY);
|
||||
|
@ -114,13 +114,13 @@ DateFormat::format(const Formattable& obj,
|
||||
format((UDate)obj.getLong(), toAppendTo, fieldPosition);
|
||||
break;
|
||||
default:
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return toAppendTo;
|
||||
}
|
||||
|
||||
// Is this right?
|
||||
//if (fieldPosition.getBeginIndex() == fieldPosition.getEndIndex())
|
||||
// status = ILLEGAL_ARGUMENT_ERROR;
|
||||
// status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
|
||||
return toAppendTo;
|
||||
}
|
||||
@ -147,7 +147,7 @@ DateFormat::parse(const UnicodeString& text,
|
||||
|
||||
ParsePosition pos(0);
|
||||
UDate result = parse(text, pos);
|
||||
if (pos.getIndex() == 0) status = ILLEGAL_ARGUMENT_ERROR;
|
||||
if (pos.getIndex() == 0) status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -205,14 +205,14 @@ DateFormat*
|
||||
DateFormat::create(EStyle timeStyle, EStyle dateStyle, const Locale& locale)
|
||||
{
|
||||
// Try to create a SimpleDateFormat of the desired style.
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
SimpleDateFormat *f = new SimpleDateFormat(timeStyle, dateStyle, locale, status);
|
||||
if (SUCCESS(status)) return f;
|
||||
delete f;
|
||||
|
||||
// If that fails, try to create a format using the default pattern and
|
||||
// the DateFormatSymbols for this locale.
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
f = new SimpleDateFormat(locale, status);
|
||||
if (SUCCESS(status)) return f;
|
||||
delete f;
|
||||
@ -247,7 +247,7 @@ DateFormat::getAvailableLocales(int32_t& count)
|
||||
int32_t i;
|
||||
for (i=0; i<localesCount; ++i)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ResourceBundle resource(Locale::getDataDirectory(), locales[i], status);
|
||||
int32_t ignoredCount;
|
||||
resource.getStringArray(SimpleDateFormat::fgDateTimePatternsTag, ignoredCount, status);
|
||||
|
@ -71,7 +71,7 @@ class TimeZone;
|
||||
* </pre>
|
||||
* You can use a DateFormat to parse also.
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . UDate myDate = df->parse(myString, status);
|
||||
* </pre>
|
||||
* Use createDateInstance() to produce the normal date format for that country.
|
||||
|
@ -184,7 +184,7 @@ DecimalFormatSymbols::initialize(const Locale& locale, UErrorCode& status,
|
||||
// Initializes with last resort data if necessary.
|
||||
if (useLastResortData)
|
||||
{
|
||||
status = USING_FALLBACK_ERROR;
|
||||
status = U_USING_FALLBACK_ERROR;
|
||||
initialize(fgLastResortNumberElements, fgLastResortCurrencyElements);
|
||||
}
|
||||
return;
|
||||
@ -202,7 +202,7 @@ DecimalFormatSymbols::initialize(const Locale& locale, UErrorCode& status,
|
||||
// bundle, returns the failure error code.
|
||||
if (numberElementsLength < fgNumberElementsLength ||
|
||||
currencyElementsLength < fgCurrencyElementsLength) {
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
* Create a DecimalFormatSymbols object for the default locale.
|
||||
* This constructor will not fail. If the resource file data is
|
||||
* not available, it will use hard-coded last-resort data and
|
||||
* set status to USING_FALLBACK_ERROR.
|
||||
* set status to U_USING_FALLBACK_ERROR.
|
||||
*
|
||||
* @param status Input/output parameter, set to success or
|
||||
* failure code upon return.
|
||||
|
@ -145,7 +145,7 @@ DecimalFormat::DecimalFormat(const UnicodeString& pattern,
|
||||
fNegSuffixPattern(0),
|
||||
fSymbols(0)
|
||||
{
|
||||
if (symbolsToAdopt == NULL) status = ILLEGAL_ARGUMENT_ERROR;
|
||||
if (symbolsToAdopt == NULL) status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
construct(status, &pattern, symbolsToAdopt);
|
||||
}
|
||||
|
||||
@ -2201,7 +2201,7 @@ DecimalFormat::applyPattern(const UnicodeString& pattern,
|
||||
if (digitRightCount > 0) {
|
||||
// Unexpected '0'
|
||||
debug("Unexpected '0'")
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
++zeroDigitCount;
|
||||
@ -2218,7 +2218,7 @@ DecimalFormat::applyPattern(const UnicodeString& pattern,
|
||||
if (decimalPos >= 0) {
|
||||
// Grouping separator after decimal
|
||||
debug("Grouping separator after decimal")
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
groupingCount = 0;
|
||||
@ -2226,7 +2226,7 @@ DecimalFormat::applyPattern(const UnicodeString& pattern,
|
||||
if (decimalPos >= 0) {
|
||||
// Multiple decimal separators
|
||||
debug("Multiple decimal separators")
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
// Intentionally incorporate the digitRightCount,
|
||||
@ -2238,13 +2238,13 @@ DecimalFormat::applyPattern(const UnicodeString& pattern,
|
||||
if (expDigits >= 0) {
|
||||
// Multiple exponential symbols
|
||||
debug("Multiple exponential symbols")
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
if (groupingCount >= 0) {
|
||||
// Grouping separator in exponential pattern
|
||||
debug("Grouping separator in exponential pattern")
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
// Check for positive prefix
|
||||
@ -2265,7 +2265,7 @@ DecimalFormat::applyPattern(const UnicodeString& pattern,
|
||||
expDigits < 1) {
|
||||
// Malformed exponential pattern
|
||||
debug("Malformed exponential pattern")
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -2324,7 +2324,7 @@ DecimalFormat::applyPattern(const UnicodeString& pattern,
|
||||
if (subpart == 1 || part == 1) {
|
||||
// Unexpected separator
|
||||
debug("Unexpected separator")
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
sub2Limit = pos;
|
||||
@ -2335,7 +2335,7 @@ DecimalFormat::applyPattern(const UnicodeString& pattern,
|
||||
if (multiplier != 1) {
|
||||
// Too many percent/perMill characters
|
||||
debug("Too many percent/perMill characters")
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
affix->append(kQuote); // Encode percent/perMill
|
||||
@ -2351,7 +2351,7 @@ DecimalFormat::applyPattern(const UnicodeString& pattern,
|
||||
if (padPos >= 0 || // Multiple pad specifiers
|
||||
(pos+1) == pattern.size()) { // Nothing after padEscape
|
||||
debug("Multiple pad specifiers")
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
padPos = pos;
|
||||
@ -2430,7 +2430,7 @@ DecimalFormat::applyPattern(const UnicodeString& pattern,
|
||||
groupingCount == 0 ||
|
||||
subpart > 2) { // subpart > 2 == unmatched quote
|
||||
debug("Syntax error")
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2447,7 +2447,7 @@ DecimalFormat::applyPattern(const UnicodeString& pattern,
|
||||
} else {
|
||||
// Illegal pad position
|
||||
debug("Illegal pad position")
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class DigitList;
|
||||
* . if (locCount > 12) locCount = 12; //limit output
|
||||
* .
|
||||
* . double myNumber = -1234.56;
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . NumberFormat* form; //= NumberFormat::createInstance(success);
|
||||
* .
|
||||
* . // just for fun, we print out a number with the locale number, currency
|
||||
|
@ -436,7 +436,7 @@ DateFormatSymbols::initializeData(const Locale& locale, UErrorCode& status, bool
|
||||
// we just need to produce something that will be semi-intelligible
|
||||
// in most locales.
|
||||
|
||||
status = USING_FALLBACK_ERROR;
|
||||
status = U_USING_FALLBACK_ERROR;
|
||||
|
||||
fEras = (UnicodeString*)fgLastResortEras;
|
||||
fErasCount = sizeof(fgLastResortEras[0]) / sizeof(fgLastResortEras[0]);
|
||||
|
@ -59,7 +59,7 @@
|
||||
* . 12345.6789, -1234.56789, 123.456789, -12.3456789, 1.23456789};
|
||||
* . int dNumSize = (int)(sizeof(doubleNum)/sizeof(double));
|
||||
* .
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . DecimalFormat* fmt = (DecimalFormat*) NumberFormat::createInstance(status);
|
||||
* . fmt->setDecimalSeparatorAlwaysShown(true);
|
||||
* .
|
||||
|
@ -92,7 +92,7 @@ Format::parseObject(const UnicodeString& source,
|
||||
ParsePosition parsePosition(0);
|
||||
parseObject(source, result, parsePosition);
|
||||
if (parsePosition.getIndex() == 0) {
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -768,7 +768,7 @@ GregorianCalendar::computeTime(UErrorCode& status)
|
||||
return;
|
||||
|
||||
if (! isLenient() && ! validateFields()) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -785,7 +785,7 @@ GregorianCalendar::computeTime(UErrorCode& status)
|
||||
year = 1 - year;
|
||||
// Even in lenient mode we disallow ERA values other than AD & BC
|
||||
else if (era != AD) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1309,7 +1309,7 @@ GregorianCalendar::add(EDateFields field, int32_t amount, UErrorCode& status)
|
||||
case ZONE_OFFSET:
|
||||
case DST_OFFSET:
|
||||
default:
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1602,7 +1602,7 @@ GregorianCalendar::roll(EDateFields field, int32_t amount, UErrorCode& status)
|
||||
case ZONE_OFFSET:
|
||||
case DST_OFFSET:
|
||||
default:
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
// These fields cannot be rolled
|
||||
}
|
||||
@ -1681,7 +1681,7 @@ GregorianCalendar::getActualMaximum(EDateFields field) const
|
||||
* that we permit it, rather than complicating the code to handle such
|
||||
* intricacies. - liu 8/20/98 */
|
||||
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
switch (field) {
|
||||
// we have functions that enable us to fast-path number of days in month
|
||||
|
@ -66,7 +66,7 @@
|
||||
* .
|
||||
* . // create a GregorianCalendar with the Pacific Daylight time zone
|
||||
* . // and the current date and time
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . Calendar* calendar = new GregorianCalendar( pdt, success );
|
||||
* .
|
||||
* . // print out a bunch of interesting things
|
||||
@ -132,7 +132,7 @@ public:
|
||||
* zone with the default locale.
|
||||
*
|
||||
* @param success Indicates the status of GregorianCalendar object construction.
|
||||
* Returns ZERO_ERROR if constructed successfully.
|
||||
* Returns U_ZERO_ERROR if constructed successfully.
|
||||
*/
|
||||
GregorianCalendar(UErrorCode& success);
|
||||
|
||||
@ -143,7 +143,7 @@ public:
|
||||
*
|
||||
* @param zoneToAdopt The given timezone.
|
||||
* @param success Indicates the status of GregorianCalendar object construction.
|
||||
* Returns ZERO_ERROR if constructed successfully.
|
||||
* Returns U_ZERO_ERROR if constructed successfully.
|
||||
*/
|
||||
GregorianCalendar(TimeZone* zoneToAdopt, UErrorCode& success);
|
||||
|
||||
@ -153,7 +153,7 @@ public:
|
||||
*
|
||||
* @param zone The given timezone.
|
||||
* @param success Indicates the status of GregorianCalendar object construction.
|
||||
* Returns ZERO_ERROR if constructed successfully.
|
||||
* Returns U_ZERO_ERROR if constructed successfully.
|
||||
*/
|
||||
GregorianCalendar(const TimeZone& zone, UErrorCode& success);
|
||||
|
||||
@ -163,7 +163,7 @@ public:
|
||||
*
|
||||
* @param aLocale The given locale.
|
||||
* @param success Indicates the status of GregorianCalendar object construction.
|
||||
* Returns ZERO_ERROR if constructed successfully.
|
||||
* Returns U_ZERO_ERROR if constructed successfully.
|
||||
*/
|
||||
GregorianCalendar(const Locale& aLocale, UErrorCode& success);
|
||||
|
||||
@ -175,7 +175,7 @@ public:
|
||||
* @param zoneToAdopt The given timezone.
|
||||
* @param aLocale The given locale.
|
||||
* @param success Indicates the status of GregorianCalendar object construction.
|
||||
* Returns ZERO_ERROR if constructed successfully.
|
||||
* Returns U_ZERO_ERROR if constructed successfully.
|
||||
*/
|
||||
GregorianCalendar(TimeZone* zoneToAdopt, const Locale& aLocale, UErrorCode& success);
|
||||
|
||||
@ -186,7 +186,7 @@ public:
|
||||
* @param zone The given timezone.
|
||||
* @param aLocale The given locale.
|
||||
* @param success Indicates the status of GregorianCalendar object construction.
|
||||
* Returns ZERO_ERROR if constructed successfully.
|
||||
* Returns U_ZERO_ERROR if constructed successfully.
|
||||
*/
|
||||
GregorianCalendar(const TimeZone& zone, const Locale& aLocale, UErrorCode& success);
|
||||
|
||||
@ -199,7 +199,7 @@ public:
|
||||
* value is 0-based. e.g., 0 for January.
|
||||
* @param date The value used to set the DATE time field in the calendar.
|
||||
* @param success Indicates the status of GregorianCalendar object construction.
|
||||
* Returns ZERO_ERROR if constructed successfully.
|
||||
* Returns U_ZERO_ERROR if constructed successfully.
|
||||
*/
|
||||
GregorianCalendar(int32_t year, int32_t month, int32_t date, UErrorCode& success);
|
||||
|
||||
@ -214,7 +214,7 @@ public:
|
||||
* @param hour The value used to set the HOUR_OF_DAY time field in the calendar.
|
||||
* @param minute The value used to set the MINUTE time field in the calendar.
|
||||
* @param success Indicates the status of GregorianCalendar object construction.
|
||||
* Returns ZERO_ERROR if constructed successfully.
|
||||
* Returns U_ZERO_ERROR if constructed successfully.
|
||||
*/
|
||||
GregorianCalendar(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, UErrorCode& success);
|
||||
|
||||
@ -230,7 +230,7 @@ public:
|
||||
* @param minute The value used to set the MINUTE time field in the calendar.
|
||||
* @param second The value used to set the SECOND time field in the calendar.
|
||||
* @param success Indicates the status of GregorianCalendar object construction.
|
||||
* Returns ZERO_ERROR if constructed successfully.
|
||||
* Returns U_ZERO_ERROR if constructed successfully.
|
||||
*/
|
||||
GregorianCalendar(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second, UErrorCode& success);
|
||||
|
||||
|
@ -64,7 +64,7 @@ MergeCollation::MergeCollation(const UnicodeString& pattern,
|
||||
|
||||
if (patterns == NULL)
|
||||
{
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ MergeCollation::MergeCollation(const UnicodeString& pattern,
|
||||
if (statusArray == NULL)
|
||||
{
|
||||
delete patterns;
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -474,7 +474,7 @@ MergeCollation::findLastEntry(const PatternEntry* lastEntry,
|
||||
// must exist!
|
||||
if (oldIndex == -1)
|
||||
{
|
||||
success = INVALID_FORMAT_ERROR;
|
||||
success = U_INVALID_FORMAT_ERROR;
|
||||
return oldIndex;
|
||||
}
|
||||
|
||||
@ -516,12 +516,10 @@ MergeCollation::findLastEntry(const PatternEntry* lastEntry,
|
||||
|
||||
if (i == -1)
|
||||
{
|
||||
success = INVALID_FORMAT_ERROR;
|
||||
success = U_INVALID_FORMAT_ERROR;
|
||||
return i;
|
||||
}
|
||||
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
* Creates a merged collation table from a pattern string.
|
||||
* @param pattern the pattern string.
|
||||
* @param status the error code status. If the input pattern is incorrect,
|
||||
* this will be set to INVALID_FORMAT_ERROR.
|
||||
* this will be set to U_INVALID_FORMAT_ERROR.
|
||||
*/
|
||||
MergeCollation( const UnicodeString& pattern,
|
||||
Normalizer::EMode decompMode,
|
||||
@ -127,7 +127,7 @@ public:
|
||||
/**
|
||||
* Sets the pattern.
|
||||
* @param pattern string.
|
||||
* @param status the error code status, it will be set to INVALID_FORMAT_ERROR
|
||||
* @param status the error code status, it will be set to U_INVALID_FORMAT_ERROR
|
||||
* if the pattern is incorrect.
|
||||
*/
|
||||
void setPattern(const UnicodeString& pattern,
|
||||
@ -137,7 +137,7 @@ public:
|
||||
/**
|
||||
* Adds a pattern to the current merge collation object.
|
||||
* @param pattern the new pattern to be added.
|
||||
* @param status the error code status, it will be set to INVALID_FORMAT_ERROR
|
||||
* @param status the error code status, it will be set to U_INVALID_FORMAT_ERROR
|
||||
* if the pattern is incorrect.
|
||||
*/
|
||||
void addPattern(const UnicodeString& pattern,
|
||||
@ -190,7 +190,7 @@ private:
|
||||
* (which is usually at the end). Strength indicates the text order
|
||||
* weight for an entry.
|
||||
* @param newEntry the new pattern entry
|
||||
* @param status the error code status, it will be set to INVALID_FORMAT_ERROR
|
||||
* @param status the error code status, it will be set to U_INVALID_FORMAT_ERROR
|
||||
* if the strength is RESET and a previous entry can't be found.
|
||||
*/
|
||||
void fixEntry( PatternEntry* newEntry,
|
||||
@ -201,7 +201,7 @@ private:
|
||||
* merge collation object.
|
||||
* @param lastEntry the entry that was previously installed.
|
||||
* @param excess the extra characters
|
||||
* @param status the error code status, it will be set to INVALID_FORMAT_ERROR
|
||||
* @param status the error code status, it will be set to U_INVALID_FORMAT_ERROR
|
||||
* if the strength is RESET and a previous entry can't be found.
|
||||
* @return the offset of the found entry
|
||||
*/
|
||||
|
@ -282,7 +282,7 @@ MessageFormat::applyPattern(const UnicodeString& newPattern,
|
||||
}
|
||||
if (braceStack == 0 && part != 0) {
|
||||
fMaxOffset = -1;
|
||||
success = INVALID_FORMAT_ERROR;
|
||||
success = U_INVALID_FORMAT_ERROR;
|
||||
return;
|
||||
//throw new IllegalArgumentException("Unmatched braces in the pattern.");
|
||||
}
|
||||
@ -309,7 +309,7 @@ MessageFormat::toPattern(UnicodeString& result) const
|
||||
}
|
||||
else if (fFormats[i]->getDynamicClassID() == DecimalFormat::getStaticClassID()) {
|
||||
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
NumberFormat& formatAlias = *(NumberFormat*)fFormats[i];
|
||||
NumberFormat *numberTemplate = NumberFormat::createInstance(fLocale, status);
|
||||
NumberFormat *currencyTemplate = NumberFormat::createCurrencyInstance(fLocale, status);
|
||||
@ -340,7 +340,7 @@ MessageFormat::toPattern(UnicodeString& result) const
|
||||
delete integerTemplate;
|
||||
}
|
||||
else if (fFormats[i]->getDynamicClassID() == SimpleDateFormat::getStaticClassID()) {
|
||||
UErrorCode success = ZERO_ERROR;
|
||||
UErrorCode success = U_ZERO_ERROR;
|
||||
DateFormat& formatAlias = *(DateFormat*)fFormats[i];
|
||||
DateFormat *defaultDateTemplate = DateFormat::createDateInstance(DateFormat::kDefault, fLocale);
|
||||
DateFormat *shortDateTemplate = DateFormat::createDateInstance(DateFormat::kShort, fLocale);
|
||||
@ -560,7 +560,7 @@ MessageFormat::format(const Formattable& source,
|
||||
if (FAILURE(success))
|
||||
return result;
|
||||
if (source.getType() != Formattable::kArray) {
|
||||
success = ILLEGAL_ARGUMENT_ERROR;
|
||||
success = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return result;
|
||||
}
|
||||
const Formattable* tmpPtr = source.getArray(cnt);
|
||||
@ -581,7 +581,7 @@ MessageFormat::format(const Formattable* arguments,
|
||||
UErrorCode& success) const
|
||||
{
|
||||
if(/*arguments == NULL ||*/ cnt < 0) {
|
||||
success = ILLEGAL_ARGUMENT_ERROR;
|
||||
success = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -598,7 +598,7 @@ MessageFormat::format(const Formattable* arguments,
|
||||
int32_t argumentNumber = fArgumentNumbers[i];
|
||||
// Checks the scope of the argument number.
|
||||
if (argumentNumber >= cnt) {
|
||||
/*success = ILLEGAL_ARGUMENT_ERROR;
|
||||
/*success = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return result;*/
|
||||
result += "{";
|
||||
UnicodeString temp;
|
||||
@ -644,7 +644,7 @@ MessageFormat::format(const Formattable* arguments,
|
||||
#ifdef LIUDEBUG
|
||||
cerr << "Unknown object of type:" << obj.getType() << endl;
|
||||
#endif
|
||||
success = ILLEGAL_ARGUMENT_ERROR;
|
||||
success = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return result;
|
||||
}
|
||||
// Needs to reprocess the ChoiceFormat option by using the MessageFormat
|
||||
@ -807,7 +807,7 @@ MessageFormat::parse(const UnicodeString& source,
|
||||
// from zero offset of the source text.
|
||||
Formattable* result = parse(source, status, cnt);
|
||||
if (status.getIndex() == 0) {
|
||||
success = MESSAGE_PARSE_ERROR;
|
||||
success = U_MESSAGE_PARSE_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
return result;
|
||||
@ -914,7 +914,7 @@ UnicodeString&
|
||||
MessageFormat::itos(int32_t i,
|
||||
UnicodeString& string)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
NumberFormat *myFormat = getNumberFormat(status);
|
||||
|
||||
if(FAILURE(status))
|
||||
@ -944,7 +944,7 @@ MessageFormat::makeFormat(int32_t position,
|
||||
int32_t oldMaxOffset = fMaxOffset;
|
||||
argumentNumber = stoi(segments[1], success); // always unlocalized!
|
||||
if (argumentNumber < 0 || argumentNumber > 9) {
|
||||
success = INVALID_FORMAT_ERROR;
|
||||
success = U_INVALID_FORMAT_ERROR;
|
||||
return;
|
||||
}
|
||||
fMaxOffset = offsetNumber;
|
||||
@ -980,7 +980,7 @@ MessageFormat::makeFormat(int32_t position,
|
||||
((DecimalFormat*)newFormat)->applyPattern(segments[3], success);
|
||||
if(FAILURE(success)) {
|
||||
fMaxOffset = oldMaxOffset;
|
||||
success = ILLEGAL_ARGUMENT_ERROR;
|
||||
success = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -1010,7 +1010,7 @@ MessageFormat::makeFormat(int32_t position,
|
||||
((SimpleDateFormat*)newFormat)->applyPattern(segments[3]);
|
||||
if(FAILURE(success)) {
|
||||
fMaxOffset = oldMaxOffset;
|
||||
success = ILLEGAL_ARGUMENT_ERROR;
|
||||
success = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -1039,7 +1039,7 @@ MessageFormat::makeFormat(int32_t position,
|
||||
((SimpleDateFormat*)newFormat)->applyPattern(segments[3]);
|
||||
if(FAILURE(success)) {
|
||||
fMaxOffset = oldMaxOffset;
|
||||
success = ILLEGAL_ARGUMENT_ERROR;
|
||||
success = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -1049,13 +1049,13 @@ MessageFormat::makeFormat(int32_t position,
|
||||
newFormat = new ChoiceFormat(segments[3], success);
|
||||
if(FAILURE(success)) {
|
||||
fMaxOffset = oldMaxOffset;
|
||||
success = ILLEGAL_ARGUMENT_ERROR;
|
||||
success = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
fMaxOffset = oldMaxOffset;
|
||||
success = ILLEGAL_ARGUMENT_ERROR;
|
||||
success = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ class NumberFormat;
|
||||
* Here are some examples of usage:
|
||||
* Example 1:
|
||||
* <pre>
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . GregorianCalendar cal(success);
|
||||
* . Formattable arguments[] = {
|
||||
* . 7L,
|
||||
@ -64,7 +64,7 @@ class NumberFormat;
|
||||
* <P>
|
||||
* Example 2:
|
||||
* <pre>
|
||||
* . success = ZERO_ERROR;
|
||||
* . success = U_ZERO_ERROR;
|
||||
* . Formattable testArgs[] = {3L, "MyDisk"};
|
||||
* .
|
||||
* . MessageFormat* form = new MessageFormat(
|
||||
@ -138,7 +138,7 @@ class NumberFormat;
|
||||
* For more sophisticated patterns, you can use a ChoiceFormat to get
|
||||
* output such as:
|
||||
* <pre>
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . MessageFormat* form = new MessageFormat("The disk \"{1}\" contains {0}.", success);
|
||||
* . double filelimits[] = {0,1,2};
|
||||
* . UnicodeString filepart[] = {"no files","one file","{0,number} files"};
|
||||
|
@ -141,7 +141,7 @@ NumberFormat::format(const Formattable& obj,
|
||||
}
|
||||
// can't try to format a non-numeric object
|
||||
else {
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
return toAppendTo;
|
||||
}
|
||||
}
|
||||
@ -165,7 +165,7 @@ UnicodeString&
|
||||
NumberFormat::format(double number, UnicodeString& toAppendTo) const
|
||||
{
|
||||
FieldPosition pos(0);
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
return format(Formattable(number), toAppendTo, pos, status);
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ UnicodeString&
|
||||
NumberFormat::format(int32_t number, UnicodeString& toAppendTo) const
|
||||
{
|
||||
FieldPosition pos(0);
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
return format(Formattable(number), toAppendTo, pos, status);
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ NumberFormat::parse(const UnicodeString& text,
|
||||
ParsePosition parsePosition(0);
|
||||
parse(text, result, parsePosition);
|
||||
if (parsePosition.getIndex() == 0) {
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@ -408,7 +408,7 @@ NumberFormat::createInstance(const Locale& desiredLocale,
|
||||
if (FAILURE(status)) return NULL;
|
||||
|
||||
if (style < 0 || style >= kStyleCount) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -416,7 +416,7 @@ NumberFormat::createInstance(const Locale& desiredLocale,
|
||||
if (FAILURE(status))
|
||||
{
|
||||
// We don't appear to have resource data available -- use the last-resort data
|
||||
status = USING_FALLBACK_ERROR;
|
||||
status = U_USING_FALLBACK_ERROR;
|
||||
|
||||
// Use the DecimalFormatSymbols constructor which uses last-resort data
|
||||
DecimalFormatSymbols* symbolsToAdopt = new DecimalFormatSymbols(status);
|
||||
@ -433,7 +433,7 @@ NumberFormat::createInstance(const Locale& desiredLocale,
|
||||
patternCount, status);
|
||||
// If not all the styled patterns exists for the NumberFormat in this locale,
|
||||
// sets the status code to failure and returns nil.
|
||||
if (patternCount < fgNumberPatternsCount) status = INVALID_FORMAT_ERROR;
|
||||
if (patternCount < fgNumberPatternsCount) status = U_INVALID_FORMAT_ERROR;
|
||||
if (FAILURE(status)) return NULL;
|
||||
|
||||
// If the requested style doesn't exist, use a last-resort style.
|
||||
|
@ -50,7 +50,7 @@ class Locale;
|
||||
* <pre>
|
||||
* . double myNumber = 7.0;
|
||||
* . UnicodeString myString;
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . NumberFormat* nf = NumberFormat::createInstance(success)
|
||||
* . nf->format(myNumber, myString);
|
||||
* . cout << " Example 1: " << myString << endl;
|
||||
@ -61,7 +61,7 @@ class Locale;
|
||||
* conventions multiple times.
|
||||
* <pre>
|
||||
* . UnicodeString myString;
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . nf = NumberFormat::createInstance( success );
|
||||
* . int32_t a[] = { 123, 3333, -1234567 };
|
||||
* . const int32_t a_len = sizeof(a) / sizeof(a[0]);
|
||||
|
@ -61,7 +61,7 @@ PatternEntry::PatternEntry(int32_t newStrength,
|
||||
// When there are multiple combining characters attached to a base character,
|
||||
// the combining characters must be in their canonical order
|
||||
//
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
Normalizer::normalize(newChars, decompMode, 0, chars, status);
|
||||
if (FAILURE(status)) {
|
||||
chars = newChars;
|
||||
@ -361,13 +361,13 @@ PatternEntry *PatternEntry::Parser::next(UErrorCode &status)
|
||||
default:
|
||||
if (newStrength == PatternEntry::UNSET)
|
||||
{
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (isSpecialChar(ch) && (inQuote == FALSE))
|
||||
{
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -386,7 +386,7 @@ PatternEntry *PatternEntry::Parser::next(UErrorCode &status)
|
||||
|
||||
if (newChars.isBogus() || newExtensions.isBogus())
|
||||
{
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -401,7 +401,7 @@ PatternEntry *PatternEntry::Parser::next(UErrorCode &status)
|
||||
|
||||
if (newChars.size() == 0)
|
||||
{
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -418,4 +418,3 @@ bool_t PatternEntry::isSpecialChar(UChar ch)
|
||||
((ch <= 0x0060) && (ch >= 0x005B)) ||
|
||||
((ch <= 0x007E) && (ch >= 0x007B)));
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ SimpleTimeZone::SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID,
|
||||
decodeRules(status);
|
||||
|
||||
if(dstSavings <= 0) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@ -323,7 +323,7 @@ int32_t
|
||||
SimpleTimeZone::getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
|
||||
uint8_t dayOfWeek, int32_t millis) const
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
return getOffset(era, year, month, day, dayOfWeek, millis, status);
|
||||
}
|
||||
|
||||
@ -340,7 +340,7 @@ SimpleTimeZone::getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
|
||||
// field) with fields ZONE_OFFSET and DST_OFFSET. We can't get rid of
|
||||
// this method because it's public API. - liu 8/10/98
|
||||
if(month < Calendar::JANUARY || month > Calendar::DECEMBER) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -365,7 +365,7 @@ SimpleTimeZone::getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
|
||||
|| millis >= kMillisPerDay
|
||||
|| monthLength < 28
|
||||
|| monthLength > 31) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -522,7 +522,7 @@ SimpleTimeZone::setRawOffset(int32_t offsetMillis)
|
||||
void
|
||||
SimpleTimeZone::setDSTSavings(int32_t millisSavedDuringDST)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
setDSTSavings(millisSavedDuringDST, status);
|
||||
}
|
||||
|
||||
@ -533,7 +533,7 @@ SimpleTimeZone::setDSTSavings(int32_t millisSavedDuringDST, UErrorCode& status)
|
||||
{
|
||||
dstSavings = millisSavedDuringDST;
|
||||
if(dstSavings <= 0)
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
@ -706,11 +706,11 @@ SimpleTimeZone::decodeStartRule(UErrorCode& status)
|
||||
useDaylight = ((startDay != 0) && (endDay != 0) ? TRUE : FALSE);
|
||||
if (startDay != 0) {
|
||||
if (startMonth < Calendar::JANUARY || startMonth > Calendar::DECEMBER) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
if (startTime < 0 || startTime > kMillisPerDay) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
if (startDayOfWeek == 0) {
|
||||
@ -728,17 +728,17 @@ SimpleTimeZone::decodeStartRule(UErrorCode& status)
|
||||
}
|
||||
}
|
||||
if (startDayOfWeek > Calendar::SATURDAY) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (startMode == DOW_IN_MONTH_MODE) {
|
||||
if (startDay < -5 || startDay > 5) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
} else if (startDay > staticMonthLength[startMonth]) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -757,11 +757,11 @@ SimpleTimeZone::decodeEndRule(UErrorCode& status)
|
||||
useDaylight = ((startDay != 0) && (endDay != 0) ? TRUE : FALSE);
|
||||
if (endDay != 0) {
|
||||
if (endMonth < Calendar::JANUARY || endMonth > Calendar::DECEMBER) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
if (endTime < 0 || endTime > kMillisPerDay) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
if (endDayOfWeek == 0) {
|
||||
@ -779,17 +779,17 @@ SimpleTimeZone::decodeEndRule(UErrorCode& status)
|
||||
}
|
||||
}
|
||||
if (endDayOfWeek > Calendar::SATURDAY) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (endMode == DOW_IN_MONTH_MODE) {
|
||||
if (endDay < -5 || endDay > 5) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
} else if (endDay > staticMonthLength[endMonth]) {
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ SimpleDateFormat::SimpleDateFormat(const Locale& locale,
|
||||
fSymbols = new DateFormatSymbols(locale, status);
|
||||
if (FAILURE(status))
|
||||
{
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
delete fSymbols;
|
||||
// This constructor doesn't fail; it uses last resort data
|
||||
fSymbols = new DateFormatSymbols(status);
|
||||
@ -272,7 +272,7 @@ void SimpleDateFormat::construct(EStyle timeStyle,
|
||||
if (FAILURE(status)) return;
|
||||
if (dtCount <= kDateTime)
|
||||
{
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -310,7 +310,7 @@ void SimpleDateFormat::construct(EStyle timeStyle,
|
||||
else if (dateStyle != kNone) fPattern = dateTimePatterns[dateStyle];
|
||||
|
||||
// and if it includes _neither_, that's an error
|
||||
else status = INVALID_FORMAT_ERROR;
|
||||
else status = U_INVALID_FORMAT_ERROR;
|
||||
|
||||
// finally, finish initializing by creating a Calendar and a NumberFormat
|
||||
initialize(locale, status);
|
||||
@ -327,7 +327,7 @@ SimpleDateFormat::initialize(const Locale& locale,
|
||||
// {sfb} should this be here?
|
||||
if (fSymbols->fZoneStringsColCount < 1)
|
||||
{
|
||||
status = INVALID_FORMAT_ERROR; // Check for bogus locale data
|
||||
status = U_INVALID_FORMAT_ERROR; // Check for bogus locale data
|
||||
return;
|
||||
}
|
||||
|
||||
@ -351,7 +351,7 @@ SimpleDateFormat::initialize(const Locale& locale,
|
||||
}
|
||||
else if (SUCCESS(status))
|
||||
{
|
||||
status = MISSING_RESOURCE_ERROR;
|
||||
status = U_MISSING_RESOURCE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@ -363,7 +363,7 @@ void SimpleDateFormat::initializeDefaultCentury()
|
||||
fDefaultCenturyStart = internalGetDefaultCenturyStart();
|
||||
fDefaultCenturyStartYear = internalGetDefaultCenturyStartYear();
|
||||
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
fCalendar->setTime(fDefaultCenturyStart, status);
|
||||
// {sfb} throw away error
|
||||
}
|
||||
@ -388,7 +388,7 @@ void SimpleDateFormat::parseAmbiguousDatesAsAfter(UDate startDate, UErrorCode& s
|
||||
UnicodeString&
|
||||
SimpleDateFormat::format(UDate date, UnicodeString& toAppendTo, FieldPosition& pos) const
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
pos.setBeginIndex(0);
|
||||
pos.setEndIndex(0);
|
||||
|
||||
@ -514,7 +514,7 @@ SimpleDateFormat::subFormat(UnicodeString& result,
|
||||
// if the pattern character is unrecognized, signal an error and dump out
|
||||
if ((patternCharIndex = (EField)DateFormatSymbols::fgPatternChars.indexOf(ch)) == (EField)-1)
|
||||
{
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -927,7 +927,7 @@ SimpleDateFormat::parse(const UnicodeString& text, ParsePosition& pos) const
|
||||
// when the two-digit year is equal to the start year, and thus might fall at the
|
||||
// front or the back of the default century. This only works because we adjust
|
||||
// the year correctly to start with in other cases -- see subParse().
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UDate parsedDate;
|
||||
if (ambiguousYear[0]) // If this is true then the two-digit year == the default start year
|
||||
{
|
||||
@ -1060,7 +1060,7 @@ SimpleDateFormat::subParseLong(const UnicodeString& text, ParsePosition& pos, in
|
||||
int32_t SimpleDateFormat::subParse(const UnicodeString& text, int32_t& start, UChar ch, int32_t count,
|
||||
bool_t obeyCount, bool_t ambiguousYear[]) const
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
Formattable number;
|
||||
int32_t value = 0;
|
||||
int32_t i;
|
||||
@ -1296,7 +1296,7 @@ int32_t SimpleDateFormat::subParse(const UnicodeString& text, int32_t& start, UC
|
||||
// [+-]hhmm as specified by RFC 822. This code is actually
|
||||
// a little more permissive than RFC 822. It will try to do
|
||||
// its best with numbers that aren't strictly 4 digits long.
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
DecimalFormat *fmt = new DecimalFormat("+####;-####", status);
|
||||
if(FAILURE(status))
|
||||
return -start;
|
||||
@ -1409,7 +1409,7 @@ void SimpleDateFormat::translatePattern(const UnicodeString& originalPattern,
|
||||
|| (c >= 0x0041 /*'A'*/ && c <= 0x005A /*'Z'*/)) {
|
||||
UTextOffset ci = from.indexOf(c);
|
||||
if (ci == -1) {
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
return;
|
||||
}
|
||||
c = to[ci];
|
||||
@ -1418,7 +1418,7 @@ void SimpleDateFormat::translatePattern(const UnicodeString& originalPattern,
|
||||
translatedPattern += c;
|
||||
}
|
||||
if (inQuote) {
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1545,7 +1545,7 @@ SimpleDateFormat::initializeSystemDefaultCentury()
|
||||
// No point in locking as it should be idempotent.
|
||||
if (fgSystemDefaultCenturyStart == fgSystemDefaultCentury)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
Calendar *calendar = Calendar::createInstance(status);
|
||||
if (calendar != NULL && SUCCESS(status))
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ class DateFormatSymbols;
|
||||
* </pre>
|
||||
* Code Sample:
|
||||
* <pre>
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . 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);
|
||||
@ -295,7 +295,7 @@ public:
|
||||
* parse() that takes a ParsePosition.
|
||||
*
|
||||
* @param text The date/time string to be parsed
|
||||
* @param status Filled in with ZERO_ERROR if the parse was successful, and with
|
||||
* @param status Filled in with U_ZERO_ERROR if the parse was successful, and with
|
||||
* an error value if there was a parse error.
|
||||
* @return A valid UDate if the input could be parsed.
|
||||
*/
|
||||
@ -486,7 +486,7 @@ private:
|
||||
* this function is formatting the field specfied by pos, it
|
||||
* will fill in pos will the beginning and ending offsets of the
|
||||
* field.
|
||||
* @param status Receives a status code, which will be ZERO_ERROR if the operation
|
||||
* @param status Receives a status code, which will be U_ZERO_ERROR if the operation
|
||||
* succeeds.
|
||||
* @return A reference to "result".
|
||||
*/
|
||||
|
@ -55,7 +55,7 @@
|
||||
*
|
||||
* <p>Example of use:
|
||||
* <pre>
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . Collator* myCollator = Collator::createInstance(success);
|
||||
* . CollationKey* keys = new CollationKey [3];
|
||||
* . myCollator->getCollationKey("Tom", keys[0], success );
|
||||
@ -173,11 +173,11 @@ public :
|
||||
* is not the same as String.hashCode.
|
||||
* <p>Example of use:
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . Collator *myCollation = Collator::createInstance(Locale::US, status);
|
||||
* . if (FAILURE(status)) return;
|
||||
* . CollationKey key1, key2;
|
||||
* . UErrorCode status1 = ZERO_ERROR, status2 = ZERO_ERROR;
|
||||
* . UErrorCode status1 = U_ZERO_ERROR, status2 = U_ZERO_ERROR;
|
||||
* . myCollation->getCollationKey("abc", key1, status1);
|
||||
* . if (FAILURE(status1)) { delete myCollation; return; }
|
||||
* . myCollation->getCollationKey("ABC", key2, status2);
|
||||
|
@ -302,7 +302,7 @@ void RuleBasedCollator::constructFromRules(const UnicodeString& rules,
|
||||
|
||||
if (rules.isBogus())
|
||||
{
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -318,7 +318,7 @@ void RuleBasedCollator::constructFromRules(const UnicodeString& rules,
|
||||
data = new TableCollationData;
|
||||
if (data->isBogus())
|
||||
{
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
delete data;
|
||||
data = 0;
|
||||
return;
|
||||
@ -358,7 +358,7 @@ RuleBasedCollator::constructFromFile(const char* fileName,
|
||||
|
||||
FileStream* ifs = T_FileStream_open(fileName, "rb");
|
||||
if (ifs == 0) {
|
||||
status = FILE_ACCESS_ERROR;
|
||||
status = U_FILE_ACCESS_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -367,17 +367,17 @@ RuleBasedCollator::constructFromFile(const char* fileName,
|
||||
|
||||
if (!T_FileStream_error(ifs))
|
||||
{
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
}
|
||||
else if (data && data->isBogus())
|
||||
{
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
delete data;
|
||||
data = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MISSING_RESOURCE_ERROR;
|
||||
status = U_MISSING_RESOURCE_ERROR;
|
||||
delete data;
|
||||
data = 0;
|
||||
}
|
||||
@ -435,20 +435,20 @@ RuleBasedCollator::RuleBasedCollator( const Locale& desiredLocale,
|
||||
{
|
||||
if (next == eDone)
|
||||
{
|
||||
// We've failed to load a locale, but should never return MISSING_RESOURCE_ERROR
|
||||
UErrorCode intStatus = ZERO_ERROR;
|
||||
// We've failed to load a locale, but should never return U_MISSING_RESOURCE_ERROR
|
||||
UErrorCode intStatus = U_ZERO_ERROR;
|
||||
|
||||
constructFromRules(RuleBasedCollator::DEFAULTRULES, intStatus);
|
||||
if (intStatus == ZERO_ERROR)
|
||||
if (intStatus == U_ZERO_ERROR)
|
||||
{
|
||||
status = USING_DEFAULT_ERROR;
|
||||
status = U_USING_DEFAULT_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = intStatus; // bubble back
|
||||
}
|
||||
|
||||
if (status == MEMORY_ALLOCATION_ERROR)
|
||||
if (status == U_MEMORY_ALLOCATION_ERROR)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -469,7 +469,7 @@ RuleBasedCollator::RuleBasedCollator( const Locale& desiredLocale,
|
||||
switch (next)
|
||||
{
|
||||
case eTryDefaultLocale:
|
||||
status = USING_DEFAULT_ERROR;
|
||||
status = U_USING_DEFAULT_ERROR;
|
||||
Locale::getDefault().getName(localeName);
|
||||
next = eTryDefaultCollation;
|
||||
break;
|
||||
@ -479,7 +479,7 @@ RuleBasedCollator::RuleBasedCollator( const Locale& desiredLocale,
|
||||
// using a default collation object and the condition of
|
||||
// using a default locale to get a collation object currently.
|
||||
// That is, the caller can't distinguish based on UErrorCode.
|
||||
status = USING_DEFAULT_ERROR;
|
||||
status = U_USING_DEFAULT_ERROR;
|
||||
localeName = ResourceBundle::kDefaultFilename;
|
||||
next = eDone;
|
||||
break;
|
||||
@ -489,7 +489,7 @@ RuleBasedCollator::RuleBasedCollator( const Locale& desiredLocale,
|
||||
// First try to load the collation from the in-memory static cache.
|
||||
// Note that all of the caching logic is handled here, and in the
|
||||
// call to RuleBasedCollator::addToCache, below.
|
||||
UErrorCode intStatus = ZERO_ERROR;
|
||||
UErrorCode intStatus = U_ZERO_ERROR;
|
||||
|
||||
constructFromCache(localeName, intStatus);
|
||||
if (SUCCESS(intStatus))
|
||||
@ -503,7 +503,7 @@ RuleBasedCollator::RuleBasedCollator( const Locale& desiredLocale,
|
||||
// a binary collation file, or if that is unavailable, it will go
|
||||
// to the text resource bundle file (with the corresponding name)
|
||||
// and try to get the collation table there.
|
||||
intStatus = ZERO_ERROR;
|
||||
intStatus = U_ZERO_ERROR;
|
||||
constructFromFile(desiredLocale, localeName, TRUE, intStatus);
|
||||
if (SUCCESS(intStatus))
|
||||
{
|
||||
@ -519,7 +519,7 @@ RuleBasedCollator::RuleBasedCollator( const Locale& desiredLocale,
|
||||
setDecomposition(Normalizer::NO_OP);
|
||||
break; // Done!
|
||||
}
|
||||
if (intStatus == MEMORY_ALLOCATION_ERROR)
|
||||
if (intStatus == U_MEMORY_ALLOCATION_ERROR)
|
||||
{
|
||||
status = intStatus;
|
||||
return;
|
||||
@ -529,9 +529,9 @@ RuleBasedCollator::RuleBasedCollator( const Locale& desiredLocale,
|
||||
// it less specific, and try again. Indicate the use of a
|
||||
// fallback locale, unless we've already fallen through to
|
||||
// a default locale -- then leave the status as is.
|
||||
if (status == ZERO_ERROR)
|
||||
if (status == U_ZERO_ERROR)
|
||||
{
|
||||
status = USING_FALLBACK_ERROR;
|
||||
status = U_USING_FALLBACK_ERROR;
|
||||
}
|
||||
|
||||
chopLocale(localeName);
|
||||
@ -575,7 +575,7 @@ RuleBasedCollator::constructFromFile( const Locale& locale,
|
||||
#ifdef COLLDEBUG
|
||||
cerr << localeFileName << " binary load " << errorName(status) << endl;
|
||||
#endif
|
||||
if(SUCCESS(status) || status == MEMORY_ALLOCATION_ERROR)
|
||||
if(SUCCESS(status) || status == U_MEMORY_ALLOCATION_ERROR)
|
||||
return;
|
||||
}
|
||||
|
||||
@ -593,17 +593,17 @@ RuleBasedCollator::constructFromFile( const Locale& locale,
|
||||
// check and see if this resource bundle contains collation data
|
||||
|
||||
UnicodeString colString;
|
||||
UErrorCode intStatus = ZERO_ERROR;
|
||||
UErrorCode intStatus = U_ZERO_ERROR;
|
||||
|
||||
bundle.getString("CollationElements", colString, intStatus);
|
||||
if(colString.isBogus()) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
// if this bundle doesn't contain collation data, break out
|
||||
if(FAILURE(intStatus)) {
|
||||
status = MISSING_RESOURCE_ERROR;
|
||||
status = U_MISSING_RESOURCE_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -613,23 +613,23 @@ RuleBasedCollator::constructFromFile( const Locale& locale,
|
||||
|
||||
colString.insert(0, DEFAULTRULES);
|
||||
if(colString.isBogus()) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
constructFromRules(colString, intStatus);
|
||||
if(intStatus == MEMORY_ALLOCATION_ERROR) {
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
if(intStatus == U_MEMORY_ALLOCATION_ERROR) {
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
if(intStatus != ZERO_ERROR) {
|
||||
status = USING_DEFAULT_ERROR;
|
||||
if(intStatus != U_ZERO_ERROR) {
|
||||
status = U_USING_DEFAULT_ERROR;
|
||||
|
||||
// predefined tables should contain correct grammar
|
||||
intStatus = ZERO_ERROR;
|
||||
intStatus = U_ZERO_ERROR;
|
||||
constructFromRules(DEFAULTRULES, intStatus);
|
||||
if(intStatus != ZERO_ERROR) {
|
||||
if(intStatus != U_ZERO_ERROR) {
|
||||
status = intStatus;
|
||||
}
|
||||
}
|
||||
@ -682,7 +682,7 @@ RuleBasedCollator::clone() const
|
||||
CollationElementIterator*
|
||||
RuleBasedCollator::createCollationElementIterator(const UnicodeString& source) const
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
CollationElementIterator *newCursor = 0;
|
||||
|
||||
newCursor = new CollationElementIterator(source, this, status);
|
||||
@ -699,7 +699,7 @@ RuleBasedCollator::createCollationElementIterator(const UnicodeString& source) c
|
||||
CollationElementIterator*
|
||||
RuleBasedCollator::createCollationElementIterator(const CharacterIterator& source) const
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
CollationElementIterator *newCursor = 0;
|
||||
|
||||
newCursor = new CollationElementIterator(source, this, status);
|
||||
@ -737,7 +737,7 @@ RuleBasedCollator::getRules() const
|
||||
// Notice that we pass in a tryBinaryFile value of FALSE, since
|
||||
// by design the binary file has NO rules in it!
|
||||
RuleBasedCollator temp;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
temp.constructFromFile(data->desiredLocale, data->realLocaleName, FALSE, status);
|
||||
|
||||
// We must check that mPattern is nonzero here, or we run the risk
|
||||
@ -802,7 +802,7 @@ RuleBasedCollator::compare(const UnicodeString& source,
|
||||
}
|
||||
|
||||
Collator::EComparisonResult result = Collator::EQUAL;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
// The basic algorithm here is that we use CollationElementIterators
|
||||
// to step through both the source and target strings. We compare each
|
||||
@ -1143,13 +1143,13 @@ RuleBasedCollator::getCollationKey( const UnicodeString& source,
|
||||
{
|
||||
if (FAILURE(status))
|
||||
{
|
||||
status = ILLEGAL_ARGUMENT_ERROR;
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return sortkey.setToBogus();
|
||||
}
|
||||
|
||||
if (source.isBogus())
|
||||
{
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return sortkey.setToBogus();
|
||||
}
|
||||
|
||||
@ -1253,7 +1253,7 @@ RuleBasedCollator::getCollationKey( const UnicodeString& source,
|
||||
|
||||
if (sortkey.isBogus())
|
||||
{
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return sortkey;
|
||||
}
|
||||
|
||||
@ -1363,7 +1363,7 @@ RuleBasedCollator::build(const UnicodeString& pattern,
|
||||
|
||||
if (data->mapping->fBogus)
|
||||
{
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1376,7 +1376,7 @@ RuleBasedCollator::build(const UnicodeString& pattern,
|
||||
|
||||
if (pattern.size() == 0)
|
||||
{
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1471,7 +1471,7 @@ RuleBasedCollator::build(const UnicodeString& pattern,
|
||||
void RuleBasedCollator::addComposedChars()
|
||||
{
|
||||
UnicodeString buf;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
// Iterate through all of the pre-composed characters in Unicode
|
||||
ComposedCharIter iter;
|
||||
@ -1650,7 +1650,7 @@ RuleBasedCollator::addOrder(UChar ch,
|
||||
key += ch;
|
||||
if (key.isBogus())
|
||||
{
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1754,7 +1754,7 @@ RuleBasedCollator::addContractOrder(const UnicodeString& groupChars,
|
||||
{
|
||||
delete data->contractTable;
|
||||
data->contractTable = NULL;
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1777,7 +1777,7 @@ RuleBasedCollator::addContractOrder(const UnicodeString& groupChars,
|
||||
delete entryTable;
|
||||
delete data->contractTable;
|
||||
data->contractTable = NULL;
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1787,7 +1787,7 @@ RuleBasedCollator::addContractOrder(const UnicodeString& groupChars,
|
||||
delete entryTable;
|
||||
delete data->contractTable;
|
||||
data->contractTable = NULL;
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1800,7 +1800,7 @@ RuleBasedCollator::addContractOrder(const UnicodeString& groupChars,
|
||||
delete entryTable;
|
||||
delete data->contractTable;
|
||||
data->contractTable = NULL;
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1812,7 +1812,7 @@ RuleBasedCollator::addContractOrder(const UnicodeString& groupChars,
|
||||
delete entryTable;
|
||||
delete data->contractTable;
|
||||
data->contractTable = NULL;
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1846,7 +1846,7 @@ RuleBasedCollator::addContractOrder(const UnicodeString& groupChars,
|
||||
delete entryTable;
|
||||
delete data->contractTable;
|
||||
data->contractTable = NULL;
|
||||
status = MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2163,7 +2163,7 @@ RuleBasedCollator::constructFromCache(const UnicodeString& key,
|
||||
data = TableCollationData::findInCache(key);
|
||||
if (data == NULL)
|
||||
{
|
||||
status = MISSING_RESOURCE_ERROR;
|
||||
status = U_MISSING_RESOURCE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -176,12 +176,12 @@ class RuleBasedCollatorStreamer;
|
||||
* <p>To create a table-based collation object, simply supply the collation
|
||||
* rules to the RuleBasedCollator contructor. For example:
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . RuleBasedCollator *mySimple = new RuleBasedCollator(Simple, status);
|
||||
* </pre>
|
||||
* <p>Another example:
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . RuleBasedCollator *myNorwegian = new RuleBasedCollator(Norwegian, status);
|
||||
* </pre>
|
||||
* To add rules on top of an existing table, simply supply the orginal rules
|
||||
@ -200,7 +200,7 @@ class RuleBasedCollatorStreamer;
|
||||
* the English collation rules and add the additional rules to the table.
|
||||
* For example:
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . UnicodeString rules(DEFAULTRULES);
|
||||
* . rules += "& C < ch, cH, Ch, CH";
|
||||
* . RuleBasedCollator *mySpanish = new RuleBasedCollator(rules, status);
|
||||
@ -208,7 +208,7 @@ class RuleBasedCollatorStreamer;
|
||||
* <p>In order to sort symbols in the similiar order of sorting their
|
||||
* alphabetic equivalents, you can do the following,
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . UnicodeString rules(DEFAULTRULES);
|
||||
* . rules += "& Question-mark ; '?' & Ampersand ; '&' & Dollar-sign ; '$' ";
|
||||
* . RuleBasedCollator *myTable = new RuleBasedCollator(rules, status);
|
||||
@ -216,13 +216,13 @@ class RuleBasedCollatorStreamer;
|
||||
* <p>Another way of creating the table-based collation object, mySimple,
|
||||
* is:
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . RuleBasedCollator *mySimple = new
|
||||
* . RuleBasedCollator(" < a < b & b < c & c < d", status);
|
||||
* </pre>
|
||||
* Or,
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . RuleBasedCollator *mySimple = new
|
||||
* . RuleBasedCollator(" < a < b < d & b < c", status);
|
||||
* </pre>
|
||||
@ -277,7 +277,7 @@ class RuleBasedCollatorStreamer;
|
||||
* . '<', 'c', ',', 'C', '<', 'e', ',', 'E', '&',
|
||||
* . 'C', '<', 'd', ',', 'D', 0 };
|
||||
* . UnicodeString oldRules(contents);
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . // change the order of accent characters
|
||||
* . UChar addOn[] = { '&', ',', 0x0300, ';', 0x0308, ';', 0x0302, 0 };
|
||||
* . oldRules += addOn;
|
||||
@ -288,7 +288,7 @@ class RuleBasedCollatorStreamer;
|
||||
* default setting. For example, in Japanese collation, you can either sort
|
||||
* English characters before or after Japanese characters,
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . // get en_US collation rules
|
||||
* . RuleBasedCollator* en_USCollation =
|
||||
* . (RuleBasedCollator*) Collator::createInstance(Locale::US, status);
|
||||
|
@ -82,7 +82,7 @@ const UnicodeString TimeZone::CUSTOM_ID = "Custom";
|
||||
|
||||
const TimeZone* TimeZone::GMT = new SimpleTimeZone(0, GMT_ID);
|
||||
|
||||
UErrorCode TimeZone::fgStatus = ZERO_ERROR;
|
||||
UErrorCode TimeZone::fgStatus = U_ZERO_ERROR;
|
||||
|
||||
/* Lazy evaluated. HPUX CC compiler can't handle array initialization
|
||||
with complex objects */
|
||||
@ -1848,7 +1848,7 @@ TimeZone::getHashtable()
|
||||
|
||||
// build a hashtable that contains all the TimeZone objects in kSystemTimeZones
|
||||
// and maps their IDs to the actual TimeZone objects (gives us fast lookup)
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
newHashtable = uhash_open((UHashFunction) uhash_hashUString, &err);
|
||||
uhash_setValueDeleter(newHashtable, TimeZone::deleteTimeZone);
|
||||
|
||||
@ -1892,7 +1892,7 @@ TimeZone::stringToInteger(const UnicodeString& string, UErrorCode& status)
|
||||
|
||||
int32_t len = string.size();
|
||||
char *number = new char[1 + len];
|
||||
if (number == 0) { status = MEMORY_ALLOCATION_ERROR; return 0; }
|
||||
if (number == 0) { status = U_MEMORY_ALLOCATION_ERROR; return 0; }
|
||||
char *end;
|
||||
|
||||
string.extract(0, len, number);
|
||||
@ -1902,7 +1902,7 @@ TimeZone::stringToInteger(const UnicodeString& string, UErrorCode& status)
|
||||
delete[] number;
|
||||
|
||||
if (end-number != len || len == 0)
|
||||
status = INVALID_FORMAT_ERROR;
|
||||
status = U_INVALID_FORMAT_ERROR;
|
||||
|
||||
return value;
|
||||
}*/
|
||||
@ -2131,7 +2131,7 @@ TimeZone::getDisplayName(bool_t daylight, EDisplayType style, const Locale& loca
|
||||
initSystemTimeZones();
|
||||
}
|
||||
// SRL TODO: cache the SDF, just like java.
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
SimpleDateFormat format(style == LONG ? "zzzz" : "z",locale,status);
|
||||
|
||||
@ -2199,7 +2199,7 @@ TimeZone::createCustomTimeZone(const UnicodeString& id)
|
||||
return 0;
|
||||
pos.setIndex(pos.getIndex() + 1);
|
||||
|
||||
UErrorCode success = ZERO_ERROR;
|
||||
UErrorCode success = U_ZERO_ERROR;
|
||||
numberFormat = NumberFormat::createInstance(success);
|
||||
numberFormat->setParseIntegerOnly(TRUE);
|
||||
|
||||
|
@ -50,7 +50,7 @@ ubrk_open(UBreakIteratorType type,
|
||||
|
||||
// check for allocation error
|
||||
if(result == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ ubrk_open(UBreakIteratorType type,
|
||||
UCharCharacterIterator *iter = 0;
|
||||
iter = new UCharCharacterIterator(text, textLen);
|
||||
if(iter == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
delete result;
|
||||
return 0;
|
||||
}
|
||||
@ -140,4 +140,3 @@ ubrk_countAvailable()
|
||||
{
|
||||
return uloc_countAvailable();
|
||||
}
|
||||
|
||||
|
@ -33,14 +33,14 @@ ucal_getAvailableTZIDs( int32_t rawOffset,
|
||||
count);
|
||||
|
||||
if(tzs == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(index < count)
|
||||
retVal = tzs[index]->getUChars();
|
||||
else
|
||||
*status = INDEX_OUTOFBOUNDS_ERROR;
|
||||
*status = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
|
||||
delete [] tzs;
|
||||
return retVal;
|
||||
@ -55,7 +55,7 @@ ucal_countAvailableTZIDs(int32_t rawOffset)
|
||||
count);
|
||||
|
||||
if(tzs == 0) {
|
||||
// TBD: MEMORY_ALLOCATION_ERROR
|
||||
// TBD: U_MEMORY_ALLOCATION_ERROR
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -90,14 +90,14 @@ ucal_open( const UChar* zoneID,
|
||||
length, length));
|
||||
}
|
||||
if(zone == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Calendar *cal = 0;
|
||||
cal = Calendar::createInstance(zone, Locale().init(locale), *status);
|
||||
if(cal == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
delete zone;
|
||||
return 0;
|
||||
}
|
||||
@ -129,7 +129,7 @@ ucal_setTimeZone( UCalendar* cal,
|
||||
length, length));
|
||||
}
|
||||
if(zone == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ ucol_open( const char *loc,
|
||||
col = Collator::createInstance(Locale().init(loc), *status);
|
||||
|
||||
if(col == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ ucol_openRules( const UChar *rules,
|
||||
*status);
|
||||
|
||||
if(col == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -295,7 +295,7 @@ ucol_getSortKey(const UCollator *coll,
|
||||
int32_t len = (sourceLength == -1 ? u_strlen(source)
|
||||
: sourceLength);
|
||||
UnicodeString string((UChar*)source, len, len);
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
((Collator*)coll)->getCollationKey(string, key, status);
|
||||
if(FAILURE(status))
|
||||
@ -307,7 +307,7 @@ ucol_getSortKey(const UCollator *coll,
|
||||
icu_arrayCopy((const int8_t*)bytes, (int8_t*)result, copyLen);
|
||||
|
||||
// if(count > resultLength) {
|
||||
// *status = BUFFER_OVERFLOW_ERROR;
|
||||
// *status = U_BUFFER_OVERFLOW_ERROR;
|
||||
// }
|
||||
|
||||
return count;
|
||||
@ -333,7 +333,7 @@ ucol_openElements( const UCollator *coll,
|
||||
CollationElementIterator *iter = 0;
|
||||
iter = ((RuleBasedCollator*)coll)->createCollationElementIterator(src);
|
||||
if(iter == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* <blockquote>
|
||||
* <pre>
|
||||
* // Compare two strings in the default locale
|
||||
* UErrorCode success = ZERO_ERROR;
|
||||
* UErrorCode success = U_ZERO_ERROR;
|
||||
* UCollator* myCollator = ucol_open(NULL, &success);
|
||||
* UChar source[4], target[4];
|
||||
* u_uastrcpy(source, "abc");
|
||||
@ -62,7 +62,7 @@
|
||||
* <blockquote>
|
||||
* <pre>
|
||||
* //Get the Collator for US English and set its strength to UCOL_PRIMARY
|
||||
* UErrorCode success = ZERO_ERROR;
|
||||
* UErrorCode success = U_ZERO_ERROR;
|
||||
* UCollator* usCollator = ucol_open("en_US", &success);
|
||||
* ucol_setStrength(usCollator, UCOL_PRIMARY);
|
||||
* UChar source[4], target[4];
|
||||
@ -416,7 +416,7 @@ ucol_getStrength(const UCollator *coll);
|
||||
* <pre>
|
||||
* . UCollationResult result;
|
||||
* . UChar *source, *target;
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . UCollator *myCollation = ucol_open("en_US", status);
|
||||
* . if (FAILURE(&status)) return;
|
||||
* . ucol_setStrength(myCollation, UCOL_PRIMARY);
|
||||
@ -570,7 +570,7 @@ typedef struct UCollationElements UCollationElements;
|
||||
* . t_int32 order, primaryOrder;
|
||||
* . UCollationElements *c;
|
||||
* . UCollator *coll;
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . s=(UChar*)malloc(sizeof(UChar) * (strlen("This is a test")+1) );
|
||||
* . u_uastrcpy(s, "This is a test");
|
||||
* . coll = ucol_open(NULL, &success);
|
||||
|
@ -45,7 +45,7 @@ udat_open( UDateFormatStyle timeStyle,
|
||||
Locale().init(locale));
|
||||
|
||||
if(fmt == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ udat_open( UDateFormatStyle timeStyle,
|
||||
zone = TimeZone::createTimeZone(UnicodeString((UChar*)tzID,
|
||||
length, length));
|
||||
if(zone == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
delete fmt;
|
||||
return 0;
|
||||
}
|
||||
@ -87,7 +87,7 @@ udat_openPattern( const UChar *pattern,
|
||||
*status);
|
||||
|
||||
if(retVal == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
return retVal;
|
||||
@ -108,7 +108,7 @@ udat_clone(const UDateFormat *fmt,
|
||||
Format *res = ((SimpleDateFormat*)fmt)->clone();
|
||||
|
||||
if(res == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ udat_parse( const UDateFormat* format,
|
||||
*parsePos = pp.getIndex();
|
||||
else {
|
||||
*parsePos = pp.getErrorIndex();
|
||||
*status = PARSE_ERROR;
|
||||
*status = U_PARSE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@ -274,7 +274,7 @@ udat_applyPattern( UDateFormat *format,
|
||||
{
|
||||
int32_t len = (patternLength == -1 ? u_strlen(pattern) : patternLength);
|
||||
const UnicodeString pat((UChar*)pattern, len, len);
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
if(localized)
|
||||
((SimpleDateFormat*)format)->applyLocalizedPattern(pat, status);
|
||||
@ -419,7 +419,7 @@ udat_setSymbols( UDateFormat *format,
|
||||
UnicodeString *array = 0;
|
||||
|
||||
if(syms == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -428,7 +428,7 @@ udat_setSymbols( UDateFormat *format,
|
||||
res = syms->getEras(count);
|
||||
array = new UnicodeString[count];
|
||||
if(array == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
icu_arrayCopy(res, array, count);
|
||||
@ -441,7 +441,7 @@ udat_setSymbols( UDateFormat *format,
|
||||
res = syms->getMonths(count);
|
||||
array = new UnicodeString[count];
|
||||
if(array == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
icu_arrayCopy(res, array, count);
|
||||
@ -454,7 +454,7 @@ udat_setSymbols( UDateFormat *format,
|
||||
res = syms->getShortMonths(count);
|
||||
array = new UnicodeString[count];
|
||||
if(array == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
icu_arrayCopy(res, array, count);
|
||||
@ -467,7 +467,7 @@ udat_setSymbols( UDateFormat *format,
|
||||
res = syms->getWeekdays(count);
|
||||
array = new UnicodeString[count];
|
||||
if(array == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
icu_arrayCopy(res, array, count);
|
||||
@ -480,7 +480,7 @@ udat_setSymbols( UDateFormat *format,
|
||||
res = syms->getShortWeekdays(count);
|
||||
array = new UnicodeString[count];
|
||||
if(array == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
icu_arrayCopy(res, array, count);
|
||||
@ -493,7 +493,7 @@ udat_setSymbols( UDateFormat *format,
|
||||
res = syms->getAmPmStrings(count);
|
||||
array = new UnicodeString[count];
|
||||
if(array == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
icu_arrayCopy(res, array, count);
|
||||
|
@ -39,8 +39,8 @@
|
||||
* . t_int32 myStrlen=0;
|
||||
* . UDateFormat* dfmt = udat_open(UCAL_DEFAULT, UCAL_DEFAULT, NULL, "PST", &status);
|
||||
* . myStrlen = udat_format(dfmt, myDate, NULL, myStrlen, &pos, &status);
|
||||
* . if(status==BUFFER_OVERFLOW_ERROR){
|
||||
* . status=ZERO_ERROR;
|
||||
* . if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
* . status=U_ZERO_ERROR;
|
||||
* . myString=(UChar*)malloc(sizeof(UChar) * (myStrlen+1) );
|
||||
* . udat_format(dfmt, myDate, myString, myStrlen+1, &pos, &status);
|
||||
* . }
|
||||
@ -55,8 +55,8 @@
|
||||
* . UDateFormat* df = udat_open(UCAL_DEFAULT, UCAL_DEFAULT, NULL, "GMT", &status);
|
||||
* . for (i = 0; i < 3; ++i) {
|
||||
* . myStrlen = udat_format(df, myDate, NULL, myStrlen, &pos, &status);
|
||||
* . if(status==BUFFER_OVERFLOW_ERROR){
|
||||
* . status=ZERO_ERROR;
|
||||
* . if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
* . status=U_ZERO_ERROR;
|
||||
* . myString=(UChar*)malloc(sizeof(UChar) * (myStrlen+1) );
|
||||
* . udat_format(df, myDate, myString, myStrlen+1, &pos, &status);
|
||||
* . }
|
||||
@ -71,7 +71,7 @@
|
||||
* </pre>
|
||||
* You can use a DateFormat API udat_parse() to parse.
|
||||
* <pre>
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . t_int32 parsepos=0;
|
||||
* . UDate myDate = udat_parse(df, myString, u_strlen(myString), &parsepos, &status);
|
||||
* </pre>
|
||||
|
@ -218,7 +218,7 @@ UnicodeString&
|
||||
umsg_itos(int32_t i,
|
||||
UnicodeString& string)
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
NumberFormat *myFormat = umsg_getNumberFormat(status);
|
||||
|
||||
if(FAILURE(status))
|
||||
@ -324,7 +324,7 @@ u_formatMessage( const char *locale,
|
||||
int32_t argNum = umsg_stoi(pattern + bracePos + 1, *status);
|
||||
|
||||
if(argNum >= MAX_ARGS) {
|
||||
*status = INTERNAL_PROGRAM_ERROR;
|
||||
*status = U_INTERNAL_PROGRAM_ERROR;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -350,7 +350,7 @@ u_formatMessage( const char *locale,
|
||||
|
||||
// detect any unmatched braces in the pattern
|
||||
if(braceStack == 0 && part != 0) {
|
||||
*status = INVALID_FORMAT_ERROR;
|
||||
*status = U_INVALID_FORMAT_ERROR;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
* . UCalendar *cal;
|
||||
* . UDate d1;
|
||||
* . UDateFormat *def1;
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . str=(UChar*)malloc(sizeof(UChar) * (strlen("disturbance in force") +1));
|
||||
* . u_uastrcpy(str, "disturbance in force");
|
||||
* . tzID=(UChar*)malloc(sizeof(UChar) * 4);
|
||||
@ -43,8 +43,8 @@
|
||||
* . u_uastrcpy(pattern, "On {0, date, long}, there was a {1} on planet {2,number,integer}");
|
||||
* . resultlength=0;
|
||||
* . resultLengthOut=u_formatMessage( "en_US", pattern, u_strlen(pattern), NULL, resultlength, &status, d1, str, 7);
|
||||
* . if(status==BUFFER_OVERFLOW_ERROR){
|
||||
* . status=ZERO_ERROR;
|
||||
* . if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
* . status=U_ZERO_ERROR;
|
||||
* . resultlength=resultLengthOut+1;
|
||||
* . result=(UChar*)realloc(result, sizeof(UChar) * resultlength);
|
||||
* . u_formatMessage( "en_US", pattern, u_strlen(pattern), result, resultlength, &status, d1, str, 7);
|
||||
@ -58,7 +58,7 @@
|
||||
* Example 2:
|
||||
* <pre>
|
||||
* . UChar* str;
|
||||
* . UErrorCode status = ZERO_ERROR;
|
||||
* . UErrorCode status = U_ZERO_ERROR;
|
||||
* . UChar *result;
|
||||
* . UChar pattern[100];
|
||||
* . t_int32 resultlength,resultLengthOut, i;
|
||||
@ -69,8 +69,8 @@
|
||||
* . for(i=0; i<3; i++){
|
||||
* . resultlength=0;
|
||||
* . resultLengthOut=u_formatMessage( "en_US", pattern, u_strlen(pattern), NULL, resultlength, &status, testArgs[i], str);
|
||||
* . if(status==BUFFER_OVERFLOW_ERROR){
|
||||
* . status=ZERO_ERROR;
|
||||
* . if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
* . status=U_ZERO_ERROR;
|
||||
* . resultlength=resultLengthOut+1;
|
||||
* . result=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
* . u_formatMessage( "en_US", pattern, u_strlen(pattern), result, resultlength, &status, testArgs[i], str);
|
||||
|
@ -62,13 +62,13 @@ unum_open( UNumberFormatStyle style,
|
||||
case UNUM_SPELLOUT:
|
||||
// TBD: Add spellout support
|
||||
//retVal = (UNumberFormat*)new NumberSpelloutFormat();
|
||||
*status = UNSUPPORTED_ERROR;
|
||||
*status = U_UNSUPPORTED_ERROR;
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if(retVal == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -94,14 +94,14 @@ unum_openPattern( const UChar* pattern,
|
||||
*status);
|
||||
|
||||
if(syms == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
DecimalFormat *fmt = 0;
|
||||
fmt = new DecimalFormat(pat, syms, *status);
|
||||
if(fmt == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
delete syms;
|
||||
return 0;
|
||||
}
|
||||
@ -124,7 +124,7 @@ unum_clone(const UNumberFormat *fmt,
|
||||
Format *res = ((DecimalFormat*)fmt)->clone();
|
||||
|
||||
if(res == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -213,7 +213,7 @@ unum_parse( const UNumberFormat* fmt,
|
||||
*parsePos = pp.getIndex();
|
||||
else {
|
||||
*parsePos = pp.getErrorIndex();
|
||||
*status = PARSE_ERROR;
|
||||
*status = U_PARSE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@ -247,7 +247,7 @@ unum_parseDouble( const UNumberFormat* fmt,
|
||||
*parsePos = pp.getIndex();
|
||||
else {
|
||||
*parsePos = pp.getErrorIndex();
|
||||
*status = PARSE_ERROR;
|
||||
*status = U_PARSE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@ -471,7 +471,7 @@ unum_getTextAttribute( const UNumberFormat* fmt,
|
||||
break;
|
||||
|
||||
default:
|
||||
*status = UNSUPPORTED_ERROR;
|
||||
*status = U_UNSUPPORTED_ERROR;
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
@ -515,7 +515,7 @@ unum_setTextAttribute( UNumberFormat* fmt,
|
||||
break;
|
||||
|
||||
default:
|
||||
*status = UNSUPPORTED_ERROR;
|
||||
*status = U_UNSUPPORTED_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -595,7 +595,7 @@ unum_setSymbols( UNumberFormat* fmt,
|
||||
|
||||
DecimalFormatSymbols *syms = new DecimalFormatSymbols(*status);
|
||||
if(syms == 0) {
|
||||
*status = MEMORY_ALLOCATION_ERROR;
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
* . UChar myString[20];
|
||||
* . UFieldPosition pos=0;
|
||||
* . double myNumber = 7.0;
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . UNumberFormat* nf = unum_open(UNUM_DEFAULT, NULL, &success)
|
||||
* . unum_formatDouble(nf, myNumber, myString, u_strlen(myString), &pos, &status);
|
||||
* . printf(" Example 1: %s\n", austrdup(myString) ); //austrdup( a function used to convert UChar* to char*)
|
||||
@ -50,7 +50,7 @@
|
||||
* <pre>
|
||||
* . UChar* myString;
|
||||
* . t_int32 i, resultlength, reslenneeded;
|
||||
* . UErrorCode success = ZERO_ERROR;
|
||||
* . UErrorCode success = U_ZERO_ERROR;
|
||||
* . UFieldPosition pos=0;
|
||||
* . t_int32 a[] = { 123, 3333, -1234567 };
|
||||
* . const t_int32 a_len = sizeof(a) / sizeof(a[0]);
|
||||
@ -58,8 +58,8 @@
|
||||
* . for (i = 0; i < a_len; i++) {
|
||||
* . resultlength=0;
|
||||
* . reslenneeded=unum_format(nf, a[i], NULL, resultlength, &pos, &status);
|
||||
* . if(status==BUFFER_OVERFLOW_ERROR){
|
||||
* . status=ZERO_ERROR;
|
||||
* . if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
* . status=U_ZERO_ERROR;
|
||||
* . resultlength=resultlengthneeded+1;
|
||||
* . result=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
* . unum_format(nf, a[i], result, resultlength, &pos, &status);
|
||||
|
@ -118,7 +118,7 @@ void usage(char * exeName)
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
char* inFileName;
|
||||
char* outFileName;
|
||||
char * encName = NULL;
|
||||
@ -201,7 +201,7 @@ void convertFile(char* encName, char* iFN, char* oFN, UConverter* outConvrtr)
|
||||
char rawBuf[RAWBUFSIZE];
|
||||
char* pRawBuf = NULL;
|
||||
unsigned long bytesRead = 0;
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
||||
//get the file size
|
||||
//
|
||||
@ -356,7 +356,7 @@ void convertFile(char* encName, char* iFN, char* oFN, UConverter* outConvrtr)
|
||||
char *outBuf = new char[RAWBUFSIZE];
|
||||
int outBufSize = RAWBUFSIZE;
|
||||
bool tFlush = false;
|
||||
err = ZERO_ERROR;
|
||||
err = U_ZERO_ERROR;
|
||||
|
||||
if (verbose)
|
||||
fprintf(stdout, "processing the rest of the file \n");
|
||||
@ -382,7 +382,7 @@ void convertFile(char* encName, char* iFN, char* oFN, UConverter* outConvrtr)
|
||||
}
|
||||
}
|
||||
|
||||
if ((err != BUFFER_OVERFLOW_ERROR) && FAILURE(err) )
|
||||
if ((err != U_BUFFER_OVERFLOW_ERROR) && FAILURE(err) )
|
||||
{
|
||||
#if defined(_DEBUG)
|
||||
fprintf (stderr, "Error transcoding rest of the file: (%s) %d\n", errorName(err), err);
|
||||
@ -391,7 +391,7 @@ void convertFile(char* encName, char* iFN, char* oFN, UConverter* outConvrtr)
|
||||
fclose(outFile);
|
||||
exit(1);
|
||||
}
|
||||
if ((bytesRead > 0) && (err !=ZERO_ERROR))
|
||||
if ((bytesRead > 0) && (err !=U_ZERO_ERROR))
|
||||
{
|
||||
if(verbose)
|
||||
fprintf(stderr, "err=%d * read %d bytes\n", err,bytesRead);
|
||||
@ -411,8 +411,8 @@ void convertFile(char* encName, char* iFN, char* oFN, UConverter* outConvrtr)
|
||||
}
|
||||
toRead = (RAWBUFSIZE > bytesLeft) ? bytesLeft : RAWBUFSIZE;
|
||||
if (toRead < RAWBUFSIZE) tFlush = true;
|
||||
if (err == BUFFER_OVERFLOW_ERROR)
|
||||
err = ZERO_ERROR;
|
||||
if (err == U_BUFFER_OVERFLOW_ERROR)
|
||||
err = U_ZERO_ERROR;
|
||||
}
|
||||
ucnv_close(inConvrtr);
|
||||
delete inEncodName;
|
||||
@ -506,7 +506,7 @@ long convertFirstLine( FILE* inF, char* inEncName,
|
||||
char tempBuf[RAWBUFSIZE];
|
||||
int bufLength = 0;
|
||||
long bytesNeeded = 0;
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
||||
bytesNeeded = ucnv_convert("ascii",
|
||||
inEncName,
|
||||
@ -516,9 +516,9 @@ long convertFirstLine( FILE* inF, char* inEncName,
|
||||
bytesRead,
|
||||
&err);
|
||||
|
||||
if (err == BUFFER_OVERFLOW_ERROR)
|
||||
if (err == U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
err = ZERO_ERROR;
|
||||
err = U_ZERO_ERROR;
|
||||
}
|
||||
else if (FAILURE(err))
|
||||
{
|
||||
@ -767,7 +767,7 @@ long convertFirstLine( FILE* inF, char* inEncName,
|
||||
fwrite( (void*) uBuf, 1, 1, outF);
|
||||
}
|
||||
|
||||
err = ZERO_ERROR;
|
||||
err = U_ZERO_ERROR;
|
||||
long oneChar = 0;
|
||||
while ( *stringTwo != '\0' )
|
||||
{
|
||||
@ -779,9 +779,9 @@ long convertFirstLine( FILE* inF, char* inEncName,
|
||||
(const char*) stringTwo,
|
||||
1,
|
||||
&err);
|
||||
if (err == BUFFER_OVERFLOW_ERROR)
|
||||
if (err == U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
err = ZERO_ERROR;
|
||||
err = U_ZERO_ERROR;
|
||||
}
|
||||
else if (FAILURE(err))
|
||||
{
|
||||
@ -843,7 +843,7 @@ long convertFirstLine( FILE* inF, char* inEncName,
|
||||
//transcode this ascii type to the input encoding type
|
||||
//and get the pointer to the end of first line in the input buffer
|
||||
//
|
||||
err = ZERO_ERROR;
|
||||
err = U_ZERO_ERROR;
|
||||
endBytes = ucnv_convert(newInEncName,
|
||||
"ascii",
|
||||
(char*) newBuf,
|
||||
@ -852,9 +852,9 @@ long convertFirstLine( FILE* inF, char* inEncName,
|
||||
bufHere,
|
||||
&err);
|
||||
|
||||
if (err == BUFFER_OVERFLOW_ERROR)
|
||||
if (err == U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
err = ZERO_ERROR;
|
||||
err = U_ZERO_ERROR;
|
||||
}
|
||||
else if (FAILURE(err))
|
||||
{
|
||||
@ -914,7 +914,7 @@ int32_t XMLUConvert( UConverter* inConverter,
|
||||
flush,
|
||||
err);
|
||||
|
||||
if (*err == INDEX_OUTOFBOUNDS_ERROR) *err = BUFFER_OVERFLOW_ERROR;
|
||||
if (*err == U_INDEX_OUTOFBOUNDS_ERROR) *err = U_BUFFER_OVERFLOW_ERROR;
|
||||
|
||||
// *inBufSize = inBufferAlias;
|
||||
return outBufferAlias - outBuffer;
|
||||
@ -962,13 +962,13 @@ void XMLU_fromCodepageToCodepage( UConverter* outConverter,
|
||||
flush,
|
||||
err);
|
||||
|
||||
/*INDEX_OUTOFBOUNDS_ERROR means that the output "CHUNK" is full
|
||||
/*U_INDEX_OUTOFBOUNDS_ERROR means that the output "CHUNK" is full
|
||||
*we will require at least another loop (it's a recoverable error)
|
||||
*/
|
||||
|
||||
if (SUCCESS(*err) || (*err == INDEX_OUTOFBOUNDS_ERROR))
|
||||
if (SUCCESS(*err) || (*err == U_INDEX_OUTOFBOUNDS_ERROR))
|
||||
{
|
||||
*err = ZERO_ERROR;
|
||||
*err = U_ZERO_ERROR;
|
||||
out_chunk_alias2 = out_chunk;
|
||||
|
||||
while ((out_chunk_alias2 != out_chunk_alias) && SUCCESS(*err))
|
||||
@ -1017,13 +1017,13 @@ void XMLU_fromCodepageToCodepage( UConverter* outConverter,
|
||||
flush,
|
||||
err);
|
||||
|
||||
/*INDEX_OUTOFBOUNDS_ERROR means that the output "CHUNK" is full
|
||||
/*U_INDEX_OUTOFBOUNDS_ERROR means that the output "CHUNK" is full
|
||||
*we will require at least another loop (it's a recoverable error)
|
||||
*/
|
||||
|
||||
if (SUCCESS (*err) || (*err == INDEX_OUTOFBOUNDS_ERROR))
|
||||
if (SUCCESS (*err) || (*err == U_INDEX_OUTOFBOUNDS_ERROR))
|
||||
{
|
||||
*err = ZERO_ERROR;
|
||||
*err = U_ZERO_ERROR;
|
||||
out_chunk_alias2 = out_chunk;
|
||||
|
||||
while ((out_chunk_alias2 != out_chunk_alias) && SUCCESS (*err))
|
||||
|
@ -82,7 +82,7 @@ main(int argc,
|
||||
int optind = 1;
|
||||
char *arg;
|
||||
int32_t month = -1, year = -1;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* parse the options */
|
||||
|
@ -56,7 +56,7 @@ uprint(const UChar *s,
|
||||
/* perform the conversion */
|
||||
do {
|
||||
/* reset the error code */
|
||||
*status = ZERO_ERROR;
|
||||
*status = U_ZERO_ERROR;
|
||||
|
||||
/* perform the conversion */
|
||||
ucnv_fromUnicode(converter, &myTarget, myTarget + arraySize,
|
||||
@ -70,7 +70,7 @@ uprint(const UChar *s,
|
||||
myTarget = buf;
|
||||
arraySize = BUF_SIZE;
|
||||
}
|
||||
while(*status == INDEX_OUTOFBOUNDS_ERROR);
|
||||
while(*status == U_INDEX_OUTOFBOUNDS_ERROR);
|
||||
|
||||
finish:
|
||||
|
||||
|
@ -55,7 +55,7 @@ main(int argc,
|
||||
char *arg;
|
||||
const UChar *tz = 0;
|
||||
UDateFormatStyle style = UDAT_DEFAULT;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
/* parse the options */
|
||||
@ -164,8 +164,8 @@ date(const UChar *tz,
|
||||
|
||||
fmt = udat_open(style, style, 0, tz, -1, status);
|
||||
len = udat_format(fmt, ucal_getNow(), 0, len, 0, status);
|
||||
if(*status == BUFFER_OVERFLOW_ERROR) {
|
||||
*status = ZERO_ERROR;
|
||||
if(*status == U_BUFFER_OVERFLOW_ERROR) {
|
||||
*status = U_ZERO_ERROR;
|
||||
s = (UChar*) malloc(sizeof(UChar) * (len+1));
|
||||
if(s == 0) goto finish;
|
||||
udat_format(fmt, ucal_getNow(), s, len + 1, 0, status);
|
||||
|
@ -58,7 +58,7 @@ uprint(const UChar *s,
|
||||
/* perform the conversion */
|
||||
do {
|
||||
/* reset the error code */
|
||||
*status = ZERO_ERROR;
|
||||
*status = U_ZERO_ERROR;
|
||||
|
||||
/* perform the conversion */
|
||||
ucnv_fromUnicode(converter, &myTarget, myTarget + arraySize,
|
||||
@ -72,7 +72,7 @@ uprint(const UChar *s,
|
||||
myTarget = buf;
|
||||
arraySize = BUF_SIZE;
|
||||
}
|
||||
while(*status == INDEX_OUTOFBOUNDS_ERROR);
|
||||
while(*status == U_INDEX_OUTOFBOUNDS_ERROR);
|
||||
|
||||
finish:
|
||||
|
||||
|
@ -422,7 +422,7 @@ void TestTertiary()
|
||||
{
|
||||
int32_t len,i;
|
||||
UChar *rules, *newRules;
|
||||
UErrorCode status=ZERO_ERROR;
|
||||
UErrorCode status=U_ZERO_ERROR;
|
||||
const char* str="& C < ch, cH, Ch, CH & Five, 5 & Four, 4 & one, 1 & Ampersand; '&' & Two, 2 ";
|
||||
newRules=(UChar*)malloc(sizeof(UChar*) * (strlen(str)+1));
|
||||
u_uastrcpy(newRules, str);
|
||||
@ -451,7 +451,7 @@ void TestPrimary( )
|
||||
{
|
||||
int32_t len,i;
|
||||
UChar *rules, *newRules;
|
||||
UErrorCode status=ZERO_ERROR;
|
||||
UErrorCode status=U_ZERO_ERROR;
|
||||
const char* str="& C < ch, cH, Ch, CH & Five, 5 & Four, 4 & one, 1 & Ampersand; '&' & Two, 2 ";
|
||||
|
||||
newRules=(UChar*)malloc(sizeof(UChar*) * strlen(str));
|
||||
@ -484,7 +484,7 @@ void TestSecondary()
|
||||
int32_t i;
|
||||
int32_t len;
|
||||
UChar *rules, *newRules;
|
||||
UErrorCode status=ZERO_ERROR;
|
||||
UErrorCode status=U_ZERO_ERROR;
|
||||
const char* str="& C < ch, cH, Ch, CH & Five, 5 & Four, 4 & one, 1 & Ampersand; '&' & Two, 2 ";
|
||||
|
||||
newRules=(UChar*)malloc(sizeof(UChar*) * strlen(str));
|
||||
@ -514,7 +514,7 @@ void TestIdentical()
|
||||
int32_t i;
|
||||
int32_t len;
|
||||
UChar *rules = 0, *newRules = 0;
|
||||
UErrorCode status=ZERO_ERROR;
|
||||
UErrorCode status=U_ZERO_ERROR;
|
||||
const char* str="& C < ch, cH, Ch, CH & Five, 5 & Four, 4 & one, 1 & Ampersand; '&' & Two, 2 ";
|
||||
|
||||
newRules=(UChar*)malloc(sizeof(UChar*) * strlen(str));
|
||||
@ -543,7 +543,7 @@ void TestExtra()
|
||||
int32_t i, j;
|
||||
int32_t len;
|
||||
UChar *rules, *newRules;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
const char* str="& C < ch, cH, Ch, CH & Five, 5 & Four, 4 & one, 1 & Ampersand; '&' & Two, 2 ";
|
||||
newRules=(UChar*)malloc(sizeof(UChar*) * strlen(str));
|
||||
u_uastrcpy(newRules, str);
|
||||
|
@ -56,7 +56,7 @@ void TestProperty()
|
||||
int32_t len;
|
||||
UChar *source, *target;
|
||||
int32_t tempLength;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
log_verbose("The property tests begin : \n");
|
||||
log_verbose("Test ucol_strcoll : \n");
|
||||
@ -115,8 +115,8 @@ void TestProperty()
|
||||
log_verbose("Get display name for the default collation in German : \n");
|
||||
|
||||
len=ucol_getDisplayName("en_US", "de_DE", NULL, 0, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR){
|
||||
status=ZERO_ERROR;
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
status=U_ZERO_ERROR;
|
||||
disName=(UChar*)malloc(sizeof(UChar) * (len+1));
|
||||
ucol_getDisplayName("en_US", "de_DE", disName, len+1, &status);
|
||||
}
|
||||
@ -155,8 +155,8 @@ void TestProperty()
|
||||
|
||||
log_verbose("Get display name for the french collation in english : \n");
|
||||
len=ucol_getDisplayName("fr_FR", "en_US", NULL, 0, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR){
|
||||
status=ZERO_ERROR;
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
status=U_ZERO_ERROR;
|
||||
disName=(UChar*)malloc(sizeof(UChar) * (len+1));
|
||||
ucol_getDisplayName("fr_FR", "en_US", disName, len+1, &status);
|
||||
}
|
||||
@ -180,7 +180,7 @@ void TestRuleBasedColl()
|
||||
UChar ruleset2[50];
|
||||
const UChar *rule1, *rule2, *rule3, *rule4;
|
||||
int32_t tempLength;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
u_uastrcpy(ruleset1, "< a, A < b, B < c, C; ch, cH, Ch, CH < d, D, e, E");
|
||||
u_uastrcpy(ruleset2, "< a, A < b, B < c, C < d, D, e, E");
|
||||
@ -193,7 +193,7 @@ void TestRuleBasedColl()
|
||||
else
|
||||
log_verbose("PASS: RuleBased Collator creation passed\n");
|
||||
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
col2 = ucol_openRules(ruleset2, u_strlen(ruleset2), UCOL_DEFAULT_NORMALIZATION, UCOL_DEFAULT_STRENGTH, &status);
|
||||
if (FAILURE(status)) {
|
||||
log_err("RuleBased Collator creation failed.: %s\n", myErrorName(status));
|
||||
@ -203,7 +203,7 @@ void TestRuleBasedColl()
|
||||
log_verbose("PASS: RuleBased Collator creation passed\n");
|
||||
|
||||
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
col3= ucol_open(NULL, &status);
|
||||
if (FAILURE(status)) {
|
||||
log_err("Default Collator creation failed.: %s\n", myErrorName(status));
|
||||
@ -237,13 +237,13 @@ void TestRuleBasedColl()
|
||||
|
||||
void TestCompare()
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UCollator *col;
|
||||
UChar* test1;
|
||||
UChar* test2;
|
||||
|
||||
log_verbose("The compare tests begin : \n");
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
col = ucol_open("en_US", &status);
|
||||
if(FAILURE(status)) {
|
||||
log_err("ucal_open() collation creation failed.: %s\n", myErrorName(status));
|
||||
@ -291,7 +291,7 @@ void TestSortKey()
|
||||
int32_t sortklen;
|
||||
UCollator *col;
|
||||
UChar *test1, *test2, *test3;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
log_verbose("testing SortKey begins...\n");
|
||||
col = ucol_open(NULL, &status);
|
||||
if (FAILURE(status)) {
|
||||
@ -353,7 +353,7 @@ void TestHashCode()
|
||||
int32_t sortk1len, sortk2len, sortk3len;
|
||||
UCollator *col;
|
||||
UChar *test1, *test2, *test3;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
log_verbose("testing getHashCode begins...\n");
|
||||
col = ucol_open("en_US", &status);
|
||||
if (FAILURE(status)) {
|
||||
@ -404,7 +404,7 @@ void TestElemIter()
|
||||
UChar *testString1, *testString2;
|
||||
UCollator *col;
|
||||
UCollationElements *iterator1, *iterator2, *iterator3;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
log_verbose("testing UCollatorElements begins...\n");
|
||||
col = ucol_open(NULL, &status);
|
||||
ucol_setNormalization(col, UCOL_NO_NORMALIZATION);
|
||||
@ -521,5 +521,3 @@ void TestGetAll()
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,13 +41,13 @@ void addBrkIterAPITest(TestNode** root)
|
||||
|
||||
void TestBreakIteratorCAPI()
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UBreakIterator *word, *sentence, *line, *character, *b;
|
||||
UChar text[50];
|
||||
UTextOffset start,pos,end,to;
|
||||
int32_t count = 0;
|
||||
u_uastrcpy(text, "He's from Africa. ""Mr. Livingston, I presume?"" Yeah");
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
|
||||
/*test ubrk_open()*/
|
||||
log_verbose("\nTesting BreakIterator open functions\n");
|
||||
|
@ -57,7 +57,7 @@ addComplexTest(TestNode** root) {
|
||||
extern void
|
||||
doBiDiTest() {
|
||||
UBiDi *pBiDi, *pLine=NULL;
|
||||
UErrorCode errorCode=ZERO_ERROR;
|
||||
UErrorCode errorCode=U_ZERO_ERROR;
|
||||
|
||||
log_verbose("*** bidi regression test ***\n");
|
||||
|
||||
@ -92,7 +92,7 @@ doTests(UBiDi *pBiDi, UBiDi *pLine) {
|
||||
UBiDiLevel paraLevel;
|
||||
|
||||
for(i=0; i<bidiTestCount; ++i) {
|
||||
errorCode=ZERO_ERROR;
|
||||
errorCode=U_ZERO_ERROR;
|
||||
s=getStringFromDirProps(tests[i].text, tests[i].length);
|
||||
paraLevel=tests[i].paraLevel;
|
||||
ubidi_setPara(pBiDi, s, -1, paraLevel, NULL, &errorCode);
|
||||
@ -126,7 +126,7 @@ doTest(UBiDi *pBiDi, int testNumber, BiDiTestData *test, UTextOffset lineStart)
|
||||
const UBiDiLevel *levels=test->levels;
|
||||
const uint8_t *visualMap=test->visualMap;
|
||||
UTextOffset i, len=ubidi_getLength(pBiDi), logicalIndex, runCount;
|
||||
UErrorCode errorCode=ZERO_ERROR;
|
||||
UErrorCode errorCode=U_ZERO_ERROR;
|
||||
UBiDiLevel level, level2;
|
||||
|
||||
testReordering(pBiDi, testNumber);
|
||||
@ -212,7 +212,7 @@ testReordering(UBiDi *pBiDi, int testNumber) {
|
||||
UTextOffset
|
||||
logicalMap1[200], logicalMap2[200], logicalMap3[200],
|
||||
visualMap1[200], visualMap2[200], visualMap3[200], visualMap4[200];
|
||||
UErrorCode errorCode=ZERO_ERROR;
|
||||
UErrorCode errorCode=U_ZERO_ERROR;
|
||||
UBiDiLevel levels[200];
|
||||
UTextOffset i, length=ubidi_getLength(pBiDi);
|
||||
UTextOffset runCount, visualIndex, logicalStart, runLength;
|
||||
|
@ -51,7 +51,7 @@ void TestCalendar()
|
||||
int32_t count, count2, offset,i;
|
||||
UChar *tzID = 0;
|
||||
UChar *tzdname = 0;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UDate now;
|
||||
UDateFormat *datdef = 0;
|
||||
UChar *result = 0;
|
||||
@ -143,9 +143,9 @@ void TestCalendar()
|
||||
resultlength=0;
|
||||
resultlengthneeded=ucal_getTimeZoneDisplayName(caldef, UCAL_DST, "en_US", NULL, resultlength, &status);
|
||||
|
||||
if(status==BUFFER_OVERFLOW_ERROR)
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthneeded+1;
|
||||
result=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
ucal_getTimeZoneDisplayName(caldef, UCAL_DST, "en_US", result, resultlength, &status);
|
||||
@ -246,7 +246,7 @@ void TestGetSetDateAPI()
|
||||
UDate d1;
|
||||
int32_t hour;
|
||||
UDateFormat *datdef = 0;
|
||||
UErrorCode status=ZERO_ERROR;
|
||||
UErrorCode status=U_ZERO_ERROR;
|
||||
UDate d2= 837039928046.0;
|
||||
UChar temp[30];
|
||||
|
||||
@ -405,7 +405,7 @@ void TestFieldGetSet()
|
||||
UChar *tzID = 0;
|
||||
UDateFormat *datdef = 0;
|
||||
UDate d1;
|
||||
UErrorCode status=ZERO_ERROR;
|
||||
UErrorCode status=U_ZERO_ERROR;
|
||||
log_verbose("\nFetching pointer to UCalendar using the ucal_open()\n");
|
||||
tzID=(UChar*)malloc(sizeof(UChar) * 4);
|
||||
u_uastrcpy(tzID, "GMT");
|
||||
@ -457,14 +457,14 @@ void TestFieldGetSet()
|
||||
ucal_set(cal, UCAL_DAY_OF_WEEK_IN_MONTH, - 1);
|
||||
verify1("1997 last Tuesday in June = ", cal, datdef,1997, UCAL_JUNE, 24);
|
||||
/*give undesirable input */
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
ucal_clear(cal);
|
||||
ucal_set(cal, UCAL_YEAR, 1997);
|
||||
ucal_set(cal, UCAL_DAY_OF_WEEK, UCAL_TUESDAY);
|
||||
ucal_set(cal, UCAL_MONTH, UCAL_JUNE);
|
||||
ucal_set(cal, UCAL_DAY_OF_WEEK_IN_MONTH, 0);
|
||||
d1=ucal_getMillis(cal,&status);
|
||||
if (status != ILLEGAL_ARGUMENT_ERROR){
|
||||
if (status != U_ILLEGAL_ARGUMENT_ERROR){
|
||||
log_err("FAIL: No IllegalArgumentError for :");
|
||||
log_err("1997 zero-th Tuesday in June \n");
|
||||
}
|
||||
@ -483,7 +483,7 @@ void TestFieldGetSet()
|
||||
ucal_set(cal, UCAL_MONTH, UCAL_JUNE);
|
||||
ucal_set(cal, UCAL_WEEK_OF_MONTH, 5);
|
||||
verify1("1997 Tuesday in week 5 of June = ", cal,datdef, 1997, UCAL_JULY, 1);
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
ucal_clear(cal);
|
||||
ucal_set(cal, UCAL_YEAR, 1997);
|
||||
ucal_set(cal, UCAL_DAY_OF_WEEK, UCAL_TUESDAY);
|
||||
@ -506,7 +506,7 @@ void TestFieldGetSet()
|
||||
verify1("1999 1st day of the year =", cal, datdef, 1999, UCAL_JANUARY, 1);
|
||||
ucal_set(cal, UCAL_MONTH, -3);
|
||||
d1=ucal_getMillis(cal,&status);
|
||||
if (status != ILLEGAL_ARGUMENT_ERROR){
|
||||
if (status != U_ILLEGAL_ARGUMENT_ERROR){
|
||||
log_err("FAIL: No IllegalArgumentError for :\"1999 -3th month \" ");
|
||||
}
|
||||
else
|
||||
@ -551,7 +551,7 @@ void TestAddRollExtensive()
|
||||
UCalendarDateFields e;
|
||||
int32_t y,m,d,hr,min,sec,ms;
|
||||
int32_t maxlimit = 40;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
y = 1997; m = UCAL_FEBRUARY; d = 1; hr = 1; min = 1; sec = 0; ms = 0;
|
||||
|
||||
log_verbose("Testing add and roll extensively\n");
|
||||
@ -593,12 +593,12 @@ void TestAddRollExtensive()
|
||||
++m;
|
||||
checkDate(cal, y, m, d);
|
||||
ucal_add(cal, -1, 10, &status);
|
||||
if(status==ILLEGAL_ARGUMENT_ERROR)
|
||||
if(status==U_ILLEGAL_ARGUMENT_ERROR)
|
||||
log_verbose("Pass: Illegal argument error as expected\n");
|
||||
else{
|
||||
log_err("Fail: No, illegal argument error as expected. Got....: %s\n", myErrorName(status));
|
||||
}
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
|
||||
|
||||
/*confirm that applying roll to various fields works fine*/
|
||||
@ -627,13 +627,13 @@ void TestAddRollExtensive()
|
||||
d = 2;
|
||||
checkDate(cal, y, m, d);
|
||||
ucal_roll(cal, -1, 10, &status);
|
||||
if(status==ILLEGAL_ARGUMENT_ERROR)
|
||||
if(status==U_ILLEGAL_ARGUMENT_ERROR)
|
||||
log_verbose("Pass: illegal arguement error as expected\n");
|
||||
else{
|
||||
log_err("Fail: no illegal argument error got..: %s\n", myErrorName(status));
|
||||
return;
|
||||
}
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
ucal_setDateTime(cal, 1999, UCAL_FEBRUARY, 28, 10, 30, 45, &status);
|
||||
if(FAILURE(status)){
|
||||
log_err("error is setting the datetime: %s\n", myErrorName(status));
|
||||
@ -645,7 +645,7 @@ void TestAddRollExtensive()
|
||||
|
||||
ucal_close(cal);
|
||||
/*--------------- */
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
/* Testing add and roll extensively */
|
||||
log_verbose("\nTesting the ucal_add() and ucal_roll() functions extensively\n");
|
||||
y = 1997; m = UCAL_FEBRUARY; d = 1; hr = 1; min = 1; sec = 0; ms = 0;
|
||||
@ -661,15 +661,15 @@ void TestAddRollExtensive()
|
||||
ucal_set(cal, UCAL_MINUTE, min);
|
||||
ucal_set(cal, UCAL_SECOND,sec);
|
||||
ucal_set(cal, UCAL_MILLISECOND, ms);
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
|
||||
log_verbose("\nTesting UCalendar add...\n");
|
||||
for(e = UCAL_YEAR;e < UCAL_FIELD_COUNT; e=(UCalendarDateFields)((int32_t)e + 1)) {
|
||||
limit = maxlimit;
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
for (i = 0; i < limit; i++) {
|
||||
ucal_add(cal, e, 1, &status);
|
||||
if (FAILURE(status)) { limit = i; status = ZERO_ERROR; }
|
||||
if (FAILURE(status)) { limit = i; status = U_ZERO_ERROR; }
|
||||
}
|
||||
for (i = 0; i < limit; i++) {
|
||||
ucal_add(cal, e, -1, &status);
|
||||
@ -683,10 +683,10 @@ void TestAddRollExtensive()
|
||||
log_verbose("\nTesting calendar ucal_roll()...\n");
|
||||
for(e = UCAL_YEAR;e < UCAL_FIELD_COUNT; e=(UCalendarDateFields)((int32_t)e + 1)) {
|
||||
int32_t limit = maxlimit;
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
for (i = 0; i < limit; i++) {
|
||||
ucal_roll(cal, e, 1, &status);
|
||||
if (FAILURE(status)) { limit = i; status = ZERO_ERROR; }
|
||||
if (FAILURE(status)) { limit = i; status = U_ZERO_ERROR; }
|
||||
}
|
||||
for (i = 0; i < limit; i++) {
|
||||
ucal_roll(cal, e, -1, &status);
|
||||
@ -709,7 +709,7 @@ void TestGetLimits()
|
||||
UCalendar *cal = 0;
|
||||
int32_t min, max, gr_min, le_max, ac_min, ac_max, val;
|
||||
UChar* tzID = 0;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
tzID=(UChar*)malloc(sizeof(UChar) * 4);
|
||||
@ -802,7 +802,7 @@ void TestDOWProgression()
|
||||
UDateFormat *datfor = 0;
|
||||
UDate date1;
|
||||
int32_t delta=24;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar* tzID = 0;
|
||||
tzID=(UChar*)malloc(sizeof(UChar) * 4);
|
||||
u_uastrcpy(tzID, "GMT");
|
||||
@ -877,7 +877,7 @@ void testZones(int32_t yr, int32_t mo, int32_t dt, int32_t hr, int32_t mn, int32
|
||||
UDate date1;
|
||||
double temp;
|
||||
UDateFormat *datfor = 0;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar* tzID = 0;
|
||||
tzID=(UChar*)malloc(sizeof(UChar) * 4);
|
||||
u_uastrcpy(tzID, "GMT");
|
||||
@ -953,7 +953,7 @@ void checkDateTime(UCalendar* c,
|
||||
int32_t ms, UCalendarDateFields field)
|
||||
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
if (ucal_get(c, UCAL_YEAR, &status) != y ||
|
||||
ucal_get(c, UCAL_MONTH, &status) != m ||
|
||||
ucal_get(c, UCAL_DATE, &status) != d ||
|
||||
@ -986,7 +986,7 @@ void checkDateTime(UCalendar* c,
|
||||
void checkDate(UCalendar* c, int32_t y, int32_t m, int32_t d)
|
||||
|
||||
{
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
if (ucal_get(c,UCAL_YEAR, &status) != y ||
|
||||
ucal_get(c, UCAL_MONTH, &status) != m ||
|
||||
ucal_get(c, UCAL_DATE, &status) != d) {
|
||||
@ -1014,7 +1014,7 @@ void checkDate(UCalendar* c, int32_t y, int32_t m, int32_t d)
|
||||
void verify1(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int32_t month, int32_t day)
|
||||
{
|
||||
UDate d1;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
if (ucal_get(c, UCAL_YEAR, &status) == year &&
|
||||
ucal_get(c, UCAL_MONTH, &status) == month &&
|
||||
ucal_get(c, UCAL_DATE, &status) == day) {
|
||||
@ -1050,7 +1050,7 @@ void verify2(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int3
|
||||
{
|
||||
UDate d1;
|
||||
char str[3];
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
if (ucal_get(c, UCAL_YEAR, &status) == year &&
|
||||
ucal_get(c, UCAL_MONTH, &status) == month &&
|
||||
ucal_get(c, UCAL_DATE, &status) == day &&
|
||||
@ -1091,5 +1091,3 @@ void verify2(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int3
|
||||
}
|
||||
|
||||
/*--------------------------------------------- */
|
||||
|
||||
|
||||
|
@ -41,11 +41,6 @@ int32_t strCaseIcmp(const char* a1,const char * a2);
|
||||
/*returns an action other than the one provided*/
|
||||
UCNV_FromUCallBack otherUnicodeAction(UCNV_FromUCallBack MIA);
|
||||
UCNV_ToUCallBack otherCharAction(UCNV_ToUCallBack MIA);
|
||||
/*Asciifies the ErrorCodes*/
|
||||
const char* errorString(UErrorCode err);
|
||||
const char* myErrorName(UErrorCode err);
|
||||
|
||||
|
||||
|
||||
|
||||
void addTestConvert(TestNode** root)
|
||||
@ -89,7 +84,7 @@ void TestConvert()
|
||||
int32_t k = 0;
|
||||
uint16_t codepage_index = 0;
|
||||
int32_t cp = 0;
|
||||
UErrorCode err = ZERO_ERROR;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
const char* available_conv;
|
||||
char ucs_file_name[UCS_FILE_NAME_SIZE];
|
||||
UCNV_FromUCallBack MIA1;
|
||||
@ -419,9 +414,9 @@ void TestConvert()
|
||||
displayname=(UChar*)malloc(1 * sizeof(UChar));
|
||||
len=0;
|
||||
disnamelen = ucnv_getDisplayName(myConverter,locale,displayname, len, &err);
|
||||
if(err==BUFFER_OVERFLOW_ERROR)
|
||||
if(err==U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
err=ZERO_ERROR;
|
||||
err=U_ZERO_ERROR;
|
||||
displayname=(UChar*)realloc(displayname, (disnamelen+1) * sizeof(UChar));
|
||||
ucnv_getDisplayName(myConverter,locale,displayname,disnamelen+1, &err);
|
||||
if(FAILURE(err))
|
||||
@ -568,9 +563,9 @@ void TestConvert()
|
||||
&err);
|
||||
/*if there is an buffer overflow then trap the values and pass them and make the actual call*/
|
||||
|
||||
if(err==BUFFER_OVERFLOW_ERROR)
|
||||
if(err==U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
err=ZERO_ERROR;
|
||||
err=U_ZERO_ERROR;
|
||||
uchar2=(UChar*)malloc((targetsize) * sizeof(UChar));
|
||||
targetsize = ucnv_toUChars(myConverter,
|
||||
uchar2,
|
||||
@ -691,6 +686,3 @@ UCNV_ToUCallBack otherCharAction(UCNV_ToUCallBack MIA)
|
||||
{
|
||||
return (MIA==(UCNV_ToUCallBack)MissingCharAction_STOP)?(UCNV_ToUCallBack)MissingCharAction_SUBSTITUTE:(UCNV_ToUCallBack)MissingCharAction_STOP;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -67,7 +67,7 @@ void currTest()
|
||||
int res;
|
||||
UCollator *c;
|
||||
uint8_t *sortKey1, *sortKey2;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UCollationResult compareResult, keyResult;
|
||||
UCollationResult expectedResult = UCOL_EQUAL;
|
||||
log_verbose("Testing currency of all locales\n");
|
||||
@ -103,7 +103,7 @@ void currTest()
|
||||
compareResult = ucol_strcoll(c, source, u_strlen(source), target, u_strlen(target));
|
||||
|
||||
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
|
||||
sortklen=ucol_getSortKey(c, source, u_strlen(source), NULL, 0);
|
||||
sortKey1=(uint8_t*)malloc(sizeof(uint8_t) * (sortklen+1));
|
||||
|
@ -223,7 +223,7 @@ void TestTertiary( )
|
||||
{
|
||||
|
||||
int32_t i,j;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
myCollation = ucol_open("da_DK", &status);
|
||||
if(FAILURE(status)){
|
||||
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
|
||||
@ -253,7 +253,7 @@ void TestPrimary()
|
||||
{
|
||||
|
||||
int32_t i;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
myCollation = ucol_open("da_DK", &status);
|
||||
if(FAILURE(status)){
|
||||
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
|
||||
|
@ -44,7 +44,7 @@ void TestDateFormat()
|
||||
{
|
||||
UDateFormat *def, *fr, *it, *de, *def1, *fr_pat;
|
||||
UDateFormat *copy;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar* result;
|
||||
const UCalendar *cal;
|
||||
const UNumberFormat *numformat1, *numformat2;
|
||||
@ -119,9 +119,9 @@ void TestDateFormat()
|
||||
/*format using def */
|
||||
resultlength=0;
|
||||
resultlengthneeded=udat_format(def, d, NULL, resultlength, &pos, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR)
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthneeded+1;
|
||||
result=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
udat_format(def, d, result, resultlength, &pos, &status);
|
||||
@ -176,7 +176,7 @@ free(result);
|
||||
|
||||
|
||||
/*Testing udat_openPattern() */
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
log_verbose("\nTesting the udat_openPattern with a specified pattern\n");
|
||||
/*for french locale */
|
||||
fr_pat=udat_openPattern(temp, u_strlen(temp), "fr_FR", &status);
|
||||
@ -196,9 +196,9 @@ free(result);
|
||||
|
||||
resultlength=0;
|
||||
resultlengthneeded=udat_toPattern(def1, FALSE, NULL, resultlength, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR)
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthneeded + 1;
|
||||
result=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
udat_toPattern(def1, FALSE, result, resultlength, &status);
|
||||
@ -233,7 +233,7 @@ free(result);
|
||||
if(FAILURE(status)) {
|
||||
log_err("ERROR: udat_get2DigitYearStart failed %s\n", myErrorName(status) );
|
||||
}
|
||||
status = ZERO_ERROR;
|
||||
status = U_ZERO_ERROR;
|
||||
udat_set2DigitYearStart(def1 ,d1, &status);
|
||||
if(FAILURE(status)) {
|
||||
log_err("ERROR: udat_set2DigitYearStart failed %s\n", myErrorName(status) );
|
||||
@ -301,7 +301,7 @@ free(result);
|
||||
void TestSymbols()
|
||||
{
|
||||
UDateFormat *def, *fr;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar *value, *result;
|
||||
int32_t resultlength;
|
||||
int32_t resultlengthout;
|
||||
@ -343,9 +343,9 @@ void TestSymbols()
|
||||
u_uastrcpy(pattern, "jeudi");
|
||||
resultlength=0;
|
||||
resultlengthout=udat_getSymbols(fr, UDAT_WEEKDAYS, 5 , NULL, resultlength, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR)
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthout+1;
|
||||
result=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
udat_getSymbols(fr, UDAT_WEEKDAYS, 5, result, resultlength, &status);
|
||||
@ -386,9 +386,9 @@ free(pattern);
|
||||
/*applying the pattern so that setSymbolss works */
|
||||
resultlength=0;
|
||||
resultlengthout=udat_toPattern(fr, FALSE, NULL, resultlength, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR)
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthout + 1;
|
||||
pattern=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
udat_toPattern(fr, FALSE, pattern, resultlength, &status);
|
||||
@ -402,9 +402,9 @@ free(pattern);
|
||||
udat_applyPattern(def, FALSE, pattern, u_strlen(pattern));
|
||||
resultlength=0;
|
||||
resultlengthout=udat_toPattern(def, FALSE, NULL, resultlength,&status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR)
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthout + 1;
|
||||
result=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
udat_toPattern(fr, FALSE,result, resultlength, &status);
|
||||
@ -424,8 +424,8 @@ free(pattern);
|
||||
/*testing set symbols */
|
||||
resultlength=0;
|
||||
resultlengthout=udat_getSymbols(fr, UDAT_MONTHS, 11 , NULL, resultlength, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR){
|
||||
status=ZERO_ERROR;
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthout+1;
|
||||
result=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
udat_getSymbols(fr, UDAT_MONTHS, 11, result, resultlength, &status);
|
||||
@ -445,8 +445,8 @@ free(pattern);
|
||||
|
||||
resultlength=0;
|
||||
resultlengthout=udat_getSymbols(def, UDAT_MONTHS, 11, NULL, resultlength, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR){
|
||||
status=ZERO_ERROR;
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthout+1;
|
||||
value=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
udat_getSymbols(def, UDAT_MONTHS, 11, value, resultlength, &status);
|
||||
@ -495,7 +495,7 @@ free(pattern);
|
||||
void VerifygetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t index, const char* expected)
|
||||
{
|
||||
UChar *pattern;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar *result;
|
||||
int32_t resultlength, resultlengthout;
|
||||
|
||||
@ -504,9 +504,9 @@ void VerifygetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t i
|
||||
u_uastrcpy(pattern, expected);
|
||||
resultlength=0;
|
||||
resultlengthout=udat_getSymbols(datfor, type, index , NULL, resultlength, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR)
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthout+1;
|
||||
result=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
udat_getSymbols(datfor, type, index, result, resultlength, &status);
|
||||
@ -532,7 +532,7 @@ void VerifysetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t i
|
||||
UChar *result;
|
||||
UChar *value;
|
||||
int32_t resultlength, resultlengthout;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
value=(UChar*)malloc(sizeof(UChar) * (strlen(expected) + 1));
|
||||
u_uastrcpy(value, expected);
|
||||
@ -545,8 +545,8 @@ void VerifysetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t i
|
||||
|
||||
resultlength=0;
|
||||
resultlengthout=udat_getSymbols(datfor, type, index, NULL, resultlength, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR){
|
||||
status=ZERO_ERROR;
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthout+1;
|
||||
result=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
udat_getSymbols(datfor, type, index, result, resultlength, &status);
|
||||
@ -574,12 +574,12 @@ void VerifygetsetSymbols(UDateFormat* from, UDateFormat* to, UDateFormatSymbolTy
|
||||
UChar *result;
|
||||
UChar *value;
|
||||
int32_t resultlength, resultlengthout;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
resultlength=0;
|
||||
resultlengthout=udat_getSymbols(from, type, index , NULL, resultlength, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR){
|
||||
status=ZERO_ERROR;
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthout+1;
|
||||
result=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
udat_getSymbols(from, type, index, result, resultlength, &status);
|
||||
@ -599,8 +599,8 @@ void VerifygetsetSymbols(UDateFormat* from, UDateFormat* to, UDateFormatSymbolTy
|
||||
|
||||
resultlength=0;
|
||||
resultlengthout=udat_getSymbols(to, type, index, NULL, resultlength, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR){
|
||||
status=ZERO_ERROR;
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthout+1;
|
||||
value=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
udat_getSymbols(to, type, index, value, resultlength, &status);
|
||||
@ -629,13 +629,13 @@ UChar* myNumformat(const UNumberFormat* numfor, double d)
|
||||
UChar *result2;
|
||||
int32_t resultlength, resultlengthneeded;
|
||||
UFieldPosition pos;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
resultlength=0;
|
||||
resultlengthneeded=unum_formatDouble(numfor, d, NULL, resultlength, &pos, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR)
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR)
|
||||
{
|
||||
status=ZERO_ERROR;
|
||||
status=U_ZERO_ERROR;
|
||||
resultlength=resultlengthneeded+1;
|
||||
result2=(UChar*)malloc(sizeof(UChar) * resultlength);
|
||||
unum_formatDouble(numfor, d, result2, resultlength, &pos, &status);
|
||||
|
@ -125,7 +125,7 @@ void TestTertiary( )
|
||||
{
|
||||
|
||||
int32_t i;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
myCollation = ucol_open("de_DE", &status);
|
||||
if(FAILURE(status)){
|
||||
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
|
||||
@ -144,7 +144,7 @@ void TestPrimary()
|
||||
{
|
||||
|
||||
int32_t i;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
myCollation = ucol_open("de_DE", &status);
|
||||
if(FAILURE(status)){
|
||||
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
|
||||
|
@ -48,7 +48,7 @@ void addDtFrDepTest(TestNode** root)
|
||||
void TestTwoDigitYearDSTParse()
|
||||
{
|
||||
UDateFormat *fullFmt, *fmt;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar *pattern;
|
||||
UDate d;
|
||||
UChar *str;
|
||||
@ -97,7 +97,7 @@ void TestPartialParse994()
|
||||
{
|
||||
int32_t pos;
|
||||
UDateFormat *f;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar *s;
|
||||
UDate d, null;
|
||||
null=0;
|
||||
@ -128,7 +128,7 @@ void tryPat994(UDateFormat* format, const char* pattern, const char* s, UDate ex
|
||||
UDate date;
|
||||
UDate null=0;
|
||||
int32_t pos;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
str=(UChar*)malloc(sizeof(UChar) * (strlen(s) + 1) );
|
||||
u_uastrcpy(str, s);
|
||||
pat=(UChar*)malloc(sizeof(UChar) * (strlen(pattern) + 1) );
|
||||
@ -166,7 +166,7 @@ void TestRunTogetherPattern985()
|
||||
UChar *pattern, *now, *then;
|
||||
UDateFormat *format;
|
||||
UDate date1, date2;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
pattern=(UChar*)malloc(sizeof(UChar) * (strlen("yyyyMMddHHmmssSSS")+1) );
|
||||
u_uastrcpy(pattern, "yyyyMMddHHmmssSSS");
|
||||
format = udat_openPattern(pattern, u_strlen(pattern), NULL, &status);
|
||||
@ -200,14 +200,14 @@ void TestCzechMonths459()
|
||||
UDateFormat *fmt;
|
||||
UCalendar *cal;
|
||||
UDate june, july, d;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
fmt = udat_open(UDAT_FULL, UDAT_FULL, "cs", NULL, 0, &status);
|
||||
if(FAILURE(status)){log_err("Error in constructing the date format\n"); }
|
||||
lneed=0;
|
||||
lneed=udat_toPattern(fmt, TRUE, NULL, lneed, &status);
|
||||
if(status==BUFFER_OVERFLOW_ERROR){
|
||||
status=ZERO_ERROR;
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR){
|
||||
status=U_ZERO_ERROR;
|
||||
pattern=(UChar*)malloc(sizeof(UChar) * (lneed+1) );
|
||||
udat_toPattern(fmt, TRUE, pattern, lneed+1, &status);
|
||||
}
|
||||
@ -254,7 +254,7 @@ void TestQuotePattern161()
|
||||
UDate currentTime_1;
|
||||
UChar *pattern, *tzID, *exp;
|
||||
UChar *dateString;
|
||||
UErrorCode status = ZERO_ERROR;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
pattern=(UChar*)malloc(sizeof(UChar) * (strlen("MM/dd/yyyy 'at' hh:mm:ss a zzz")+1) );
|
||||
u_uastrcpy(pattern, "MM/dd/yyyy 'at' hh:mm:ss a zzz");
|
||||
|
||||
@ -277,4 +277,3 @@ void TestQuotePattern161()
|
||||
log_err("Error in formatting a pattern with single quotes\n");
|
||||
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user