ICU-5968 apply --omitCollationRules to UCARules as well

X-SVN-Rev: 22743
This commit is contained in:
Markus Scherer 2007-10-03 22:39:28 +00:00
parent a5ab4206d7
commit acfe30c3c5
3 changed files with 27 additions and 2 deletions

View File

@ -309,6 +309,9 @@ parseUCARules(char *tag, uint32_t startline, const struct UString* comment, UErr
}
uprv_strcat(filename, cs);
if(gOmitCollationRules) {
return res_none();
}
ucbuf = ucbuf_open(filename, &cp, getShowWarning(),FALSE, status);

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 2000-2006, International Business Machines
* Copyright (C) 2000-2007, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -27,6 +27,13 @@
static UBool gIncludeCopyright = FALSE;
/*
* res_none() returns the address of kNoResource,
* for use in non-error cases when no resource is to be added to the bundle.
* (NULL is used in error cases.)
*/
static struct SResource kNoResource = { RES_NONE };
uint32_t res_write(UNewDataMemory *mem, struct SResource *res,
uint32_t usedOffset, UErrorCode *status);
@ -460,6 +467,11 @@ struct SResource* res_open(const struct UString* comment, UErrorCode* status){
return res;
}
struct SResource* res_none() {
return &kNoResource;
}
struct SResource* table_open(struct SRBRoot *bundle, char *tag, const struct UString* comment, UErrorCode *status) {
struct SResource *res = res_open(comment, status);
@ -872,6 +884,9 @@ void table_add(struct SResource *table, struct SResource *res, int linenumber, U
if (U_FAILURE(*status)) {
return;
}
if (res == &kNoResource) {
return;
}
/* remember this linenumber to report to the user if there is a duplicate key */
res->line = linenumber;

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 2000-2006, International Business Machines
* Copyright (C) 2000-2007, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -67,6 +67,13 @@ int32_t bundle_addtag(struct SRBRoot *bundle, const char *tag, UErrorCode *statu
/* Various resource types */
struct SResource* res_open(const struct UString* comment, UErrorCode* status);
/*
* Return a unique pointer to a dummy object,
* for use in non-error cases when no resource is to be added to the bundle.
* (NULL is used in error cases.)
*/
struct SResource* res_none(void);
struct SResTable {
uint32_t fCount;
uint32_t fChildrenSize;