/*
*******************************************************************************
*
-* Copyright (C) 1998-2010, International Business Machines
+* Copyright (C) 1998-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
#include "ucmndata.h" /* TODO: for reading the pool bundle */
/* Protos */
-void processFile(const char *filename, const char* cp, const char *inputDir, const char *outputDir, const char *packageName, UErrorCode *status);
+void processFile(const char *filename, const char* cp, const char *inputDir, const char *outputDir,
+ const char *packageName, UBool omitBinaryCollation, UErrorCode *status);
static char *make_res_filename(const char *filename, const char *outputDir,
const char *packageName, UErrorCode *status);
fprintf(stderr,
"Usage: %s [OPTIONS] [FILES]\n"
"\tReads the list of resource bundle source files and creates\n"
- "\tbinary version of reosurce bundles (.res files)\n",
+ "\tbinary version of resource bundles (.res files)\n",
argv[0]);
fprintf(stderr,
"Options:\n"
}
}
- initParser(options[NO_BINARY_COLLATION].doesOccur, options[NO_COLLATION_RULES].doesOccur);
+ initParser(options[NO_COLLATION_RULES].doesOccur);
/*added by Jing*/
if(options[LANGUAGE].doesOccur) {
if (isVerbose()) {
printf("Processing file \"%s\"\n", theCurrentFileName);
}
- processFile(arg, encoding, inputDir, outputDir, gPackageName, &status);
+ processFile(arg, encoding, inputDir, outputDir, gPackageName,
+ options[NO_BINARY_COLLATION].doesOccur,
+ &status);
}
uprv_free(poolBundle.fBytes);
/* Process a file */
void
-processFile(const char *filename, const char *cp, const char *inputDir, const char *outputDir, const char *packageName, UErrorCode *status) {
+processFile(
+ const char *filename, const char *cp, const char *inputDir, const char *outputDir, const char *packageName,
+ UBool omitBinaryCollation, UErrorCode *status) {
/*FileStream *in = NULL;*/
struct SRBRoot *data = NULL;
UCHARBUF *ucbuf = NULL;
}else{
filelen = (int32_t)uprv_strlen(filename);
}
+
if(inputDir == NULL) {
const char *filenameBegin = uprv_strrchr(filename, U_FILE_SEP_CHAR);
openFileName = (char *) uprv_malloc(dirlen + filelen + 2);
printf("autodetected encoding %s\n", cp);
}
/* Parse the data into an SRBRoot */
- data = parse(ucbuf, inputDir, outputDir, status);
+ data = parse(ucbuf, inputDir, outputDir, !omitBinaryCollation, status);
if (data == NULL || U_FAILURE(*status)) {
fprintf(stderr, "couldn't parse the file %s. Error:%s\n", filename,u_errorName(*status));
int32_t pkgLen = 0; /* length of package prefix */
+
if (U_FAILURE(*status)) {
return 0;
}